-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ws-manager-bridge] fix error handling for register & update, show all admission-constraints for list #8330
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8330 +/- ##
===========================================
- Coverage 31.23% 11.17% -20.06%
===========================================
Files 39 18 -21
Lines 5910 993 -4917
===========================================
- Hits 1846 111 -1735
+ Misses 3923 880 -3043
+ Partials 141 2 -139
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
d9eb681
to
03b29fb
Compare
if (!!clusterByName) { | ||
throw new GRPCError(grpc.status.ALREADY_EXISTS, `a WorkspaceCluster with name ${req.name} already exists in the DB`); | ||
} | ||
if (Array.isArray(clusterByUrl) && clusterByUrl.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm. what if findFiltered
will change in the future and will return something other than array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, since it's TypeScript this is overkill, null check and length check should be good. Thanks!
…stration and update Prevent duplicate workspace cluster registration & improve error message for update when workspace cluster doesn't exist
03b29fb
to
5031e01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for finding and fixing this @kylos101 🙏
Description
The following changes are necessary to improve the experience for managing workspace clusters when using
gpctl
.list
was not showing certain admission constraints, likehas-more-resources
. As an administrator, we want to see all admission constraints, so we can understand how access is controlled to workspace clusters.register
duplicate workspace cluster names. As an administrator, we want to prevent overwriting existing configured clusters and prevent unwanted behavior, so we can maximize system up-time and have predictability.update
when a workspace cluster name does not exist was incorrect. As an administrator, we want to clearly see what is wrong when updating, so we can effectively manage configuration.Related Issue(s)
These issues were found while building and and testing faster clusters for #8054.
How to test
The error message when a name does not exist on
update
:update
still works:The output for
list
when a workspace cluster includeshas-more-resources
admission constraint:The error when you try to
register
a workspace cluster with a name that already exists:Register still works:
Release Notes
Documentation