Skip to content

Commit

Permalink
Implemented Antrea traceflow CRD. (antrea-io#660)
Browse files Browse the repository at this point in the history
Co-authored-by: Quan Tian <qtian@vmware.com>

Co-authored-by: Quan Tian <qtian@vmware.com>
  • Loading branch information
2 people authored and GraysonWu committed Sep 18, 2020
1 parent 68a8b73 commit 9b17693
Show file tree
Hide file tree
Showing 21 changed files with 1,185 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ spec:
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
labels:
app: antrea
name: traceflows.ops.antrea.tanzu.vmware.com
spec:
group: ops.antrea.tanzu.vmware.com
names:
kind: Traceflow
plural: traceflows
shortNames:
- tf
singular: traceflow
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
20 changes: 20 additions & 0 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ spec:
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
labels:
app: antrea
name: traceflows.ops.antrea.tanzu.vmware.com
spec:
group: ops.antrea.tanzu.vmware.com
names:
kind: Traceflow
plural: traceflows
shortNames:
- tf
singular: traceflow
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
20 changes: 20 additions & 0 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ spec:
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
labels:
app: antrea
name: traceflows.ops.antrea.tanzu.vmware.com
spec:
group: ops.antrea.tanzu.vmware.com
names:
kind: Traceflow
plural: traceflows
shortNames:
- tf
singular: traceflow
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
20 changes: 20 additions & 0 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ spec:
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
labels:
app: antrea
name: traceflows.ops.antrea.tanzu.vmware.com
spec:
group: ops.antrea.tanzu.vmware.com
names:
kind: Traceflow
plural: traceflows
shortNames:
- tf
singular: traceflow
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
18 changes: 18 additions & 0 deletions build/yamls/base/crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ spec:
kind: AntreaAgentInfo
shortNames:
- aai
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: traceflows.ops.antrea.tanzu.vmware.com
spec:
group: ops.antrea.tanzu.vmware.com
versions:
- name: v1alpha1
served: true
storage: true
scope: Cluster
names:
plural: traceflows
singular: traceflow
kind: Traceflow
shortNames:
- tf
2 changes: 2 additions & 0 deletions hack/update-codegen-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $GOPATH/bin/client-gen \
--input "system/v1beta1" \
--input "security/v1alpha1" \
--input "core/v1alpha1" \
--input "ops/v1alpha1" \
--output-package "${ANTREA_PKG}/pkg/client/clientset" \
--go-header-file hack/boilerplate/license_header.go.txt

Expand All @@ -58,6 +59,7 @@ $GOPATH/bin/deepcopy-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/security/v1alpha1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/core/v1alpha1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/ops/v1alpha1" \
-O zz_generated.deepcopy \
--go-header-file hack/boilerplate/license_header.go.txt

Expand Down
20 changes: 20 additions & 0 deletions pkg/apis/ops/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2020 Antrea Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:defaulter-gen=TypeMeta
// +groupName=ops.antrea.tanzu.vmware.com

package v1alpha1
54 changes: 54 additions & 0 deletions pkg/apis/ops/v1alpha1/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2020 Antrea Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var SchemeGroupVersion = schema.GroupVersion{
Group: "ops.antrea.tanzu.vmware.com",
Version: "v1alpha1",
}

var (
SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)

func init() {
localSchemeBuilder.Register(addKnownTypes)
}

func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(
SchemeGroupVersion,
&Traceflow{},
&TraceflowList{},
)

metav1.AddToGroupVersion(
scheme,
SchemeGroupVersion,
)
return nil
}
Loading

0 comments on commit 9b17693

Please sign in to comment.