Skip to content

fix(registry): use RepositoryV2 displayer for list-v2 commands#1851

Open
lohitkolluri wants to merge 2 commits into
digitalocean:mainfrom
lohitkolluri:fix/registry-list-v2-format-displayer-1797
Open

fix(registry): use RepositoryV2 displayer for list-v2 commands#1851
lohitkolluri wants to merge 2 commits into
digitalocean:mainfrom
lohitkolluri:fix/registry-list-v2-format-displayer-1797

Conversation

@lohitkolluri
Copy link
Copy Markdown

Summary

  • Register displayers.RepositoryV2 for registry repository list-v2 and registries repository list-v2 so --format and --no-header use the correct column definitions.
  • Fix the RepositoryV2 Displayable compile-time assertion.
  • Add a unit test that verifies --format Name --no-header output.

Problem

list-v2 registered the v1 Repository displayer while rendering v2 data. That caused --format help to list the wrong columns and prevented scripted output from honoring --format / --no-header as reported in #1797.

Test plan

  • go test ./commands/ -run TestRepositoryListV2 -count=1
  • doctl registry repository list-v2 --format Name --no-header returns only repository names

Fixes #1797

The list-v2 subcommands registered the v1 Repository displayer, which
advertised the wrong --format columns and broke scripted output that
relies on --format and --no-header.

Fixes digitalocean#1797
@lohitkolluri
Copy link
Copy Markdown
Author

@kishlay-singh-DO when you have a moment, could you please take a look at this? Thank You.

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.

registry repository list-v2 ignores --format and --no-header flags

1 participant