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

fix: add variant to manifest entry #368

Merged
merged 2 commits into from
Sep 26, 2023
Merged

fix: add variant to manifest entry #368

merged 2 commits into from
Sep 26, 2023

Conversation

thesayyn
Copy link
Collaborator

part of #362

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

Could you help me understand why it's an improvement? It feels approx the same performance and complexity overall

oci/tests/BUILD.bazel Outdated Show resolved Hide resolved
@thesayyn
Copy link
Collaborator Author

Could you help me understand why it's an improvement? It feels approx the same performance and complexity overall

the json.encode_ident does not provide any performance improvement over the templated json, it is purely nice to have to allow more properties to be added to the platform sub-object conditionally without templating tricks. https://github.com/opencontainers/image-spec/blob/main/image-index.md#image-index-property-descriptions
I can revert that.

That said the use of write_file is unnecessary here and adds some performance overhead. eg: spawning some actions to write a file which is pure overhead given that we already write the same content to the BUILD file.

@thesayyn
Copy link
Collaborator Author

actually, now that I think about it more, I will keep that part the same just make it more ergonomic. eg: instead of two templates, just use one.

@thesayyn thesayyn changed the title refactor: remove templated json generation fix: add variant to manifest entry Sep 19, 2023
@thesayyn
Copy link
Collaborator Author

@alexeagle i took back the templated strings back and made an util function that can add variant as well. now we match crane pull 100% of the cases.

now we have the ability to write a starlark unit test for the util function. see #138

@alexeagle alexeagle merged commit ca579be into main Sep 26, 2023
15 checks passed
@alexeagle alexeagle deleted the refactor_2 branch September 26, 2023 00:13
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