-
Notifications
You must be signed in to change notification settings - Fork 150
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
Refactor /inventory code to expose some helpers #4090
Conversation
86a9aaa
to
6f356db
Compare
dbea5b3
to
dae5fc6
Compare
core/server/inventory.go
Outdated
result = append(result, entry) | ||
resultMu.Unlock() | ||
}(*o) | ||
// FIXME: do we need this? |
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.
When you are getting them from Kubernetes, they should have their namespace (even if it's corev1.NamespaceDefault
).
core/server/inventory.go
Outdated
if unstructuredObj.GetKind() == "Secret" { | ||
unstructuredObj, err = sanitizeUnstructuredSecret(unstructuredObj) | ||
var err error | ||
unstructuredObj, err = SanitizeUnstructuredSecret(unstructuredObj) |
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.
SanitizeUnstructuredSecret
isn't used outside of the server
package?
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.
no, i'll make it private
1c2e26e
to
4199b60
Compare
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!
- That can be used by other similar inventory endpoints
Fix tests
Co-authored-by: Kevin McDermott <kevin@weave.works>
…et in inventory and tests
97584fa
to
71167b3
Compare
weaveworks/weave-gitops-enterprise#2776
What changed?
Why was this change made?
Other similar CRDs that match the flux inventory pattern can share similar code like this
How was this change implemented?
How did you validate the change?
unit tests
Release notes
Expose some inventory directory helper functions
Documentation Changes