fix: inspect normalized k3s artifact image refs
This commit is contained in:
@@ -2042,7 +2042,13 @@ function d601K3sArtifactDeployScript(options: ArtifactRegistryOptions, spec: Art
|
||||
"containerd_config_label() {",
|
||||
" ref=\"$1\"",
|
||||
" key=\"$2\"",
|
||||
" target_digest=$(root_exec ctr --address /run/k3s/containerd/containerd.sock -n k8s.io images info \"$ref\" | python3 -c 'import json,sys; print(((json.load(sys.stdin).get(\"Target\") or {}).get(\"Digest\")) or \"\")')",
|
||||
" actual_ref=\"$ref\"",
|
||||
" if ! root_exec ctr --address /run/k3s/containerd/containerd.sock -n k8s.io images inspect \"$actual_ref\" >/dev/null 2>&1; then",
|
||||
" suffix=\"${ref#*/}\"",
|
||||
" actual_ref=$(root_exec ctr --address /run/k3s/containerd/containerd.sock -n k8s.io images ls -q | grep -F \"/$suffix\" | head -1 || true)",
|
||||
" fi",
|
||||
" test -n \"$actual_ref\"",
|
||||
" target_digest=$(root_exec ctr --address /run/k3s/containerd/containerd.sock -n k8s.io images inspect \"$actual_ref\" | python3 -c 'import re,sys; m=re.search(r\"@(sha256:[0-9a-f]+)\", sys.stdin.read()); print(m.group(1) if m else \"\")')",
|
||||
" test -n \"$target_digest\"",
|
||||
" python3 - \"$target_digest\" \"$key\" <<'PY'",
|
||||
"import json",
|
||||
|
||||
Reference in New Issue
Block a user