From 4d16e618c425cfd039575abe2dc8872b8937e889 Mon Sep 17 00:00:00 2001 From: Shoubhik Bose Date: Thu, 14 Feb 2019 17:24:38 -0500 Subject: [PATCH 1/5] get the code to build --- README.md | 4 ++-- build/Dockerfile | 2 +- cmd/manager/main.go | 6 +++--- .../devconsole_v1alpha1_envdeployment_crd.yaml | 4 ++-- .../crds/devconsole_v1alpha1_environment_crd.yaml | 4 ++-- deploy/operator.yaml | 14 +++++++------- deploy/role.yaml | 4 ++-- deploy/role_binding.yaml | 6 +++--- deploy/service_account.yaml | 2 +- examples/local_envdeployment_cr.yaml | 4 ++-- examples/local_environment_cr.yaml | 2 +- examples/remote_envdeployment_cr.yaml | 4 ++-- examples/remote_environment_cr.yaml | 2 +- pkg/apis/addtoscheme_clusterregistry_v1alpha1.go | 2 +- pkg/apis/addtoscheme_devconsole_v1alpha1.go | 2 +- pkg/apis/devconsole/v1alpha1/doc.go | 4 ---- pkg/apis/devopsconsole-operator/v1alpha1/doc.go | 4 ++++ .../v1alpha1/envdeployment_types.go | 0 .../v1alpha1/environment_types.go | 0 .../v1alpha1/register.go | 6 +++--- .../v1alpha1/zz_generated.deepcopy.go | 0 pkg/controller/add_envdeployment.go | 2 +- .../envdeployment/envdeployment_controller.go | 10 +++++----- 23 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 pkg/apis/devconsole/v1alpha1/doc.go create mode 100644 pkg/apis/devopsconsole-operator/v1alpha1/doc.go rename pkg/apis/{devconsole => devopsconsole-operator}/v1alpha1/envdeployment_types.go (100%) rename pkg/apis/{devconsole => devopsconsole-operator}/v1alpha1/environment_types.go (100%) rename pkg/apis/{devconsole => devopsconsole-operator}/v1alpha1/register.go (62%) rename pkg/apis/{devconsole => devopsconsole-operator}/v1alpha1/zz_generated.deepcopy.go (100%) diff --git a/README.md b/README.md index b633d74..eae076c 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ $ make install Add a new API for the custom resource AppService ```sh -$ operator-sdk add api --api-version=devconsole.openshift.io/v1alpha1 --kind=AppService +$ operator-sdk add api --api-version=devopsconsole-operator.openshift.io/v1alpha1 --kind=AppService ``` Add a new controller that watches for AppService ```sh -$ operator-sdk add controller --api-version=devconsole.openshift.io/v1alpha1 --kind=AppService +$ operator-sdk add controller --api-version=devopsconsole-operator.openshift.io/v1alpha1 --kind=AppService ``` Apply the app-operator CRD. diff --git a/build/Dockerfile b/build/Dockerfile index 89103b5..d52ec9e 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -4,4 +4,4 @@ RUN apk upgrade --update --no-cache USER nobody -ADD build/_output/bin/devconsole /usr/local/bin/devconsole +ADD build/_output/bin/devopsconsole-operator /usr/local/bin/devopsconsole-operator diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 2321690..0ddb594 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -7,12 +7,12 @@ import ( "os" "runtime" - "github.com/alexeykazakov/devconsole/pkg/apis" - "github.com/alexeykazakov/devconsole/pkg/controller" "github.com/operator-framework/operator-sdk/pkg/k8sutil" "github.com/operator-framework/operator-sdk/pkg/leader" "github.com/operator-framework/operator-sdk/pkg/ready" sdkVersion "github.com/operator-framework/operator-sdk/version" + "github.com/redhat-developer/devopsconsole-operator/pkg/apis" + "github.com/redhat-developer/devopsconsole-operator/pkg/controller" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -53,7 +53,7 @@ func main() { } // Become the leader before proceeding - leader.Become(context.TODO(), "devconsole-lock") + leader.Become(context.TODO(), "devopsconsole-operator-lock") r := ready.NewFileReady() err = r.Set() diff --git a/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml b/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml index 52c5d51..6c486b7 100644 --- a/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml +++ b/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: envdeployments.devconsole.openshift.io + name: envdeployments.devopsconsole-operator.openshift.io spec: - group: devconsole.openshift.io + group: devopsconsole-operator.openshift.io names: kind: EnvDeployment listKind: EnvDeploymentList diff --git a/deploy/crds/devconsole_v1alpha1_environment_crd.yaml b/deploy/crds/devconsole_v1alpha1_environment_crd.yaml index 568a3cd..ac5cce8 100644 --- a/deploy/crds/devconsole_v1alpha1_environment_crd.yaml +++ b/deploy/crds/devconsole_v1alpha1_environment_crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: environments.devconsole.openshift.io + name: environments.devopsconsole-operator.openshift.io spec: - group: devconsole.openshift.io + group: devopsconsole-operator.openshift.io names: kind: Environment listKind: EnvironmentList diff --git a/deploy/operator.yaml b/deploy/operator.yaml index f8509b5..e83867c 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -1,27 +1,27 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: devconsole + name: devopsconsole-operator spec: replicas: 1 selector: matchLabels: - name: devconsole + name: devopsconsole-operator template: metadata: labels: - name: devconsole + name: devopsconsole-operator spec: - serviceAccountName: devconsole + serviceAccountName: devopsconsole-operator containers: - - name: devconsole + - name: devopsconsole-operator # Replace this with the built image name image: REPLACE_IMAGE ports: - containerPort: 60000 name: metrics command: - - devconsole + - devopsconsole-operator imagePullPolicy: Always readinessProbe: exec: @@ -41,4 +41,4 @@ spec: fieldRef: fieldPath: metadata.name - name: OPERATOR_NAME - value: "devconsole" + value: "devopsconsole-operator" diff --git a/deploy/role.yaml b/deploy/role.yaml index 997a902..c01adc8 100644 --- a/deploy/role.yaml +++ b/deploy/role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: creationTimestamp: null - name: devconsole + name: devopsconsole-operator rules: - apiGroups: - "" @@ -33,7 +33,7 @@ rules: - get - create - apiGroups: - - devconsole.openshift.io + - devopsconsole-operator.openshift.io resources: - '*' - envdeployments diff --git a/deploy/role_binding.yaml b/deploy/role_binding.yaml index c9c612a..7c662bc 100644 --- a/deploy/role_binding.yaml +++ b/deploy/role_binding.yaml @@ -1,11 +1,11 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: devconsole + name: devopsconsole-operator subjects: - kind: ServiceAccount - name: devconsole + name: devopsconsole-operator roleRef: kind: Role - name: devconsole + name: devopsconsole-operator apiGroup: rbac.authorization.k8s.io diff --git a/deploy/service_account.yaml b/deploy/service_account.yaml index 1040583..7d81101 100644 --- a/deploy/service_account.yaml +++ b/deploy/service_account.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: devconsole + name: devopsconsole-operator diff --git a/examples/local_envdeployment_cr.yaml b/examples/local_envdeployment_cr.yaml index 3f520ea..9fb2e5a 100644 --- a/examples/local_envdeployment_cr.yaml +++ b/examples/local_envdeployment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devconsole.openshift.io/v1alpha1 +apiVersion: devopsconsole-operator.openshift.io/v1alpha1 kind: EnvDeployment metadata: name: my-local-deployment @@ -7,7 +7,7 @@ spec: environmentRef: kind: Environment # this must be Environment name: devenv # this must match the name of the Environment you wish to point to - apiGroup: devconsole.openshift.io + apiGroup: devopsconsole-operator.openshift.io deploymentRef: kind: DeploymentConfig # this must be DeploymentConfig name: my-deployment # this must match the name of the DeploymentConfig you wish to point to diff --git a/examples/local_environment_cr.yaml b/examples/local_environment_cr.yaml index a796645..a9c7232 100644 --- a/examples/local_environment_cr.yaml +++ b/examples/local_environment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devconsole.openshift.io/v1alpha1 +apiVersion: devopsconsole-operator.openshift.io/v1alpha1 kind: Environment metadata: name: devenv diff --git a/examples/remote_envdeployment_cr.yaml b/examples/remote_envdeployment_cr.yaml index 061bc37..31b165f 100644 --- a/examples/remote_envdeployment_cr.yaml +++ b/examples/remote_envdeployment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devconsole.openshift.io/v1alpha1 +apiVersion: devopsconsole-operator.openshift.io/v1alpha1 kind: EnvDeployment metadata: name: my-remote-deployment @@ -7,7 +7,7 @@ spec: environmentRef: kind: Environment # this must be Environment name: dsaas-staging # this must match the name of the Environment you wish to point to - apiGroup: devconsole.openshift.io + apiGroup: devopsconsole-operator.openshift.io deploymentRef: kind: DeploymentConfig # this must be DeploymentConfig name: my-deployment # this must match the name of the DeploymentConfig you wish to point to diff --git a/examples/remote_environment_cr.yaml b/examples/remote_environment_cr.yaml index 95a9a0c..cb3ccf0 100644 --- a/examples/remote_environment_cr.yaml +++ b/examples/remote_environment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devconsole.openshift.io/v1alpha1 +apiVersion: devopsconsole-operator.openshift.io/v1alpha1 kind: Environment metadata: name: dsaas-staging diff --git a/pkg/apis/addtoscheme_clusterregistry_v1alpha1.go b/pkg/apis/addtoscheme_clusterregistry_v1alpha1.go index 03385ed..d4dafe3 100644 --- a/pkg/apis/addtoscheme_clusterregistry_v1alpha1.go +++ b/pkg/apis/addtoscheme_clusterregistry_v1alpha1.go @@ -1,7 +1,7 @@ package apis import ( - "github.com/alexeykazakov/devconsole/pkg/apis/clusterregistry/v1alpha1" + "github.com/redhat-developer/devopsconsole-operator/pkg/apis/clusterregistry/v1alpha1" ) func init() { diff --git a/pkg/apis/addtoscheme_devconsole_v1alpha1.go b/pkg/apis/addtoscheme_devconsole_v1alpha1.go index 705e5c9..5a5a987 100644 --- a/pkg/apis/addtoscheme_devconsole_v1alpha1.go +++ b/pkg/apis/addtoscheme_devconsole_v1alpha1.go @@ -1,7 +1,7 @@ package apis import ( - "github.com/alexeykazakov/devconsole/pkg/apis/devconsole/v1alpha1" + "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1" ) func init() { diff --git a/pkg/apis/devconsole/v1alpha1/doc.go b/pkg/apis/devconsole/v1alpha1/doc.go deleted file mode 100644 index 3f4edd3..0000000 --- a/pkg/apis/devconsole/v1alpha1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package v1alpha1 contains API Schema definitions for the devconsole v1alpha1 API group -// +k8s:deepcopy-gen=package,register -// +groupName=devconsole.openshift.io -package v1alpha1 diff --git a/pkg/apis/devopsconsole-operator/v1alpha1/doc.go b/pkg/apis/devopsconsole-operator/v1alpha1/doc.go new file mode 100644 index 0000000..f4df76b --- /dev/null +++ b/pkg/apis/devopsconsole-operator/v1alpha1/doc.go @@ -0,0 +1,4 @@ +// Package v1alpha1 contains API Schema definitions for the devopsconsole-operator v1alpha1 API group +// +k8s:deepcopy-gen=package,register +// +groupName=devopsconsole-operator.openshift.io +package v1alpha1 diff --git a/pkg/apis/devconsole/v1alpha1/envdeployment_types.go b/pkg/apis/devopsconsole-operator/v1alpha1/envdeployment_types.go similarity index 100% rename from pkg/apis/devconsole/v1alpha1/envdeployment_types.go rename to pkg/apis/devopsconsole-operator/v1alpha1/envdeployment_types.go diff --git a/pkg/apis/devconsole/v1alpha1/environment_types.go b/pkg/apis/devopsconsole-operator/v1alpha1/environment_types.go similarity index 100% rename from pkg/apis/devconsole/v1alpha1/environment_types.go rename to pkg/apis/devopsconsole-operator/v1alpha1/environment_types.go diff --git a/pkg/apis/devconsole/v1alpha1/register.go b/pkg/apis/devopsconsole-operator/v1alpha1/register.go similarity index 62% rename from pkg/apis/devconsole/v1alpha1/register.go rename to pkg/apis/devopsconsole-operator/v1alpha1/register.go index b28dd08..79595be 100644 --- a/pkg/apis/devconsole/v1alpha1/register.go +++ b/pkg/apis/devopsconsole-operator/v1alpha1/register.go @@ -1,8 +1,8 @@ // NOTE: Boilerplate only. Ignore this file. -// Package v1alpha1 contains API Schema definitions for the devconsole v1alpha1 API group +// Package v1alpha1 contains API Schema definitions for the devopsconsole-operator v1alpha1 API group // +k8s:deepcopy-gen=package,register -// +groupName=devconsole.openshift.io +// +groupName=devopsconsole-operator.openshift.io package v1alpha1 import ( @@ -12,7 +12,7 @@ import ( var ( // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "devconsole.openshift.io", Version: "v1alpha1"} + SchemeGroupVersion = schema.GroupVersion{Group: "devopsconsole-operator.openshift.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} diff --git a/pkg/apis/devconsole/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/devconsole/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.deepcopy.go diff --git a/pkg/controller/add_envdeployment.go b/pkg/controller/add_envdeployment.go index 97c137f..085b0f5 100644 --- a/pkg/controller/add_envdeployment.go +++ b/pkg/controller/add_envdeployment.go @@ -1,7 +1,7 @@ package controller import ( - "github.com/alexeykazakov/devconsole/pkg/controller/envdeployment" + "github.com/redhat-developer/devopsconsole-operator/pkg/controller/envdeployment" ) func init() { diff --git a/pkg/controller/envdeployment/envdeployment_controller.go b/pkg/controller/envdeployment/envdeployment_controller.go index f375075..8d85159 100644 --- a/pkg/controller/envdeployment/envdeployment_controller.go +++ b/pkg/controller/envdeployment/envdeployment_controller.go @@ -3,7 +3,7 @@ package envdeployment import ( "context" - devconsolev1alpha1 "github.com/alexeykazakov/devconsole/pkg/apis/devconsole/v1alpha1" + devopsconsoleoperatorv1alpha1 "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -46,7 +46,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { } // Watch for changes to primary resource EnvDeployment - err = c.Watch(&source.Kind{Type: &devconsolev1alpha1.EnvDeployment{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &devopsconsoleoperatorv1alpha1.EnvDeployment{}}, &handler.EnqueueRequestForObject{}) if err != nil { return err } @@ -55,7 +55,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { // Watch for changes to secondary resource Pods and requeue the owner EnvDeployment err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{ IsController: true, - OwnerType: &devconsolev1alpha1.EnvDeployment{}, + OwnerType: &devopsconsoleoperatorv1alpha1.EnvDeployment{}, }) if err != nil { return err @@ -86,7 +86,7 @@ func (r *ReconcileEnvDeployment) Reconcile(request reconcile.Request) (reconcile reqLogger.Info("Reconciling EnvDeployment") // Fetch the EnvDeployment instance - instance := &devconsolev1alpha1.EnvDeployment{} + instance := &devopsconsoleoperatorv1alpha1.EnvDeployment{} err := r.client.Get(context.TODO(), request.NamespacedName, instance) if err != nil { if errors.IsNotFound(err) { @@ -129,7 +129,7 @@ func (r *ReconcileEnvDeployment) Reconcile(request reconcile.Request) (reconcile } // newPodForCR returns a busybox pod with the same name/namespace as the cr -func newPodForCR(cr *devconsolev1alpha1.EnvDeployment) *corev1.Pod { +func newPodForCR(cr *devopsconsoleoperatorv1alpha1.EnvDeployment) *corev1.Pod { labels := map[string]string{ "app": cr.Name, } From d65f2374124b477a156a669c966561b240929bc3 Mon Sep 17 00:00:00 2001 From: Shoubhik Bose Date: Thu, 14 Feb 2019 18:16:36 -0500 Subject: [PATCH 2/5] fix group name --- deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml b/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml index 6c486b7..48ee6d6 100644 --- a/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml +++ b/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: envdeployments.devopsconsole-operator.openshift.io + name: envdeployments.devopsconsole.openshift.io spec: - group: devopsconsole-operator.openshift.io + group: devopsconsole.openshift.io names: kind: EnvDeployment listKind: EnvDeploymentList From cf023c28b7b7cb31d4302a7e5c7f02da151ae9c0 Mon Sep 17 00:00:00 2001 From: Shoubhik Bose Date: Thu, 14 Feb 2019 23:39:01 -0500 Subject: [PATCH 3/5] fix group name --- README.md | 4 ++-- deploy/crds/devconsole_v1alpha1_environment_crd.yaml | 4 ++-- deploy/role.yaml | 2 +- examples/local_envdeployment_cr.yaml | 4 ++-- examples/local_environment_cr.yaml | 2 +- examples/remote_envdeployment_cr.yaml | 4 ++-- examples/remote_environment_cr.yaml | 2 +- pkg/apis/devopsconsole-operator/v1alpha1/doc.go | 2 +- pkg/apis/devopsconsole-operator/v1alpha1/register.go | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index eae076c..4319bbb 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ $ make install Add a new API for the custom resource AppService ```sh -$ operator-sdk add api --api-version=devopsconsole-operator.openshift.io/v1alpha1 --kind=AppService +$ operator-sdk add api --api-version=devopsconsole.openshift.io/v1alpha1 --kind=AppService ``` Add a new controller that watches for AppService ```sh -$ operator-sdk add controller --api-version=devopsconsole-operator.openshift.io/v1alpha1 --kind=AppService +$ operator-sdk add controller --api-version=devopsconsole.openshift.io/v1alpha1 --kind=AppService ``` Apply the app-operator CRD. diff --git a/deploy/crds/devconsole_v1alpha1_environment_crd.yaml b/deploy/crds/devconsole_v1alpha1_environment_crd.yaml index ac5cce8..e9482e5 100644 --- a/deploy/crds/devconsole_v1alpha1_environment_crd.yaml +++ b/deploy/crds/devconsole_v1alpha1_environment_crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: environments.devopsconsole-operator.openshift.io + name: environments.devopsconsole.openshift.io spec: - group: devopsconsole-operator.openshift.io + group: devopsconsole.openshift.io names: kind: Environment listKind: EnvironmentList diff --git a/deploy/role.yaml b/deploy/role.yaml index c01adc8..bbdf76a 100644 --- a/deploy/role.yaml +++ b/deploy/role.yaml @@ -33,7 +33,7 @@ rules: - get - create - apiGroups: - - devopsconsole-operator.openshift.io + - devopsconsole.openshift.io resources: - '*' - envdeployments diff --git a/examples/local_envdeployment_cr.yaml b/examples/local_envdeployment_cr.yaml index 9fb2e5a..e390a56 100644 --- a/examples/local_envdeployment_cr.yaml +++ b/examples/local_envdeployment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devopsconsole-operator.openshift.io/v1alpha1 +apiVersion: devopsconsole.openshift.io/v1alpha1 kind: EnvDeployment metadata: name: my-local-deployment @@ -7,7 +7,7 @@ spec: environmentRef: kind: Environment # this must be Environment name: devenv # this must match the name of the Environment you wish to point to - apiGroup: devopsconsole-operator.openshift.io + apiGroup: devopsconsole.openshift.io deploymentRef: kind: DeploymentConfig # this must be DeploymentConfig name: my-deployment # this must match the name of the DeploymentConfig you wish to point to diff --git a/examples/local_environment_cr.yaml b/examples/local_environment_cr.yaml index a9c7232..bf7c704 100644 --- a/examples/local_environment_cr.yaml +++ b/examples/local_environment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devopsconsole-operator.openshift.io/v1alpha1 +apiVersion: devopsconsole.openshift.io/v1alpha1 kind: Environment metadata: name: devenv diff --git a/examples/remote_envdeployment_cr.yaml b/examples/remote_envdeployment_cr.yaml index 31b165f..c845778 100644 --- a/examples/remote_envdeployment_cr.yaml +++ b/examples/remote_envdeployment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devopsconsole-operator.openshift.io/v1alpha1 +apiVersion: devopsconsole.openshift.io/v1alpha1 kind: EnvDeployment metadata: name: my-remote-deployment @@ -7,7 +7,7 @@ spec: environmentRef: kind: Environment # this must be Environment name: dsaas-staging # this must match the name of the Environment you wish to point to - apiGroup: devopsconsole-operator.openshift.io + apiGroup: devopsconsole.openshift.io deploymentRef: kind: DeploymentConfig # this must be DeploymentConfig name: my-deployment # this must match the name of the DeploymentConfig you wish to point to diff --git a/examples/remote_environment_cr.yaml b/examples/remote_environment_cr.yaml index cb3ccf0..548b010 100644 --- a/examples/remote_environment_cr.yaml +++ b/examples/remote_environment_cr.yaml @@ -1,4 +1,4 @@ -apiVersion: devopsconsole-operator.openshift.io/v1alpha1 +apiVersion: devopsconsole.openshift.io/v1alpha1 kind: Environment metadata: name: dsaas-staging diff --git a/pkg/apis/devopsconsole-operator/v1alpha1/doc.go b/pkg/apis/devopsconsole-operator/v1alpha1/doc.go index f4df76b..15e47f5 100644 --- a/pkg/apis/devopsconsole-operator/v1alpha1/doc.go +++ b/pkg/apis/devopsconsole-operator/v1alpha1/doc.go @@ -1,4 +1,4 @@ // Package v1alpha1 contains API Schema definitions for the devopsconsole-operator v1alpha1 API group // +k8s:deepcopy-gen=package,register -// +groupName=devopsconsole-operator.openshift.io +// +groupName=devopsconsole.openshift.io package v1alpha1 diff --git a/pkg/apis/devopsconsole-operator/v1alpha1/register.go b/pkg/apis/devopsconsole-operator/v1alpha1/register.go index 79595be..94ea870 100644 --- a/pkg/apis/devopsconsole-operator/v1alpha1/register.go +++ b/pkg/apis/devopsconsole-operator/v1alpha1/register.go @@ -2,7 +2,7 @@ // Package v1alpha1 contains API Schema definitions for the devopsconsole-operator v1alpha1 API group // +k8s:deepcopy-gen=package,register -// +groupName=devopsconsole-operator.openshift.io +// +groupName=devopsconsole.openshift.io package v1alpha1 import ( @@ -12,7 +12,7 @@ import ( var ( // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "devopsconsole-operator.openshift.io", Version: "v1alpha1"} + SchemeGroupVersion = schema.GroupVersion{Group: "devopsconsole.openshift.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} From 04c12fd6cbef187b79688ad45e40394ff891bc08 Mon Sep 17 00:00:00 2001 From: Shoubhik Bose Date: Fri, 15 Feb 2019 00:51:44 -0500 Subject: [PATCH 4/5] fix filenames to have devopsconsole --- ...devconsole_v1alpha1_envdeployment_crd.yaml | 45 -------- .../devconsole_v1alpha1_environment_crd.yaml | 42 ------- ...opsconsole_v1alpha1_envdeployment_crd.yaml | 20 ++++ ...evopsconsole_v1alpha1_environment_crd.yaml | 20 ++++ .../v1alpha1/zz_generated.defaults.go | 32 ++++++ .../v1alpha1/zz_generated.openapi.go | 15 +++ .../v1alpha1/zz_generated.defaults.go | 32 ++++++ .../v1alpha1/zz_generated.openapi.go | 107 ++++++++++++++++++ 8 files changed, 226 insertions(+), 87 deletions(-) delete mode 100644 deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml delete mode 100644 deploy/crds/devconsole_v1alpha1_environment_crd.yaml create mode 100644 deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml create mode 100644 deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml create mode 100644 pkg/apis/clusterregistry/v1alpha1/zz_generated.defaults.go create mode 100644 pkg/apis/clusterregistry/v1alpha1/zz_generated.openapi.go create mode 100644 pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.defaults.go create mode 100644 pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.openapi.go diff --git a/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml b/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml deleted file mode 100644 index 48ee6d6..0000000 --- a/deploy/crds/devconsole_v1alpha1_envdeployment_crd.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: envdeployments.devopsconsole.openshift.io -spec: - group: devopsconsole.openshift.io - names: - kind: EnvDeployment - listKind: EnvDeploymentList - plural: envdeployments - singular: envdeployment - shortNames: - - envdeploy - scope: Namespaced - validation: - # openAPIV3Schema is the schema for validating custom objects. - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - environmentRef: - type: object - properties: - kind: - type: string - name: - type: string - apiGroup: - type: string - deploymentRef: - type: object - properties: - kind: - type: string - name: - type: string - apiGroup: - type: string - version: v1alpha1 diff --git a/deploy/crds/devconsole_v1alpha1_environment_crd.yaml b/deploy/crds/devconsole_v1alpha1_environment_crd.yaml deleted file mode 100644 index e9482e5..0000000 --- a/deploy/crds/devconsole_v1alpha1_environment_crd.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: environments.devopsconsole.openshift.io -spec: - group: devopsconsole.openshift.io - names: - kind: Environment - listKind: EnvironmentList - plural: environments - singular: environment - shortNames: - - env - scope: Namespaced - validation: - # openAPIV3Schema is the schema for validating custom objects. - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - type: - type: string - enum: - - 'deploy' - namespace: - type: string - clusterRef: - type: object - properties: - kind: - type: string - name: - type: string - apiGroup: - type: string - version: v1alpha1 diff --git a/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml b/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml new file mode 100644 index 0000000..4049581 --- /dev/null +++ b/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml @@ -0,0 +1,20 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: envdeployments.devopsconsole.openshift.io +spec: + group: devopsconsole.openshift.io + names: + kind: EnvDeployment + listKind: EnvDeploymentList + plural: envdeployments + singular: envdeployment + scope: Namespaced + subresources: + status: {} + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml b/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml new file mode 100644 index 0000000..ddcb094 --- /dev/null +++ b/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml @@ -0,0 +1,20 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: environments.devopsconsole.openshift.io +spec: + group: devopsconsole.openshift.io + names: + kind: Environment + listKind: EnvironmentList + plural: environments + singular: environment + scope: Namespaced + subresources: + status: {} + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/pkg/apis/clusterregistry/v1alpha1/zz_generated.defaults.go b/pkg/apis/clusterregistry/v1alpha1/zz_generated.defaults.go new file mode 100644 index 0000000..dd621a3 --- /dev/null +++ b/pkg/apis/clusterregistry/v1alpha1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes 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. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/pkg/apis/clusterregistry/v1alpha1/zz_generated.openapi.go b/pkg/apis/clusterregistry/v1alpha1/zz_generated.openapi.go new file mode 100644 index 0000000..d573a7e --- /dev/null +++ b/pkg/apis/clusterregistry/v1alpha1/zz_generated.openapi.go @@ -0,0 +1,15 @@ +// +build !ignore_autogenerated + +// Code generated by openapi-gen. DO NOT EDIT. + +// This file was autogenerated by openapi-gen. Do not edit it manually! + +package v1alpha1 + +import ( + common "k8s.io/kube-openapi/pkg/common" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{} +} diff --git a/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.defaults.go b/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.defaults.go new file mode 100644 index 0000000..dd621a3 --- /dev/null +++ b/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes 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. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.openapi.go b/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.openapi.go new file mode 100644 index 0000000..b03064f --- /dev/null +++ b/pkg/apis/devopsconsole-operator/v1alpha1/zz_generated.openapi.go @@ -0,0 +1,107 @@ +// +build !ignore_autogenerated + +// Code generated by openapi-gen. DO NOT EDIT. + +// This file was autogenerated by openapi-gen. Do not edit it manually! + +package v1alpha1 + +import ( + spec "github.com/go-openapi/spec" + common "k8s.io/kube-openapi/pkg/common" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvDeployment": schema_pkg_apis_devopsconsole_operator_v1alpha1_EnvDeployment(ref), + "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.Environment": schema_pkg_apis_devopsconsole_operator_v1alpha1_Environment(ref), + } +} + +func schema_pkg_apis_devopsconsole_operator_v1alpha1_EnvDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EnvDeployment is the Schema for the envdeployments API", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvDeploymentSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvDeploymentStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvDeploymentSpec", "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvDeploymentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_devopsconsole_operator_v1alpha1_Environment(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Environment is the Schema for the environments API", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvironmentSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvironmentStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvironmentSpec", "github.com/redhat-developer/devopsconsole-operator/pkg/apis/devopsconsole-operator/v1alpha1.EnvironmentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} From 32f211b0624260ff933104de2b8ffa86f0ee459b Mon Sep 17 00:00:00 2001 From: Shoubhik Bose Date: Wed, 20 Feb 2019 14:04:03 -0500 Subject: [PATCH 5/5] revert changes; --- ...opsconsole_v1alpha1_envdeployment_crd.yaml | 41 +++++++++++++++---- ...evopsconsole_v1alpha1_environment_crd.yaml | 38 +++++++++++++---- 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml b/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml index 4049581..e3fd875 100644 --- a/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml +++ b/deploy/crds/devopsconsole_v1alpha1_envdeployment_crd.yaml @@ -1,7 +1,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: envdeployments.devopsconsole.openshift.io spec: group: devopsconsole.openshift.io @@ -10,11 +9,37 @@ spec: listKind: EnvDeploymentList plural: envdeployments singular: envdeployment + shortNames: + - envdeploy scope: Namespaced - subresources: - status: {} - version: v1alpha1 - versions: - - name: v1alpha1 - served: true - storage: true + validation: + # openAPIV3Schema is the schema for validating custom objects. + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + environmentRef: + type: object + properties: + kind: + type: string + name: + type: string + apiGroup: + type: string + deploymentRef: + type: object + properties: + kind: + type: string + name: + type: string + apiGroup: + type: string + version: v1alpha1 \ No newline at end of file diff --git a/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml b/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml index ddcb094..362a6fb 100644 --- a/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml +++ b/deploy/crds/devopsconsole_v1alpha1_environment_crd.yaml @@ -1,7 +1,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: environments.devopsconsole.openshift.io spec: group: devopsconsole.openshift.io @@ -10,11 +9,34 @@ spec: listKind: EnvironmentList plural: environments singular: environment + shortNames: + - env scope: Namespaced - subresources: - status: {} - version: v1alpha1 - versions: - - name: v1alpha1 - served: true - storage: true + validation: + # openAPIV3Schema is the schema for validating custom objects. + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + type: + type: string + enum: + - 'deploy' + namespace: + type: string + clusterRef: + type: object + properties: + kind: + type: string + name: + type: string + apiGroup: + type: string + version: v1alpha1 \ No newline at end of file