Add Argo Rollout support to ContainerImageReplacer#1856
Open
Conversation
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>
scme0
commented
Mar 31, 2026
Collaborator
Author
There was a problem hiding this comment.
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.
…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>
…-to-support-argo-rollouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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