Fix post-renderer-scripts to work with old and new LCM Dockerfile 19/15719/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 6 Feb 2026 10:54:37 +0000 (11:54 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 6 Feb 2026 10:55:24 +0000 (11:55 +0100)
Change-Id: I40a3eb008c7c8a1b50e0484733163921adf83ed7
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_lcm/n2vc/post-renderer-scripts/nodeSelector/nodeSelector
osm_lcm/n2vc/post-renderer-scripts/podLabels/podLabels

index 255c2d8..63dc4a5 100755 (executable)
@@ -23,9 +23,14 @@ dirname="nodeSelector-"$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
 
 mkdir /tmp/$dirname && cd /tmp/$dirname
 
-cp /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/nodeSelector/kustomization.yaml .
-
-cp /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/nodeSelector/nodeSelector-deployment-patch.yaml .
+if [ -f /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/nodeSelector/kustomization.yaml ]; then
+    cp /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/nodeSelector/*.yaml .
+elif [ -f /app/osm_lcm/n2vc/post-renderer-scripts/nodeSelector/kustomization.yaml ]; then
+    cp /app/osm_lcm/n2vc/post-renderer-scripts/nodeSelector/*.yaml .
+else
+    echo "kustomization.yaml not found in expected locations."
+    exit 1
+fi
 
 cat <&0 > all.yaml
 
@@ -40,4 +45,4 @@ done
 
 echo -e "$content" >> nodeSelector-deployment-patch.yaml
 
-kubectl kustomize && cd .. && rm -r /tmp/$dirname
\ No newline at end of file
+kubectl kustomize && cd .. && rm -r /tmp/$dirname
index 03c8d5d..328d8c7 100755 (executable)
@@ -23,7 +23,14 @@ dirname="podlabels-"$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
 
 mkdir /tmp/$dirname && cd /tmp/$dirname
 
-cp /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/podLabels/kustomization.yaml .
+if [ -f /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/podLabels/kustomization.yaml ]; then
+    cp /usr/lib/python3/dist-packages/osm_lcm/n2vc/post-renderer-scripts/podLabels/kustomization.yaml .
+elif [ -f /app/osm_lcm/n2vc/post-renderer-scripts/podLabels/kustomization.yaml ]; then
+    cp /app/osm_lcm/n2vc/post-renderer-scripts/podLabels/kustomization.yaml .
+else
+    echo "kustomization.yaml not found in expected locations."
+    exit 1
+fi
 
 cat <&0 > all.yaml
 
@@ -39,4 +46,4 @@ done
 # Add content to the file
 echo -e "\n$content" >> kustomization.yaml
 
-kubectl kustomize && cd .. && rm -r /tmp/$dirname
\ No newline at end of file
+kubectl kustomize && cd .. && rm -r /tmp/$dirname