-
Notifications
You must be signed in to change notification settings - Fork 12
Update component usage and add action pattern #85
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sam Foo <[email protected]>
Signed-off-by: Sam Foo <[email protected]>
Signed-off-by: Sam Foo <[email protected]>
Signed-off-by: Sam Foo <[email protected]>
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.
👋 @GuessWhoSamFoo This PR is amazing! Thank you for all work that you've done.
I tested in my env and everything seems to be fine. However, I do have a couple of questions before we'll merge the code.
|
||
func startKubeHunterScan(ctx context.Context) error { | ||
configFlags := genericclioptions.NewConfigFlags(true) | ||
restconfig, err := configFlags.ToRESTConfig() |
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 guess this in general may be a different client config than the one used by octant process. Is that correct?
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.
Yes, this is a good point and leaves more to be desired in the plugin interface.
A workaround is to see if $KUBECONFIG
is set and see if it matches the one from config flags since we can assume Octant looks at the same spot by default via clientcmd.NewDefaultClientConfigLoadingRules().GetDefaultFilename()
.
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.
Thanks for clarification. I think it's a good start and it should work in most cases. We can also leave a TODO comment explaining when this approach may not work.
return plugin.TabResponse{}, errors.New("object is nil") | ||
} | ||
|
||
workload, err := getWorkloadFromObject(request.Object) |
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.
We generate ConfigAuditReports for a subset of K8s resources (GVKs). For example, we'll never generate it for Nodes because for Nodes we generate CISKubeBenchReports.
That said, I was wondering if we can skip printing a Tab for certain GVKs?
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.
Checking if the object type is a node and returning an empty tab response is one way, but I don't like having that error message.
Going to patch upstream to skip empty tab responses without errors.
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.
An empty tab response sounds good. We can improve error handling by upgrading Octant whenever a new version is available.
Let me know if the proposed fixes are acceptable and I can make another patch. Otherwise we can break up this PR into items that are considered merge-able while fixing upstream octant |
@GuessWhoSamFoo Let's wrap up this PR according to your suggestions and merge it. Once you fix upstream Octant we can update this plugin to take advantage of such enhancements. |
Sam Foo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Signed-off-by: Sam Foo <[email protected]>
This PR introduces the following changes:
A proof of concept for using buttons to trigger an action. This is done by creating a wrapper around the respective starboard command.

Refactoring old markdown components to directly use links and icons
Increase visibility to vulnerabilities by changing icon status color (in this case, only critical) and at-a-glance view from a signpost

Show how to create multiple tabs from a single plugin.