-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: provide more details to KubernetesClientException #3492
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
Conversation
Can one of the admins verify this patch? |
If the exception occurred from an HTTP request, use that information to populate information about the target resource. Fixes #3491
011f9cc
to
97be902
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.
it makes sense
...client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatcherWebSocketListener.java
Outdated
Show resolved
Hide resolved
Note that this relies on fabric8io/kubernetes-client#3492 so won't build until this PR is merged and available in a release. Fixes #552
SonarCloud Quality Gate failed. |
static RequestMetadata from(Request request) { | ||
final List<String> segments = request.url().pathSegments(); | ||
switch (segments.size()) { | ||
case 4: | ||
// cluster URL | ||
return new RequestMetadata(segments.get(1), segments.get(2), segments.get(3), null); | ||
case 6: | ||
// namespaced URL | ||
return new RequestMetadata(segments.get(1), segments.get(2), segments.get(5), segments.get(4)); | ||
default: | ||
return EMPTY; | ||
} | ||
} |
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.
Are you sure this switch handles all the use-cases?
e.g. subresources, cluster-scoped resources targeting a namesoace, non-standard resources (metrics server, pod exec...), etc.?
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.
I'll merge this PR because this is apparently harmless as it's provided as a new feature.
If the exception occurred from an HTTP request, use that information
to populate information about the target resource.
Fixes #3491
Type of change
test, version modification, documentation, etc.)
Checklist