Skip to content

Migrate Urfave CLI from v1 to v2#9809

Merged
estesp merged 1 commit intocontainerd:mainfrom
dereknola:urfave_v2
Feb 16, 2024
Merged

Migrate Urfave CLI from v1 to v2#9809
estesp merged 1 commit intocontainerd:mainfrom
dereknola:urfave_v2

Conversation

@dereknola
Copy link
Copy Markdown
Contributor

@dereknola dereknola commented Feb 12, 2024

Changes

Vendoring/go mod updates is in a separate commit for PR review clarity

Followed the Migration Guide at https://cli.urfave.org/migrate-v1-to-v2/
Some points from this guide:

  • Aliases are now in a separate field, not integrated into the name
  • EnvVar is now EnvVars, a []string
  • All Flags and Commands are now initialized as Pointers

The major changes not pointed out in the migration guide are:

  • context.Args() no longer produces a []slice, so context.Args().Slice()
    in substituted
  • All cli.Global***** are deprecated (the migration guide is somewhat unclear on this)

Verification:

All binaries build using make.

Linked Issue

#9808

@k8s-ci-robot
Copy link
Copy Markdown

Hi @dereknola. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dereknola dereknola force-pushed the urfave_v2 branch 2 times, most recently from 183a54f to 745644a Compare February 12, 2024 20:22
@AkihiroSuda
Copy link
Copy Markdown
Member

Please squash commits

@dereknola
Copy link
Copy Markdown
Contributor Author

Squashed all commits

@AkihiroSuda
Copy link
Copy Markdown
Member

/ok-to-test

Comment thread cmd/ctr/commands/images/push.go Outdated
Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

One small concern on a string slice, otherwise looks good

@dereknola
Copy link
Copy Markdown
Contributor Author

Do I need to squash again?

@akhilerm
Copy link
Copy Markdown
Member

Do I need to squash again?

Yes. So that the changes are available as a single commit.

@dmcgowan dmcgowan added this to the 2.0 milestone Feb 14, 2024
@dereknola
Copy link
Copy Markdown
Contributor Author

/retest

Followed the Migration Guide at https://cli.urfave.org/migrate-v1-to-v2/
The major changes not pointed out in the migration guide are:
- context.Args() no longer produces a []slice, so context.Args().Slice()
  in substitued
- All cli.Global***** are deprecated (the migration guide is somewhat
  unclear on this)

Signed-off-by: Derek Nola <[email protected]>

Vendor in urfave cli/v2

Signed-off-by: Derek Nola <[email protected]>

Fix NewStringSlice calls

Signed-off-by: Derek Nola <[email protected]>
@mxpv mxpv enabled auto-merge February 15, 2024 20:31
@estesp estesp dismissed dmcgowan’s stale review February 16, 2024 16:12

slice issue was resolved in last push

@estesp estesp disabled auto-merge February 16, 2024 16:13
@estesp estesp enabled auto-merge February 16, 2024 16:13
@estesp estesp added this pull request to the merge queue Feb 16, 2024
Merged via the queue into containerd:main with commit 1641c75 Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants