shortcut expander: use discovery helper's cached resource list #1457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Steve Kriss krisss@vmware.com
Fixes #1413
Fixes #1435
Fixes #1414
Change the shortcut expander (which expands things like "po" to pods) to use the discovery helper's cached list of API resources, so it doesn't have to call the discovery client every time there's an expansion to do.
Still doing a little bit of testing, but initial basic tests look good functionally, and make a major performance impact (a sample restore dropped from 45sec to 2sec, a full-cluster backup dropped from 2+ minutes to 11 seconds).
We should revisit the discovery code a little bit post-1.0 as there have been some upstream changes, but happy with this change for now since it's simple and has a big impact.