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

imgpkg push help string references --lock option that doesn't exist. #354

Closed
GrahamDumpleton opened this issue Mar 15, 2022 · 7 comments
Closed
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed good first issue An issue that will be a good candidate for a new contributor

Comments

@GrahamDumpleton
Copy link

GrahamDumpleton commented Mar 15, 2022

What steps did you take:

Run:

imgpkg push --help

This generates:

      --lock-output string                          Location to output the generated lockfile. Option only available when using --bundle or --lock flags

There is however no --lock option listed and trying to supply the option results in an error.

$ imgpkg push --file . --image localhost:5001/xxx:latest --lock --lock-output /tmp/x.lock
imgpkg: Error: unknown flag: --lock

What happened:

Shows incorrect message. Luckily did not catch on fire.

What did you expect:

That help string would be accurate.

Anything else you would like to add:

Nope.

Environment:

  • imgpkg version (use imgpkg --version):

    imgpkg version 0.26.0
    

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.

@GrahamDumpleton GrahamDumpleton added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Mar 15, 2022
@GrahamDumpleton
Copy link
Author

GrahamDumpleton commented Mar 15, 2022

Whoops, wrong repo. Can someone move this to the correct repo.

@sethiyash sethiyash transferred this issue from carvel-dev/ytt Mar 15, 2022
@joaopapereira
Copy link
Member

Thanks for opening this issue.

I was looking at imgpkg push --help output and do not see the --lock option

Push files as image

Usage:
  imgpkg push [flags]

Examples:

  # Push bundle repo/app1-config with contents of config/ directory
  imgpkg push -b repo/app1-config -f config/

  # Push image repo/app1-config with contents from multiple locations
  imgpkg push -i repo/app1-config -f config/ -f additional-config.yml

Flags:
  -b, --bundle string                               Set bundle (example: docker.io/dkalinin/test-content)
  -f, --file strings                                Set file (format: /tmp/foo) (can be specified multiple times)
      --file-exclusion strings                      Exclude file whose path, relative to the bundle root, matches (format: bar.yaml, nested-dir/baz.txt) (can be specified multiple times) (default [.git])
  -h, --help                                        help for push
  -i, --image string                                Set image (example: docker.io/dkalinin/test-content)
      --lock-output string                          Location to output the generated lockfile. Option only available when using --bundle or --lock flags
      --registry-anon                               Set anonymous auth ($IMGPKG_ANON)
      --registry-azure-cr-config string             Path to the file containing Azure container registry configuration information. ($IMGPKG_REGISTRY_AZURE_CR_CONFIG)
      --registry-ca-cert-path strings               Add CA certificates for registry API (format: /tmp/foo) (can be specified multiple times)
      --registry-insecure                           Allow the use of http when interacting with registries
      --registry-password string                    Set password for auth ($IMGPKG_PASSWORD)
      --registry-response-header-timeout duration   Maximum time to allow a request to wait for a server's response headers from the registry (ms|s|m|h) (default 30s)
      --registry-retry-count int                    Set the number of times imgpkg retries to send requests to the registry in case of an error (default 5)
      --registry-token string                       Set token for auth ($IMGPKG_TOKEN)
      --registry-username string                    Set username for auth ($IMGPKG_USERNAME)
      --registry-verify-certs                       Set whether to verify server's certificate chain and host name (default true)

Global Flags:
      --color            Set color output (default true)
      --column strings   Filter to show only given columns
      --debug            Enables debugging
      --json             Output as JSON
      --tty              Force TTY-like output
  -y, --yes              Assume yes for any prompt

Succeeded

I think that you are looking at the option --lock-output and writing --lock

@jorgemoralespou
Copy link

@joaopapereira I think the issue is this:

--lock-output string Location to output the generated lockfile. Option only available when using --bundle or --lock flags

That highlighted area at the end of the --lock-output says that the option is only available when using either --bundle or --lock. The latter option does not exist.

@joaopapereira
Copy link
Member

sorry didn't read the full message my bad

@joaopapereira joaopapereira added good first issue An issue that will be a good candidate for a new contributor carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been reviewed for validity labels Mar 17, 2022
@vicmarbev
Copy link
Contributor

There is a '--lock' flag for the LockInput option: https://github.com/vmware-tanzu/carvel-imgpkg/blob/9248c77df8b6e77bc32f72dc36dc8bf048e86c06/pkg/imgpkg/cmd/lock_input_flags.go#L14-L17
It is used in the copy command here:
https://github.com/vmware-tanzu/carvel-imgpkg/blob/9248c77df8b6e77bc32f72dc36dc8bf048e86c06/pkg/imgpkg/cmd/copy.go#L78

Should it be removed from push command? I can open an PR if needed.

@joaopapereira
Copy link
Member

The problem here is that https://github.com/vmware-tanzu/carvel-imgpkg/blob/develop/pkg/imgpkg/cmd/lock_output_flags.go#L14 is used for both push and copy commands, but in push there is no --lock flag that can be used.

These are some possibilities to solve this issue:

  1. Add a new function to the struct LockOutputFlags called SetOnPush or something similar and in that function remove the text or --lock
  2. Add a parameter on the function Set that would choose what text should be presented depending on the command that is being used.

Does this make sense?

Also, feel free to send a PR our way with this.

@joaopapereira
Copy link
Member

Issue fixed in release 0.29.0

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 carvel accepted This issue should be considered for future work and that the triage process has been completed good first issue An issue that will be a good candidate for a new contributor
Projects
None yet
Development

No branches or pull requests

4 participants