fix(gitops): apply argocd with server-side ownership
This commit is contained in:
1 parent
9d263ebcc0
commit
92f26c4d64
3 files changed
+9
-3
No files matched your search
@@ -36,7 +36,13 @@ The script is idempotent. Before applying anything, it:
|
||||
3. Verifies all three exact Harbor image references are in the local k3s image cache.
|
||||
4. Records the existing Argo CD Applications.
|
||||
|
||||
It then applies the render, waits up to 300 seconds per workload, verifies the live pull policies, rejects image-pull failures, and confirms that pre-existing Applications remain present.
|
||||
It then applies the render with Kubernetes Server-Side Apply and conflict resolution, waits up to 300 seconds per workload, verifies the live pull policies, rejects image-pull failures, and confirms that pre-existing Applications remain present.
|
||||
|
||||
Server-Side Apply is required for Argo CD 3.3 and later because the ApplicationSet CRD exceeds Kubernetes' 262144-byte annotation limit for client-side apply. The flags match the official Argo CD install and upgrade procedure:
|
||||
|
||||
```text
|
||||
--server-side --force-conflicts
|
||||
```
|
||||
|
||||
The script never pulls, retags, deletes, or garbage-collects images. If an image is missing, restore Harbor or deliberately import that exact image before retrying.
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ else
|
||||
fi
|
||||
|
||||
echo "Applying the verified manifest..."
|
||||
k3s kubectl apply -f "$rendered_manifest"
|
||||
k3s kubectl apply --server-side --force-conflicts -f "$rendered_manifest"
|
||||
|
||||
while read -r resource _containers; do
|
||||
[[ -n "$resource" ]] || continue
|
||||
|
||||
@@ -32,7 +32,7 @@ while IFS= read -r actual_image; do
|
||||
"${expected_images[0]}"|"${expected_images[1]}"|"${expected_images[2]}") ;;
|
||||
*) fail "unexpected workload image in render: $actual_image" ;;
|
||||
esac
|
||||
done < <(awk '$1 == "image:" {gsub(/\"/, "", $2); print $2}' "$rendered_manifest" | sort -u)
|
||||
done < <(awk '$1 == "image:" {gsub(/"/, "", $2); print $2}' "$rendered_manifest" | sort -u)
|
||||
|
||||
if grep -Eq 'image:[[:space:]]+(quay\.io|ghcr\.io|public\.ecr\.aws)/' "$rendered_manifest"; then
|
||||
fail "upstream image reference remains in render"
|
||||
|
||||
Reference in new issue
Block a user