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

fix(load-balancer): show message if none of --server, --label-selector or --ip is set #849

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

phm07
Copy link
Contributor

@phm07 phm07 commented Aug 22, 2024

Previously, if none of these flags were provided, only the error --server, --label-selector, and --ip are mutually exclusive would show, which is not wrong but doesn't include that exactly one is required.

We could also use cmd.MarkFlagsOneRequired() and cmd.MarkFlagsMutuallyExclusive() but the errors are not very pretty.

@phm07 phm07 requested a review from a team as a code owner August 22, 2024 15:18
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 61.47%. Comparing base (f7c9ac6) to head (9317d50).
Report is 4 commits behind head on main.

Files Patch % Lines
internal/cmd/loadbalancer/add_target.go 0.00% 1 Missing and 1 partial ⚠️
internal/cmd/loadbalancer/remove_target.go 0.00% 1 Missing and 1 partial ⚠️
internal/cmd/util/util.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #849      +/-   ##
==========================================
+ Coverage   61.43%   61.47%   +0.04%     
==========================================
  Files         237      237              
  Lines        8494     8489       -5     
==========================================
+ Hits         5218     5219       +1     
+ Misses       2567     2566       -1     
+ Partials      709      704       -5     

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

internal/cmd/util/util.go Outdated Show resolved Hide resolved
@phm07 phm07 merged commit 2df45e0 into main Aug 26, 2024
5 checks passed
@phm07 phm07 deleted the check-any-set branch August 26, 2024 14:22
phm07 pushed a commit that referenced this pull request Aug 30, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.47.0](v1.46.0...v1.47.0)
(2024-08-30)


### Features

* allow deleting rDNS entries
([#839](#839))
([129f51d](129f51d)),
closes [#814](#814)
* **certificate:** allow retrying managed certificate issuance
([#847](#847))
([0223f7d](0223f7d))
* improve datacenter describe server types readability
([#854](#854))
([fc0002c](fc0002c)),
closes [#852](#852)


### Bug Fixes

* `quiet` option sometimes only working as a flag
([#846](#846))
([f7c9ac6](f7c9ac6))
* **image:** only accept numerical ids for update, delete, label
([#844](#844))
([7355571](7355571))
* **load-balancer:** show message if none of --server, --label-selector
or --ip is set ([#849](#849))
([2df45e0](2df45e0))
* **primary-ip:** change protection commands do not allow protection
levels ([#851](#851))
([697a87a](697a87a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants