chore(kubernetes): Update API group of NetworkPolicy and PodSecurityPolicy #4058
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.
refactor(kubernetes): Remove getters from KubernetesKind
Once a KubernetesKind has been created, external classes should
(and do) only care about its string representation, not the individual fields. Remove the unused getters from the name and apiGroup fields (and update one test that was relying on them).
chore(kubernetes): Update API group of NetworkPolicy and PodSecurityPolicy
The NetworkPolicy and PodSecurityPolicy kinds have been moved from extensions/v1beta1 to networking.k8s.io/v1 and policy/v1beta1 respectively. Update the API group for these kinds in KubernetesKind.
Given how the V2 provider queries kinds, this change actually has no functional effect as kinds from built-in API groups are serialized as the kind name alone (wihtout api group) leaving kubectl to resolve the API group. As a result this will neither break users on old versions of Kubernetes nor would failing to make this change have broken users of 1.16 when API stops serving from the old endpoints. That being said, it makes sense to keep these API groups up to date, both for documentation reasons and in the event that in the future we begin using them.