Skip to content

Commit

Permalink
Clean up deprecated APIServices (#6002)
Browse files Browse the repository at this point in the history
These APIServices were removed in Antrea v1.6 and it's safe to assume
none of them still exists in the cluster when deploying the upcoming
Antrea v2.0.

Signed-off-by: Quan Tian <qtian@vmware.com>
  • Loading branch information
tnqn committed Feb 21, 2024
1 parent eaf8e26 commit 9be4ec2
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 79 deletions.
12 changes: 0 additions & 12 deletions build/charts/antrea/templates/controller/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,6 @@ rules:
verbs:
- list
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
12 changes: 0 additions & 12 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6556,18 +6556,6 @@ rules:
verbs:
- list
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
12 changes: 0 additions & 12 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6556,18 +6556,6 @@ rules:
verbs:
- list
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
12 changes: 0 additions & 12 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6556,18 +6556,6 @@ rules:
verbs:
- list
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
12 changes: 0 additions & 12 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6569,18 +6569,6 @@ rules:
verbs:
- list
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
12 changes: 0 additions & 12 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6556,18 +6556,6 @@ rules:
verbs:
- list
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
8 changes: 1 addition & 7 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,7 @@ func CleanupDeprecatedAPIServices(aggregatorClient clientset.Interface) error {
// deprecates a registered APIService, the APIService should be deleted,
// otherwise K8s will fail to delete an existing Namespace.
// Also check: https://github.com/antrea-io/antrea/issues/494
deprecatedAPIServices := []string{
"v1beta1.networking.antrea.tanzu.vmware.com",
"v1beta1.controlplane.antrea.tanzu.vmware.com",
"v1alpha1.stats.antrea.tanzu.vmware.com",
"v1beta1.system.antrea.tanzu.vmware.com",
"v1beta2.controlplane.antrea.tanzu.vmware.com",
}
deprecatedAPIServices := []string{}
for _, as := range deprecatedAPIServices {
err := aggregatorClient.ApiregistrationV1().APIServices().Delete(context.TODO(), as, metav1.DeleteOptions{})
if err == nil {
Expand Down

0 comments on commit 9be4ec2

Please sign in to comment.