Skip to content

Comments

ArgoCD: ImageTagUpdate accepts Helm Paths to update via variables#1787

Open
rain-on wants to merge 29 commits intomainfrom
tmm/new_helm_approach
Open

ArgoCD: ImageTagUpdate accepts Helm Paths to update via variables#1787
rain-on wants to merge 29 commits intomainfrom
tmm/new_helm_approach

Conversation

@rain-on
Copy link
Contributor

@rain-on rain-on commented Feb 17, 2026

This change can be included without changes to server, as the changes will be ignored until appropriate changes exist in server.

When dealing with Helm(and ref) sources, the Argo Image Tag Update step is responsible for inserting image-tags (aka versions) into the value's files being referenced.

The User is required to inform Octopus which values represent an image version (it is not obvious as per normal K8s which have schemas for their yaml files).

Prior to this change, the user would need to insert the helm-values to update in a source-scoped annotation on the application - this was complex!

To simplify the process - we now allow users to specify an extra field on each container/package referenced by the step, this field is to contain the helm-value containing the tag/version of the associated container/package.

The helm-value specified could contain one of the following content-types:

  • A plain text version string (eg "1.0")
  • An image-name and tag (eg "nginx:1.0")
  • A Registry and image-name (eg docker.io/nginx)
  • A registry, imageName and Tag (eg docker.io/nginx:1.0)

If the specified helm-value contains additional information - the step will ensure the available data correlates with the package in the step prior to updating just the tag information in the value string.

@rain-on rain-on requested review from flin-8 and tleed5 February 20, 2026 02:19

public static string IndexedPackagePurpose(string packageReferenceName) => $"Octopus.Action.Package[{packageReferenceName}].Purpose";

public static string HelmValueYamlPath(string packageReferenceName) => $"Octopus.Action.Package[{packageReferenceName}].HelmValueYamlPath";
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on what I used in my PRs

Suggested change
public static string HelmValueYamlPath(string packageReferenceName) => $"Octopus.Action.Package[{packageReferenceName}].HelmValueYamlPath";
public static string HelmValueYamlPath(string packageReferenceName) => $"Octopus.Action.Package[{packageReferenceName}].HelmReplacementPath";

Alternatively I can change it on my PRs to match what you have

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with HelmReplacementPath 👍


public static readonly string PurgeOutput = "Octopus.Action.ArgoCD.PurgeOutputFolder";

public static readonly string UseHelmValueYamlPathFromStep = "Octopus.Action.ArgoCD.UseHelmValueYamlPathFromStep";
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems strange that is this under the git class, but it all the other ArgoCD stuff is under there so 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah - thankfully its now gone :)

return new UpdateArgoCDAppDeploymentConfig(commitParameters, packageReferences);
var packageHelmReference = deployment.Variables.GetContainerPackages().Select(p => new ContainerImageReferenceAndHelmReference(ContainerImageReference.FromReferenceString(p.PackageName),
p.HelmReference)).ToList();
var useHelmValueYamlPathFromStep = deployment.Variables.GetFlag(SpecialVariables.Git.UseHelmValueYamlPathFromStep, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the reason for using this new variable over the feature toggle due to the fact turning off the feature toggle won't exactly be backwards compatible e.g. we release this, people convert to using the step method, we then turn the feature toggle off and all of a sudden their deployments stop working because we are expecting an annotation containing the replacement path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm.
Wondering about the featureToggle.
If we turn it on - and people set variables - then they turn it off.
The variables will remain in the deployment I suspect (?) - but Calamari shouldn't really use them.

With that all in mind - we probably should factor in the feature toggle here too.

Copy link
Contributor

@tleed5 tleed5 left a comment

Choose a reason for hiding this comment

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

Looks good to me, just one question around the logging

Comment on lines +70 to +77
var imagesWithNoHelmReference = deploymentConfig.ImageReferences.Where(c => c.HelmReference is null).ToList();
if (imagesWithNoHelmReference.Any())
{
foreach (var image in imagesWithNoHelmReference)
{
log.Info($"{image.ContainerReference.ToString()} will not be updated, as no helm yaml path has been specified for it in the step configuration");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this log everytime someone deploys even if they are updating non-helm sources?

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.

2 participants