-
Notifications
You must be signed in to change notification settings - Fork 45
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
Enhancement: Using Discovery API to discover Kubernetes Resources #284
Enhancement: Using Discovery API to discover Kubernetes Resources #284
Conversation
Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
…rui/default_resources Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #284 +/- ##
==========================================
+ Coverage 9.37% 11.95% +2.58%
==========================================
Files 10 11 +1
Lines 651 669 +18
==========================================
+ Hits 61 80 +19
+ Misses 583 582 -1
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This might be an ideal time for a set of standard tests to be run. What sort of CI coverage do we have currently? Only compilation of golang, but no functional or integration tests, right? Time to invest in one, I suggest. We already have a number of them that can be reused from meshery/meshery.... |
Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
There are many of them, I shall have fun reusing some of them here |
@VihasMakwana, your 👀s on this would be great. |
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 overall. a couple of nits.
Great step towards the discovery!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
merge conflicts, @KiptoonKipkurui |
Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
Signed-off-by: Daniel Kiptoon <[email protected]>
@leecalcote @VihasMakwana @MUzairS15 I have resolved all conflicts and reviews |
@@ -134,5 +40,66 @@ var ( | |||
}, | |||
} | |||
|
|||
DefaultEvents = []string{"ADD", "UPDATE", "DELETE"} | |||
DefaultEvents = []string{"ADD", "UPDATE", "DELETE"} | |||
ExemptedResources = []string{"selfsubjectrulesreviews", "localsubjectaccessreviews", "bindings", "selfsubjectaccessreviews", "subjectaccessreviews", "tokenreviews", "componentstatuses", "flowschemas", "prioritylevelconfigurations"} |
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.
A perfect example of the use of deny
selector in the CR config.
|
||
for _, group := range groupList { | ||
for _, resource := range group.APIResources { | ||
if strings.Contains(resource.Name, "/") { |
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.
What is this for?
Does this mean resources under apps/v1
, networking.k8s.io/v1
... not to be watched for changes inside the cluster?
t.Error("local resources not discovered, expected 1") | ||
} | ||
|
||
idx := slices.IndexFunc(Pipelines["global"], func(c PipelineConfig) bool { return c.Name == "namespaces.v1." }) |
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.
Is there any specific reason for treating namespace special? Is it just because all other namespaced resources are in the local config and non-namespaced resources are in the global config?
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 see it's the test file, but even then adding a comment will help.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue. |
Description
To discover all resources in a cluster, this PR uses the Discovery API to list all resources and avoid hardcoding the resources to track and also supports using both whitelist and blacklisted resources in watch-list ConfigMap
This PR fixes #274
Notes for Reviewers
Signed commits