Skip to content

Commit

Permalink
Rename API group "networking" to "controlplane" (antrea-io#1147)
Browse files Browse the repository at this point in the history
* Rename API group "networking" to "controlplane"

* Delete the registered APIService for "networking" API group
  • Loading branch information
jianjuns authored and antoninbas committed Sep 3, 2020
1 parent e3461e1 commit 13d82d8
Show file tree
Hide file tree
Showing 100 changed files with 1,594 additions and 1,513 deletions.
18 changes: 13 additions & 5 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -453,7 +453,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -584,12 +584,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -923,9 +931,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -453,7 +453,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -584,12 +584,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -923,9 +931,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -453,7 +453,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -584,12 +584,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -923,9 +931,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -453,7 +453,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -584,12 +584,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -932,9 +940,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -453,7 +453,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -584,12 +584,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -923,9 +931,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
2 changes: 1 addition & 1 deletion build/yamls/base/agent-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down
2 changes: 1 addition & 1 deletion build/yamls/base/antctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down
12 changes: 11 additions & 1 deletion build/yamls/base/controller-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,20 @@ rules:
- apiservices
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
# Add the APIServices for the deprecated APIGroups here. antrea-controller
# will try to delete the APIServices if they are registered.
- v1beta1.networking.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down
4 changes: 2 additions & 2 deletions build/yamls/base/controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ metadata:
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
version: v1beta1
versionPriority: 100
Expand Down
2 changes: 1 addition & 1 deletion cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"github.com/vmware-tanzu/antrea/pkg/agent/proxy"
"github.com/vmware-tanzu/antrea/pkg/agent/querier"
"github.com/vmware-tanzu/antrea/pkg/agent/route"
"github.com/vmware-tanzu/antrea/pkg/apis/networking/v1beta1"
"github.com/vmware-tanzu/antrea/pkg/apis/controlplane/v1beta1"
crdinformers "github.com/vmware-tanzu/antrea/pkg/client/informers/externalversions"
"github.com/vmware-tanzu/antrea/pkg/features"
"github.com/vmware-tanzu/antrea/pkg/k8s"
Expand Down
5 changes: 5 additions & 0 deletions cmd/antrea-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ func run(o *Options) error {
return fmt.Errorf("error creating API server: %v", err)
}

err = apiserver.CleanupDeprecatedAPIServices(aggregatorClient)
if err != nil {
return fmt.Errorf("failed to clean up the deprecated APIServices: %v", err)
}

// Set up signal capture: the first SIGTERM / SIGINT signal is handled gracefully and will
// cause the stopCh channel to be closed; if another signal is received before the program
// exits, we will force exit.
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ the Kubernetes API and handles authentication.
# Start the proxy in the background
kubectl proxy &
# Access the antrea-controller API path
curl 127.0.0.1:8001/apis/networking.antrea.tanzu.vmware.com
curl 127.0.0.1:8001/apis/controlplane.antrea.tanzu.vmware.com
```

### Directly accessing the antrea-controller API
Expand Down
12 changes: 6 additions & 6 deletions hack/update-codegen-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $GOPATH/bin/client-gen \
--clientset-name versioned \
--input-base "${ANTREA_PKG}/pkg/apis/" \
--input "clusterinformation/v1beta1" \
--input "networking/v1beta1" \
--input "controlplane/v1beta1" \
--input "system/v1beta1" \
--input "security/v1alpha1" \
--input "core/v1alpha1" \
Expand All @@ -56,8 +56,8 @@ $GOPATH/bin/informer-gen \

$GOPATH/bin/deepcopy-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/clusterinformation/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking" \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/security/v1alpha1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/core/v1alpha1" \
Expand All @@ -66,12 +66,12 @@ $GOPATH/bin/deepcopy-gen \
--go-header-file hack/boilerplate/license_header.go.txt

$GOPATH/bin/conversion-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking/v1beta1,${ANTREA_PKG}/pkg/apis/networking/" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1,${ANTREA_PKG}/pkg/apis/controlplane/" \
-O zz_generated.conversion \
--go-header-file hack/boilerplate/license_header.go.txt

$GOPATH/bin/openapi-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/clusterinformation/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \
--input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr" \
Expand Down Expand Up @@ -117,7 +117,7 @@ git checkout HEAD -- hack/boilerplate/license_header.raw.txt
go mod vendor
$GOPATH/bin/go-to-protobuf \
--proto-import vendor \
--packages "${ANTREA_PKG}/pkg/apis/networking/v1beta1" \
--packages "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1" \
--go-header-file hack/boilerplate/license_header.go.txt
# Clean up vendor directory.
rm -rf vendor
Expand Down
Loading

0 comments on commit 13d82d8

Please sign in to comment.