Skip to content

Allow '=' in push artifact annotation values - #6159

Open
sarankumar1325 wants to merge 1 commit into
fluxcd:mainfrom
sarankumar1325:push-artifact-annotation-equals
Open

sarankumar1325 wants to merge 1 commit into
fluxcd:mainfrom
sarankumar1325:push-artifact-annotation-equals

Conversation

@sarankumar1325

Copy link
Copy Markdown

flux push artifact --annotations split each value on every = and rejected anything that didn't give exactly two parts. That made it impossible to set values that contain =, for example:

flux push artifact ... --annotations='org.opencontainers.image.documentation=https://app.org/docs?page=1'
✗ invalid annotation org.opencontainers.image.documentation=https://app.org/docs?page=1, must be in the format key=value

The fix splits on the first = only (strings.Cut). Input without any = still returns the same error.

Tests: TestPushArtifactAnnotationValueWithEquals pushes to the test registry and checks the manifest annotations. It fails without the fix. TestPushArtifactInvalidAnnotation checks that the error for a missing = is kept. I ran go test --tags=unit ./cmd/flux/ -run 'Artifact|Push', go vet and gofmt.

AI disclosure: prepared with an AI assistant (Grok Bot), following AGENTS.md. I reviewed the change.

flux push artifact split each --annotations value on every '=' and
rejected anything that did not give exactly two parts, so values
such as URLs with query strings or base64 padding could not be set.
Split on the first '=' only.

Signed-off-by: Saran Kumar <120080287+sarankumar1325@users.noreply.github.com>
Assisted-by: Grok Bot/grok

This branch has not been deployed

No deployments
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