This is an automated email from the ASF dual-hosted git repository.

sciabarracom pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new b6e694b  kustomize: quote newTag string to avoid all-digit tag misparse
b6e694b is described below

commit b6e694b2756a88b82761173a60eb1c7bf77518c8
Author: Michele Sciabarra <[email protected]>
AuthorDate: Tue Jul 7 16:30:04 2026 +0200

    kustomize: quote newTag string to avoid all-digit tag misparse
    
    When git rev-parse --short HEAD produces an all-digit SHA (e.g. 0045691),
    kustomize's Go JSON decoder unmarshals it as a number and fails with:
      json: cannot unmarshal number into Go struct field Image.images.newTag of 
type string
    Quoting the value forces YAML to treat it as a string in all cases.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
 TaskfileTest.yml       | 2 +-
 nuvolaris/kustomize.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/TaskfileTest.yml b/TaskfileTest.yml
index 0116905..307c7c2 100644
--- a/TaskfileTest.yml
+++ b/TaskfileTest.yml
@@ -58,7 +58,7 @@ tasks:
       images:
       - name: ghcr.io/nuvolaris/nuvolaris-operator:latest
         newName: ${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}
-        newTag: {{.OPERATOR_TAG}}             
+        newTag: "{{.OPERATOR_TAG}}"
       resources:
       - operator-pod.yaml             
       __EOF__
diff --git a/nuvolaris/kustomize.py b/nuvolaris/kustomize.py
index 9ade46a..5943582 100644
--- a/nuvolaris/kustomize.py
+++ b/nuvolaris/kustomize.py
@@ -146,16 +146,16 @@ def image(name, newName=None, newTag=None):
     >>> print(ku.image("busybox", newTag="nightly"), end='')
     images:
     - name: busybox
-      newTag: nightly
+      newTag: "nightly"
     >>> print(ku.image("busybox", "nginx", "nightly"), end='')
     images:
     - name: busybox
       newName: nginx
-      newTag: nightly
+      newTag: "nightly"
     """
     r = f"images:\n- name: {name}\n"
     if newName: r += f"  newName: {newName}\n"
-    if newTag:  r += f"  newTag: {newTag}\n"
+    if newTag:  r += f'  newTag: "{newTag}"\n'
     return r
 
 # generate a configmap kustomization expanding a template

Reply via email to