Skip to content

Move resource verification into a separate step if argo rollouts support feature is enabled#2002

Open
akavalchuk wants to merge 3 commits into
mainfrom
akavalchuk/sie-63-extract-verify-resources-action
Open

Move resource verification into a separate step if argo rollouts support feature is enabled#2002
akavalchuk wants to merge 3 commits into
mainfrom
akavalchuk/sie-63-extract-verify-resources-action

Conversation

@akavalchuk

@akavalchuk akavalchuk commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Adds a new kubernetes-verify-resources Calamari command and gates inline resource status checking behind the ArgoRolloutsSupport feature toggle. When the toggle is enabled, deploy steps apply resources and emit the AppliedResources output variable, but defer status verification to a separate verification action that runs afterwards.

Relates to SIE-63
Related Server PR

@scme0 scme0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a few comments. One important one. Make sure you remove the guard in ResourceStatusReportScriptWrapper.cs before you merge

var waitForJobs = variables.GetFlag(SpecialVariables.WaitForJobs);

var statusCheck = statusReporter.Start(timeoutSeconds, waitForJobs, resources);
var success = statusCheck.WaitForCompletionOrTimeout(CancellationToken.None).GetAwaiter().GetResult();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sucks that Command doesn't handle async natively. We can probably refactor this in Calamari now that we aren't support .net framework. Maybe I'll look at it for sharpening.


if (!success)
{
throw new CommandException("Resource verification failed.");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can't remember, do we get logging for the failure in statusReporter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image Yes, it logs that status check terminated because of errors. Do you suggest removing log from here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Anything in verbose? Might be good to know which resource failed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, verbose logs have info about what exactly failed

continue;

var name = string.IsNullOrEmpty(resource.Namespace) ? resource.Name : $"{resource.Namespace}/{resource.Name}";
log.Warn($"Unable to fully verify resource '{gvk}' '{name}'. Calamari does not know the readiness criteria for this resource type; only its existence will be confirmed.");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe one for Idan, but do we want to indicate that using the Agent with kubernetes monitor may unlock verification for their type. Possibly a link to a public doc which will indicate which types are supported for verification? It should be pretty expansive once https://linear.app/octopus/issue/SIE-143/add-argo-rollout-support-to-kubernetes-monitor is completed.

}
conventions.Add(new KubernetesAuthContextConvention(log, commandLineRunner, kubectl, fileSystem));

new ConventionProcessor(deployment, conventions, log).RunConventions();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there no shared code we can leverage for auth stuff?

{
Options.Parse(commandLineArguments);

var json = variables.Get(SpecialVariables.AppliedResources);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If the variable doesn't exist we should fail, I think. Otherwise people might think verification is working correctly when there is actually some issue with it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If the variable exists and it's an empty array [], then the info log is good.

if (OctopusFeatureToggles.ArgoRolloutsSupportFeatureToggle.IsEnabled(variables))
{
return false;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We shouldn't do this block yet because not all kubernetes steps are supported for the new verification step. This guard should be added to SIE-155 - see the ticket for details.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Currently only the steps with dedicated commands in Calamari are supported: RawYaml, Helm, Kustomize

@akavalchuk akavalchuk force-pushed the akavalchuk/sie-63-extract-verify-resources-action branch 2 times, most recently from 673c4b1 to d8da1f9 Compare June 11, 2026 05:46
@akavalchuk akavalchuk force-pushed the akavalchuk/sie-63-extract-verify-resources-action branch from d8da1f9 to 40da78c Compare June 11, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants