From e86c27bc2c391418fbc2df032851fedcdfceabf0 Mon Sep 17 00:00:00 2001 From: runzexia Date: Thu, 19 Mar 2020 15:14:01 +0800 Subject: [PATCH] gen devops crd yaml Signed-off-by: runzexia --- .../devops.kubesphere.io_devopsprojects.yaml | 51 ++++++++++++++++++ ... => devops.kubesphere.io_s2ibinaries.yaml} | 21 ++++++-- .../devops.kubesphere.io_s2ibuilders.yaml | 2 +- ...ops.kubesphere.io_s2ibuildertemplates.yaml | 2 +- config/crds/devops.kubesphere.io_s2iruns.yaml | 2 +- config/rbac/role.yaml | 54 +++++++++++++++++++ .../v1alpha3/devopsproject_types_test.go | 6 +-- 7 files changed, 127 insertions(+), 11 deletions(-) create mode 100644 config/crds/devops.kubesphere.io_devopsprojects.yaml rename config/crds/{devops_v1alpha1_s2ibinary.yaml => devops.kubesphere.io_s2ibinaries.yaml} (75%) create mode 100644 config/rbac/role.yaml diff --git a/config/crds/devops.kubesphere.io_devopsprojects.yaml b/config/crds/devops.kubesphere.io_devopsprojects.yaml new file mode 100644 index 000000000..9791da639 --- /dev/null +++ b/config/crds/devops.kubesphere.io_devopsprojects.yaml @@ -0,0 +1,51 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) + creationTimestamp: null + name: devopsprojects.devops.kubesphere.io +spec: + group: devops.kubesphere.io + names: + kind: DevOpsProject + listKind: DevOpsProjectList + plural: devopsprojects + singular: devopsproject + scope: Namespaced + validation: + openAPIV3Schema: + description: DevOpsProject is the Schema for the devopsprojects API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DevOpsProjectSpec defines the desired state of DevOpsProject + type: object + status: + description: DevOpsProjectStatus defines the observed state of DevOpsProject + type: object + type: object + version: v1alpha3 + versions: + - name: v1alpha3 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/config/crds/devops_v1alpha1_s2ibinary.yaml b/config/crds/devops.kubesphere.io_s2ibinaries.yaml similarity index 75% rename from config/crds/devops_v1alpha1_s2ibinary.yaml rename to config/crds/devops.kubesphere.io_s2ibinaries.yaml index 332fa56ff..1c0dba8b4 100644 --- a/config/crds/devops_v1alpha1_s2ibinary.yaml +++ b/config/crds/devops.kubesphere.io_s2ibinaries.yaml @@ -1,9 +1,11 @@ + +--- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" name: s2ibinaries.devops.kubesphere.io spec: additionalPrinterColumns: @@ -22,24 +24,29 @@ spec: group: devops.kubesphere.io names: kind: S2iBinary + listKind: S2iBinaryList plural: s2ibinaries + singular: s2ibinary scope: Namespaced + subresources: {} validation: openAPIV3Schema: + description: S2iBinary is the Schema for the s2ibinaries API properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: + description: S2iBinarySpec defines the desired state of S2iBinary properties: downloadURL: description: DownloadURL in KubeSphere @@ -59,12 +66,18 @@ spec: type: string type: object status: + description: S2iBinaryStatus defines the observed state of S2iBinary properties: phase: description: Phase is status of S2iBinary . Possible value is "Ready","UnableToDownload" type: string type: object + type: object version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true status: acceptedNames: kind: "" diff --git a/config/crds/devops.kubesphere.io_s2ibuilders.yaml b/config/crds/devops.kubesphere.io_s2ibuilders.yaml index 54df7a1cb..cdd428f65 100644 --- a/config/crds/devops.kubesphere.io_s2ibuilders.yaml +++ b/config/crds/devops.kubesphere.io_s2ibuilders.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: (devel) + controller-gen.kubebuilder.io/version: (unknown) creationTimestamp: null name: s2ibuilders.devops.kubesphere.io spec: diff --git a/config/crds/devops.kubesphere.io_s2ibuildertemplates.yaml b/config/crds/devops.kubesphere.io_s2ibuildertemplates.yaml index 50f0a4fed..69d210892 100644 --- a/config/crds/devops.kubesphere.io_s2ibuildertemplates.yaml +++ b/config/crds/devops.kubesphere.io_s2ibuildertemplates.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: (devel) + controller-gen.kubebuilder.io/version: (unknown) creationTimestamp: null name: s2ibuildertemplates.devops.kubesphere.io spec: diff --git a/config/crds/devops.kubesphere.io_s2iruns.yaml b/config/crds/devops.kubesphere.io_s2iruns.yaml index 492908cd6..af43f1f1e 100644 --- a/config/crds/devops.kubesphere.io_s2iruns.yaml +++ b/config/crds/devops.kubesphere.io_s2iruns.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: (devel) + controller-gen.kubebuilder.io/version: (unknown) creationTimestamp: null name: s2iruns.devops.kubesphere.io spec: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml new file mode 100644 index 000000000..f3d4ba63a --- /dev/null +++ b/config/rbac/role.yaml @@ -0,0 +1,54 @@ + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: manager-role +rules: +- apiGroups: + - crd.projectcalico.org + resources: + - clusterinformations + - felixconfigurations + - globalfelixconfigs + - globalnetworkpolicies + - globalnetworksets + - hostendpoints + - ipamblocks + - ippools + - networkpolicies + - networksets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - network.kubesphere.io + resources: + - namespacenetworkpolicies + - workspacenetworkpolicies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - tenant.kubesphere.io + resources: + - workspaces + verbs: + - create + - delete + - get + - list + - patch + - update + - watch diff --git a/pkg/apis/devops/v1alpha3/devopsproject_types_test.go b/pkg/apis/devops/v1alpha3/devopsproject_types_test.go index 325b380be..d8a20e81b 100644 --- a/pkg/apis/devops/v1alpha3/devopsproject_types_test.go +++ b/pkg/apis/devops/v1alpha3/devopsproject_types_test.go @@ -27,13 +27,11 @@ import ( func TestStorageDevOpsProject(t *testing.T) { key := types.NamespacedName{ - Name: "foo", - Namespace: "default", + Name: "foo", } created := &DevOpsProject{ ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Namespace: "default", + Name: "foo", }} g := gomega.NewGomegaWithT(t)