-
Notifications
You must be signed in to change notification settings - Fork 162
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
zarf tools registry pull doesn't seem to respect --platform in newer version #2571
Comments
Verified the issue is NOT present in 0.33.2. So this is a brand new issue with 0.34.0. |
I have verified that this is a regression caused by #2460. During the refactoring of image pulling the options slice was changed from a pointer to a a value. The problem here is that the arguments are evaluated immediately and due to how the platform options are populated these are run at a later time. I will create a PR to fix this. |
## Description During refactoring in #2460 we broke the option parameters for Crane. Honestly I am not surprised that this has happened. The way that these options are parsed and passed around are a threading mess. The issue is that this seems to also be the method in which Crane does it. This change reverts the specific pointer changes which caused the issue in the first place. This is one the reasons why I do not like Cobra. The use of init functions and global variables are doomed to cause threading issues. Reminds me of writing Java programs with Spring Boot. ## Related Issue Fixes #2571 ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow) followed Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
## Description During refactoring in #2460 we broke the option parameters for Crane. Honestly I am not surprised that this has happened. The way that these options are parsed and passed around are a threading mess. The issue is that this seems to also be the method in which Crane does it. This change reverts the specific pointer changes which caused the issue in the first place. This is one the reasons why I do not like Cobra. The use of init functions and global variables are doomed to cause threading issues. Reminds me of writing Java programs with Spring Boot. ## Related Issue Fixes #2571 ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow) followed Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Environment
Device and OS: amd64, RHEL 8
App version: 0.34.0
Kubernetes distro being used: k3s, but not relevant here
Other:
Steps to reproduce
$ ./zarf_v0.33.0_Linux_amd64 tools registry pull --platform linux/arm64 registry.k8s.io/pause:3.9 test-0.33.0.tar
$ ./zarf_v0.34.0_Linux_amd64 tools registry pull --platform linux/arm64 registry.k8s.io/pause:3.9 test-0.34.0.tar
Expected result
-rw-r--r--. 1 root root 268288 May 31 12:21 test-0.33.0.tar
-rw-r--r--. 1 root root 268288 May 31 12:21 test-0.34.0.tar
And both image archives should contain arm64 versions
Actual Result
-rw-r--r--. 1 root root 268288 May 31 12:21 test-0.33.0.tar
-rw-r--r--. 1 root root 322048 May 31 12:21 test-0.34.0.tar
The size of 322048 happens to be the amd64 version of pause.
Visual Proof (screenshots, videos, text, etc)
Severity/Priority
Priority is up to you of course, my workaround for now is continue using 0.33.0. I have not tested 0.33.1/0.33.2 yet to see where it breaks.
Additional Context
Add any other context or screenshots about the technical debt here.
It's not just the pause image, seems to be any image, pause is just small and happened to be the first one I noticed. You can see it with nginx too for example which is a popular one:
$ ./zarf_v0.33.0_Linux_amd64 tools registry pull --platform linux/arm64 nginx nginx-0.33.0.tar
$ ./zarf_v0.34.0_Linux_amd64 tools registry pull --platform linux/arm64 nginx nginx-0.34.0.tar
-rw-r--r--. 1 root root 67664896 May 31 12:24 nginx-0.33.0.tar
-rw-r--r--. 1 root root 71000576 May 31 12:24 nginx-0.34.0.tar
The text was updated successfully, but these errors were encountered: