X-Git-Url: https://gerrit.onap.org/r/gitweb?p=multicloud%2Fframework.git;a=blobdiff_plain;f=artifactbroker%2Fplugins%2Fforwarding-plugins%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fdistribution%2Fforwarding%2Fk8s%2FK8sArtifactForwarder.java;fp=artifactbroker%2Fplugins%2Fforwarding-plugins%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fdistribution%2Fforwarding%2Fk8s%2FK8sArtifactForwarder.java;h=5f93e28aeef9c097a664e9d1ff46985c04ad2d8d;hp=8ad07df4a0b9c60e64c8994ed06cb42415db77d5;hb=04ab3c197d2791db89a6d67e6c31fb987154fb95;hpb=7351cde6316dc9524bbc6856924456525802f9e1 diff --git a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java index 8ad07df..5f93e28 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java +++ b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java @@ -66,6 +66,7 @@ public class K8sArtifactForwarder implements ArtifactForwarder { private static final Logger LOGGER = FlexLogger.getLogger(K8sArtifactForwarder.class); private static final String BASE_PATH = "http://localhost:9015/v1/rb/definition"; private static final String CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT = "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"; + private static final String HELM_ARTIFACT = "HELM"; private Map artifactMap; private K8sArtifactForwarderParameterGroup configurationParameters = null; @@ -154,23 +155,35 @@ public class K8sArtifactForwarder implements ArtifactForwarder { boolean found = false; for (String artifact: artifacts) { - if ( artifactMap.get(artifact) != null - && artifactMap.get(artifact).getArtifactType().equals("CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT")) { - if ( cloudArtifactCount == 0 ) - firstCloudArtifact = artifactMap.get(artifact); - cloudArtifactCount++; - IArtifactInfo tmpArtifact = artifactMap.get(artifact); - if ( tmpArtifact.getArtifactName().toLowerCase().startsWith(vfNamePrefix) ) { - cloudArtifact = tmpArtifact; - found = true; - break; - } + if (artifactMap.get(artifact) != null + && artifactMap.get(artifact).getArtifactType().equals(HELM_ARTIFACT)) { + firstCloudArtifact = artifactMap.get(artifact); + cloudArtifact = firstCloudArtifact; + cloudArtifactCount = 1; + found = true; + break; } } + if ( found == false ) + for (String artifact: artifacts) { + if ( artifactMap.get(artifact) != null + && artifactMap.get(artifact).getArtifactType().equals(CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT)) { + if ( cloudArtifactCount == 0 ) + firstCloudArtifact = artifactMap.get(artifact); + cloudArtifactCount++; + IArtifactInfo tmpArtifact = artifactMap.get(artifact); + if ( tmpArtifact.getArtifactName().toLowerCase().startsWith(vfNamePrefix) ) { + cloudArtifact = tmpArtifact; + found = true; + break; + } + } + } + if ( found == false ) { if ( firstCloudArtifact == null ) { - System.out.println(" meets error , no CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT type found "); + System.out.println(" meets error , no CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT or HELM type found "); return false; } else { if ( cloudArtifactCount == 1 || vfNamePrefix == "" ) {