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

Add workload 'kind' param to 'show-details' event #7464

Merged
merged 4 commits into from
Apr 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ const externalActions = ["open-link-in-browser"];

const uiInteraction = [{
id: "show-details",
getParams: (selfLink: unknown) => {
getParams: (selfLink: string) => {
return {
kind: parseKubeApi(selfLink as string).resource,
kind: selfLink ? parseKubeApi(selfLink).resource : "",
Copy link
Contributor

@ixrock ixrock Apr 3, 2023

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.

Copy link
Contributor Author

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.

};
},
}];
Expand All @@ -105,7 +105,7 @@ const terminal = ["create-terminal-tab"];

export type WhiteListItem =
| string
| { id: string; getParams: (...args: unknown[]) => AppEvent["params"] };
| { id: string; getParams: (...args: any[]) => AppEvent["params"] };
Copy link
Collaborator

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.


const telemetryWhiteListForFunctionsInjectable = getInjectable({
id: "telemetry-white-list-for-functions",
Expand Down