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

Case when the registry link for pull is a image but the flags are -I along with —image-is-bundle-check flag=true which results in the image being pulled. #559

Closed
ashpect opened this issue Aug 11, 2023 · 5 comments
Labels
bug This issue describes a defect or unexpected behavior

Comments

@ashpect
Copy link
Contributor

ashpect commented Aug 11, 2023

What steps did you take:
Pls see #544 for context.
During my attempt to fix #544 and my analysis of all the cases and the flow of code with the flags.
Screenshot 2023-08-11 at 2 11 45 PM
I have opened a PR with a suggestive fix.

What happened:
It seems like the case when the link it image but the flags are -I along with —image-is-bundle-check flag=true results in the image being pulled.

What did you expect:
An error when I pass the wrong flag with link of an image.

Environment:

  • imgpkg version (0.37.3):
  • Docker registry used (Docker HUB):
  • OS (e.g. from /etc/os-release):

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@ashpect ashpect added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Aug 11, 2023
@ashpect ashpect changed the title case when the link it image but the flags are -I along with —image-is-bundle-check flag=true results in the image being pulled. Case when the registry link for pull is a image but the flags are -I along with —image-is-bundle-check flag=true which results in the image being pulled. Aug 11, 2023
@praveenrewar
Copy link
Member

Hey @ashpect, I think there is a some confusion around the image-is-bundle-check flag. The flag description says:

--image-is-bundle-check                       Error when image is a bundle (disable pulling bundles via -i) (default true)

So the expectation is

  • when -b is being used, then usage of this flag shouldn't be allowed as it's only meant to be used when -i us set (we can add it to the validations). This is issue Copying a bundle with the image-is-bundle-check being false doesn't work as expected. #544.
  • when -i is used and we are trying to pull something that is actually a bundle, then
    • we should error out if the flag is set to true, which should be working as expected.
    • we should pull the bundle as an image if the flag is set to false, which should be working as expected.
  • when -i is used and we are trying to pull something that is actually an image, then the value of this flag shouldn't matter which should also be working as expected.

@ashpect
Copy link
Contributor Author

ashpect commented Aug 19, 2023

Thanks for the input. I'll change the fix accordingly.
I have closed the original pr for both issues and fixed #544 here

However, regarding this current opened issue :
"when -i is used and we are trying to pull something that is actually an image, then the value of this flag shouldn't matter which should also be working as expected." : Agreed but if someone sets the flag to true (manually) can be a bit confusing in this case, since it's an image ( as checked by code) ; so shouldn't we error saying that what you are pulling is an image, don't use this flag , or maybe at least a warning stating that we pulled the image , but the don't use this flag. ?

@praveenrewar
Copy link
Member

The flag --image-is-bundle-check is basically asking imgpkg to check if the image that we are trying to pull is a bundle and through an error if it's a bundle, but if it is an image then pull the image. So, if what we are trying to pull is an image, then we would want to pull the image irrespective of the value of --image-is-bundle-check (the check will be performed, but won't through an error because it's an image).

@ashpect
Copy link
Contributor Author

ashpect commented Aug 20, 2023

Hmm..thanks, understood. I was just hung up on the fact that the user might use flag with true confusing himself. But understood that the flag is not meant for setting as false, its default being true.

@praveenrewar
Copy link
Member

Closing this issue, but let me know if you have any other questions.

@github-actions github-actions bot removed the carvel triage This issue has not yet been reviewed for validity label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior
Projects
Archived in project
Development

No branches or pull requests

2 participants