-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add workload 'kind' param to 'show-details' event #7464
Add workload 'kind' param to 'show-details' event #7464
Conversation
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
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.
LGTM
packages/core/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts
Outdated
Show resolved
Hide resolved
packages/core/src/renderer/components/kube-detail-params/get-workload-kind-from-url.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
packages/core/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
|
||
const terminal = ["create-terminal-tab"]; | ||
|
||
export type WhiteListItem = | ||
| string | ||
| { id: string; getParams: (...args: unknown[]) => AppEvent["params"] }; | ||
| { id: string; getParams: (...args: any[]) => AppEvent["params"] }; |
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.
technically unknown[]
is more correct since the id
could be wrong. But that is probably of low concern here. There are other improvements we could make in other places in the future.
return { | ||
kind: parseKubeApi(selfLink as string).resource, | ||
kind: selfLink ? parseKubeApi(selfLink).resource : "", |
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.
nit: What happens if selfLink
exists but would be just incorrect? e.g. parseKubeApi("/404-error")
?
I think parseKubeApi(selfLink)?.resource ?? ""
would be more safe in this case, but probably not critical.
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.
In this case parseKubeApi
throws an error and event fires with error
field.
Note: showing details for Helm Charts and Releases are not affected. Sending custom events are necessary here.