-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(kubernetes): Reduce API surface of KubernetesKindProperties (#…
…4029) * refactor(kubernetes): Reduce API surface of KubernetesKindProperties Only the statically-defined kinds are allowed to set isDynamic to false, or hasClusterRelationship to true. In order to make this statically true, make the full constructor private and expose a factory method that doesn't allow those properties to be set for use outside the class. (Some of the usages of the constructor in tests *did* set isDynamic and hasClusterRelationship, but these were just testing the API that was available; now that these are not exposed outside the class the tests can just use the factory method.) * refactor(kubernetes): Simplify getRegisteredKinds The only time we ever use the getRegisteredKinds method in KubernetesKindRegistry, what we actually want is a list of the global kinds (so we can set up the core caching agent). We do this by getting all the kinds and filtering on the isDynamic property; it would be simpler to just return the global kinds in the first place. A kind is global if and only if it is not dynamic. * refactor(kubernetes): Remove isDynamic property from kind properties The prior commit removed the last usage of isDynamic in the KubernetesKindProperties class. Remove the member variable from the class. * refactor(kubernetes): Move defaulting logic to account registry In preparation for a fix to reduce live CRD lookups, move the defaulting of unknown kinds from the GlobalKubernetesKindRegistry to the account KubernetesKindRegistry. This doesn't change the result of calling getRegisteredKind on the account registry, but moves where the defaulting happens.
- Loading branch information
Showing
9 changed files
with
110 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.