Skip to content

Add Argo Rollout support to ContainerImageReplacer#1856

Open
scme0 wants to merge 7 commits intomainfrom
scottmerchant/sie-11-patch-image-argocd-step-to-support-argo-rollouts
Open

Add Argo Rollout support to ContainerImageReplacer#1856
scme0 wants to merge 7 commits intomainfrom
scottmerchant/sie-11-patch-image-argocd-step-to-support-argo-rollouts

Conversation

@scme0
Copy link
Copy Markdown
Collaborator

@scme0 scme0 commented Mar 31, 2026

Argo Rollouts are CRDs (argoproj.io/v1alpha1, kind: Rollout) that the
Kubernetes SDK cannot deserialize. Detect Rollout resources from the
already-parsed YAML before the SDK deserialization step and handle them
via YAML node traversal, using the same spec.template.spec.containers
path as Deployments.

I've also updated the code to report a warning if a type is not known, just in case the user expects the step to update the image for that type.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Fixes SIE-11

⚠️ Does this change require a corresponding Server Change?
⚠️ If so - please add a "Requires Server Change" label to this PR!

scme0 and others added 3 commits March 31, 2026 12:45
Argo Rollouts are CRDs (argoproj.io/v1alpha1, kind: Rollout) that the
Kubernetes SDK cannot deserialize. Detect Rollout resources from the
already-parsed YAML before the SDK deserialization step and handle them
via YAML node traversal, using the same spec.template.spec.containers
path as Deployments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three new tests covering:
- Full Rollout with containers and initContainers (canary strategy)
- Rollout with no matching images leaves YAML unchanged
- Rollout with containers only (blueGreen strategy)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the YAML-node-based workaround with a proper typed model
(V1alpha1Rollout) registered via KubernetesYaml.LoadAllFromString's
typeMap parameter. Rollouts are now deserialized the same way as
native Kubernetes types and handled in the existing switch statement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator Author

@scme0 scme0 Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no c# nuget package/library with this type defined. We could generate the class from argo rollouts golang or yaml CRD definitions but this would generate a huge and complex C# type which is mostly not needed. The minimal class is more readable and only has the properties that we care about.

scme0 and others added 4 commits March 31, 2026 15:33
…eplacement

Unknown CRDs (types not in the Kubernetes SDK or the custom type map) are
flagged via ImageReplacementResult.UnrecognisedKinds and surfaced as a
WarnFormat log in BaseUpdater. Known SDK types that have no containers
(Service, ConfigMap, etc.) fall through the switch silently as before,
identified by their IKubernetesObject implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ContainerImageReplacerTests: verifies unknown CRDs populate UnrecognisedKinds
  and known SDK types (Service) do not
- UpdateArgoCDAppImagesInstallConventionTests: integration test verifying
  the warning is logged when processing a file containing an unknown CRD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant