Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-and-push: escape annotation values #1419

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

chmeliik
Copy link
Contributor

Due to tektoncd/cli#2402, annotation values that contain commas or double-quotes currently break 'tkn bundle push'.

Escape such annotation values in a way that's compatible with the pflag.StringSlice [1] parser that 'tkn bundle push' uses to parse CLI arguments.

https://pkg.go.dev/github.com/spf13/pflag#FlagSet.StringSlice

Before you complete this pull request ...

Look for any open pull requests in the repository with the title "e2e-tests update" and
see if there are recent e2e-tests updates that will be applicable to your change.

@chmeliik
Copy link
Contributor Author

/test

Due to tektoncd/cli#2402, annotation values
that contain commas or double-quotes currently break 'tkn bundle push'.

Escape such annotation values in a way that's compatible with the
pflag.StringSlice [1] parser that 'tkn bundle push' uses to parse
CLI arguments.

[1]: https://pkg.go.dev/github.com/spf13/pflag#FlagSet.StringSlice

Signed-off-by: Adam Cmiel <acmiel@redhat.com>
@chmeliik
Copy link
Contributor Author

/test

@chmeliik
Copy link
Contributor Author

$ skopeo inspect --raw docker://quay.io/konflux-ci/pull-request-builds@sha256:48f87850d2c9c41cdde7c67571b3054dc0f14de01337f1f940f1231502625289 | jq '.annotations["org.opencontainers.image.description"]' -r

Clones redhat-appstudio/infra-deployments repository, runs script in "SCRIPT" parameter, generates pull-request for redhat-appstudio/infra-deployments repository.

The description of the update-infra-deployments task, which I updated in a test commit to contain both double-quotes and a comma, was preserved correctly
🎉

@chmeliik chmeliik marked this pull request as ready for review September 13, 2024 16:04
@chmeliik
Copy link
Contributor Author

/test

@chmeliik chmeliik added this pull request to the merge queue Sep 13, 2024
Merged via the queue into konflux-ci:main with commit ef2ba85 Sep 13, 2024
13 checks passed
@chmeliik chmeliik deleted the fix-description-annotation branch September 16, 2024 07:18
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