-
Notifications
You must be signed in to change notification settings - Fork 702
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
Remove watchResource and associated code. #3897
Conversation
Signed-off-by: Michael Nelson <minelson@vmware.com>
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.
Great! Happy to be removing plenty of complex code in the UI (and tests....). Thanks for the clean-up!
return refs | ||
.map(r => resources[keyForResourceRef(r.apiVersion, r.kind, r.namespace, r.name)]) | ||
.filter(r => r !== undefined); | ||
return refs.map(r => resources[keyForResourceRef(r)]).filter(r => r !== undefined); |
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 don't know about our preference of using lodash
vs plain js, but I guess you can also do sth like _.omitBy
. Anyway, it is clear enough and easy to understand, so that's totally fine with me.
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.
Yeah, this was the existing code that needed to handle undefined resources in the state. I'm not sure how the state could previously get into this situation, but I'm pretty confident that it cannot do so now anyway (as we only add resources to the state in the first place if they are sent by the resources plugin), but lots of test data currently depends on it. I may remove it in another PR and update the tests.
dashboard/src/reducers/kube.ts
Outdated
// We book keep on subscriptions, keyed by the installed package ref, | ||
// so that we can |
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.
Maybe this comment is stripped out? I think I don't get the sentence
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.
Sorry - probably got distracted half way through writing it :P. Fixed.
Signed-off-by: Michael Nelson <minelson@vmware.com>
Description of the change
Following on from the other #3779 PRs, this PR removes more now-unused code (after switching to the new resources plugin endpoint) and simplifies the
keyForResourceRef
helper now that it is used solely with our protobuf-generated resourceref.Benefits
Possible drawbacks
Applicable issues
Additional information