Conversation
With --use-image-digests, pinImages hands the bundle to operator-manifest-tools, which rewrites the whole CSV with gopkg.in/yaml.v3. That encoder indents sequences, while the CSV was written with sigs.k8s.io/yaml, which does not, so a pinned bundle differed from an unpinned one on nearly every list rather than only on its images. Re-encode the CSVs with sigs.k8s.io/yaml once they are pinned. The content is unchanged; on the reproducer from the issue the diff between the two bundles drops from 87 lines to the image reference and relatedImages. Closes operator-framework#7068 Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
This branch has not been deployed
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.
Description of the change:
With
--use-image-digests,pinImagespasses the bundle to operator-manifest-tools, which rewrites the whole CSV withgopkg.in/yaml.v3. That encoder indents sequences, while the CSV was first written withsigs.k8s.io/yaml, which does not. So a pinned CSV differs from an unpinned one on nearly every list, not just the images.This re-encodes the CSV with
sigs.k8s.io/yamlafter pinning. Content is unchanged.Motivation for the change:
Closes #7068
On the reproducer from the issue, the diff between the two bundles goes from 87 lines to 8: the digest in place of the tag, and the
relatedImagesblock.The fix stays in operator-sdk rather than changing
ToYamlin operator-manifest-tools, since other projects use that output as is.Tests cover the round trip, non-CSV manifests being left alone, and a symlinked manifest outside
manifests/, which the fix must still follow.Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments(seechangelog/fragments/00-template.yaml)website/content/en/docs