-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Issue - 10441] Improved k8s cluster discovery #5291
base: main
Are you sure you want to change the base?
Conversation
β¦Namespaces discovery instead. NewNamespacePlatformId also refactored in order to generate correct PlatformID. Some small changes to address redundancy in provider.go Signed-off-by: Aleksandr Chagochkin <[email protected]>
Thank you for your submission. We really appreciate it. Before we can accept your contribution, we ask that you sign the Mondoo Contributor License Agreement. You can sign the CLA by adding a new comment to this pull request and pasting exactly the following text. I have read the Mondoo CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
we need to hold off merging this PR. I believe this change conflicts with how we build platformids when scanning manifests. I need to take a look how to set this up such that it works for both manifests and clusters |
Signed-off-by: Ivan Milchev <[email protected]>
This PR makes sure we have more stable platform IDs for k8s assets. With the previous implementation different platform IDs were generating for all workloads depending whether the scan would discover the cluster asset or not. With this change the platform ids should always be the same: When scanning a cluster: <-- this is different from the current implementation
When scanning manifests: <-- this has not changed
|
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 can currently only think of two one cases where this might not work:
- The user has no privileges to access kube-system. Are we still able to get the uuid from the namespace list?
Did I read this correctly, that we do not discover the cluster when a namespace filter is set?
@@ -97,7 +97,7 @@ func TestManifestDiscovery(t *testing.T) { | |||
} | |||
inv, err := resources.Discover(pluginRuntime, cnquery.Features{}) | |||
require.NoError(t, err) | |||
require.Len(t, inv.Spec.Assets, 2) | |||
require.Len(t, inv.Spec.Assets, 3) |
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.
According to the comments in this PR, the manifest part didn't change. Why did this increase?
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 discover the namespaces now. Before we skipped over them which was actually a bug. We turned on namespace discovery for api scans, but not for manifests
π Overview
Addressing the issue π #10441
π― User-facing change?
β The new way of building the platform IDs relies solely on the namespaces now.
π’ n/a