Skip to content

chore(base): Add OmitLabelsFlag to ListCmd - #1547

Open
wneessen wants to merge 3 commits into
mainfrom
omit-labels-flag
Open

wneessen wants to merge 3 commits into
mainfrom
omit-labels-flag

Conversation

@wneessen

@wneessen wneessen commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
  • Adds the OmitLabelsFlag field to the ListCmd struct to allow omitting the labels flag for commands that do not support it.

- Adds the `OmitLebelsFlag` field to the `ListCmd` struct to allow
  omitting the labels flag for commands that do not support it.
@wneessen
wneessen requested a review from a team as a code owner November 17, 2026 15:05
@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.61%. Comparing base (5cb485e) to head (92b0c13).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1547   +/-   ##
=======================================
  Coverage   79.60%   79.61%           
=======================================
  Files         305      305           
  Lines        9794     9795    +1     
=======================================
+ Hits         7797     7798    +1     
  Misses       1997     1997           
Flag Coverage Δ
e2e 55.15% <100.00%> (+<0.01%) ⬆️
unit 74.22% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jooola

jooola commented Nov 17, 2026

Copy link
Copy Markdown
Member

Could we already configure the hetzner managed API resource to not use the label selector?

  • datacenter
  • iso
  • location
  • server-type
  • load-balancer-type
  • storage-box-type

Comment thread internal/cmd/base/list.go
Comment on lines +65 to 68
// Can be set to indicate that the [ListCmd] for a resource does not support labels.
// As result the corresponding flag will not be printed in the help text or documentation.
OmitLabelsFlag bool
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the --sort, we explicitly set the sort option, or nil of not supported.

This feels like we take the other approach, labels are present by default, implicit.

Maybe we could turn this around, and explicitly enable labels LabelsFlag ?

What do you think?

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.

2 participants