From 3625dd1365e46cda5a7785021f3c5b4c638ab3f5 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Mon, 8 May 2023 16:49:37 -0400 Subject: [PATCH 01/11] pick-up hpa fixes Signed-off-by: Jaideep Rao --- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index a34be8ddf..151029acd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/redhat-developer/gitops-operator go 1.18 require ( - github.com/argoproj-labs/argocd-operator v0.0.16-0.20230327142827-aa1a18bbb071 + github.com/argoproj-labs/argocd-operator v0.0.16-0.20230504123816-ba8562574d23 github.com/coreos/prometheus-operator v0.40.0 github.com/go-logr/logr v1.2.3 github.com/google/go-cmp v0.5.9 @@ -31,7 +31,7 @@ require ( github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect - github.com/argoproj/argo-cd/v2 v2.6.3 // indirect + github.com/argoproj/argo-cd/v2 v2.6.7 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver v3.5.1+incompatible // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -75,11 +75,11 @@ require ( go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.19.1 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/net v0.4.0 // indirect + golang.org/x/net v0.7.0 // indirect golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.3.0 // indirect - golang.org/x/term v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 0dba88378..bc4e2d3dc 100644 --- a/go.sum +++ b/go.sum @@ -145,10 +145,10 @@ github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.m github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/argoproj-labs/argocd-operator v0.0.16-0.20230327142827-aa1a18bbb071 h1:dT+cZ9ahA3VJBsFdVAut4b5SIH1QhP+Hb1j5OanPPR0= -github.com/argoproj-labs/argocd-operator v0.0.16-0.20230327142827-aa1a18bbb071/go.mod h1:R5QjiIWh7KS5kNQ3lkAAgqEz8iCKawgl0SdicaC+ILA= -github.com/argoproj/argo-cd/v2 v2.6.3 h1:XEvGDnGRroAw5mKKUTcfIbTmjmhL0hEsVh1+vkytrLo= -github.com/argoproj/argo-cd/v2 v2.6.3/go.mod h1:wkQAcIEXpgP8F45T/9UwwHhhLz2KgITba0NOby4NTPQ= +github.com/argoproj-labs/argocd-operator v0.0.16-0.20230504123816-ba8562574d23 h1:GH5O57Yo3nd7waaUgt2tXeRem3QuzkQWwpHiO9LVdcg= +github.com/argoproj-labs/argocd-operator v0.0.16-0.20230504123816-ba8562574d23/go.mod h1:MniMdcgIppC15EENrSrDY+k5sHY+WTUxFBjJRIUMvbM= +github.com/argoproj/argo-cd/v2 v2.6.7 h1:hBW8QNi6rAN5yERIiwLz3dzErxoJ1Y3BGWwlFsnxETM= +github.com/argoproj/argo-cd/v2 v2.6.7/go.mod h1:Vqnr5UMfUt+01ycy1bVTARUVGuOUZmGAp52CC3spkVo= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -1420,8 +1420,8 @@ golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1568,13 +1568,13 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1585,8 +1585,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 67e7153e92868fd5717d388c9fc28aaa8391532c Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Mon, 10 Jul 2023 08:14:54 -0400 Subject: [PATCH 02/11] support installing gitops-operator in its own namespace Signed-off-by: Jaideep Rao --- bundle.Dockerfile | 2 +- ...oller-manager-metrics-service_v1_service.yaml | 16 ---------------- ...rbac.authorization.k8s.io_v1_clusterrole.yaml | 10 ---------- .../gitops-operator.clusterserviceversion.yaml | 16 ++++++++++------ ...ps-operator-manager-config_v1_configmap.yaml} | 2 +- config/default/kustomization.yaml | 4 ++-- config/manager/manager.yaml | 8 ++++---- .../gitops-operator.clusterserviceversion.yaml | 2 ++ config/prometheus/monitor.yaml | 4 ++-- config/rbac/auth_proxy_service.yaml | 4 ++-- config/rbac/kustomization.yaml | 4 ++-- 11 files changed, 26 insertions(+), 46 deletions(-) delete mode 100644 bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml delete mode 100644 bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml rename bundle/manifests/{gitops-operator-manager-config_v1_configmap.yaml => openshift-gitops-operator-manager-config_v1_configmap.yaml} (88%) diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 22c4cc45f..2a617ed8a 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8 LABEL operators.operatorframework.io.bundle.channel.default.v1=latest -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 diff --git a/bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml b/bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml deleted file mode 100644 index d0dace51d..000000000 --- a/bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - creationTimestamp: null - labels: - control-plane: argocd-operator - name: gitops-operator-controller-manager-metrics-service -spec: - ports: - - name: https - port: 8443 - targetPort: https - selector: - control-plane: argocd-operator -status: - loadBalancer: {} diff --git a/bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml deleted file mode 100644 index 2361e63f6..000000000 --- a/bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: gitops-operator-metrics-reader -rules: -- nonResourceURLs: - - /metrics - verbs: - - get diff --git a/bundle/manifests/gitops-operator.clusterserviceversion.yaml b/bundle/manifests/gitops-operator.clusterserviceversion.yaml index 8e96e6100..b6a288395 100644 --- a/bundle/manifests/gitops-operator.clusterserviceversion.yaml +++ b/bundle/manifests/gitops-operator.clusterserviceversion.yaml @@ -137,6 +137,8 @@ metadata: containerImage: quay.io/redhat-developer/gitops-operator description: Enables teams to adopt GitOps principles for managing cluster configurations and application delivery across hybrid multi-cluster Kubernetes environments. + operatorframework.io/cluster-monitoring: "true" + operatorframework.io/suggested-namespace: openshift-gitops-operator operators.openshift.io/infrastructure-features: '["disconnected"]' operators.operatorframework.io/builder: operator-sdk-v1.10.0+git operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 @@ -865,19 +867,21 @@ spec: - subjectaccessreviews verbs: - create - serviceAccountName: gitops-operator-controller-manager + serviceAccountName: openshift-gitops-operator-controller-manager deployments: - - name: gitops-operator-controller-manager + - label: + control-plane: gitops-operator + name: openshift-gitops-operator-controller-manager spec: replicas: 1 selector: matchLabels: - control-plane: argocd-operator + control-plane: gitops-operator strategy: {} template: metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator spec: containers: - command: @@ -911,7 +915,7 @@ spec: runAsNonRoot: true securityContext: runAsNonRoot: true - serviceAccountName: gitops-operator-controller-manager + serviceAccountName: openshift-gitops-operator-controller-manager terminationGracePeriodSeconds: 10 permissions: - rules: @@ -946,7 +950,7 @@ spec: verbs: - create - patch - serviceAccountName: gitops-operator-controller-manager + serviceAccountName: openshift-gitops-operator-controller-manager strategy: deployment installModes: - supported: false diff --git a/bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml b/bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml similarity index 88% rename from bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml rename to bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml index 47ad1ca82..dfef9c4bc 100644 --- a/bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml +++ b/bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml @@ -14,4 +14,4 @@ data: resourceName: 2b63967d.openshift.io kind: ConfigMap metadata: - name: gitops-operator-manager-config + name: openshift-gitops-operator-manager-config diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index de18dcfca..affdd9b8e 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,12 +1,12 @@ # Adds namespace to all resources. -namespace: gitops-operator-system +namespace: openshift-gitops-operator # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: gitops-operator- +namePrefix: openshift-gitops-operator- # Labels to add to all resources and selectors. #commonLabels: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 49b525c07..092f91709 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Namespace metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator name: system --- apiVersion: apps/v1 @@ -11,16 +11,16 @@ metadata: name: controller-manager namespace: system labels: - control-plane: argocd-operator + control-plane: gitops-operator spec: selector: matchLabels: - control-plane: argocd-operator + control-plane: gitops-operator replicas: 1 template: metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator spec: securityContext: runAsNonRoot: true diff --git a/config/manifests/bases/gitops-operator.clusterserviceversion.yaml b/config/manifests/bases/gitops-operator.clusterserviceversion.yaml index f8cb67c63..774fc8875 100644 --- a/config/manifests/bases/gitops-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/gitops-operator.clusterserviceversion.yaml @@ -7,6 +7,8 @@ metadata: containerImage: quay.io/redhat-developer/gitops-operator description: Enables teams to adopt GitOps principles for managing cluster configurations and application delivery across hybrid multi-cluster Kubernetes environments. + operatorframework.io/cluster-monitoring: "true" + operatorframework.io/suggested-namespace: openshift-gitops-operator operators.openshift.io/infrastructure-features: '["disconnected"]' repository: https://github.com/redhat-developer/gitops-operator support: Red Hat diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index dd2aaaed6..c9eee0d77 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator name: controller-manager-metrics-monitor namespace: system spec: @@ -17,4 +17,4 @@ spec: insecureSkipVerify: true selector: matchLabels: - control-plane: argocd-operator + control-plane: gitops-operator diff --git a/config/rbac/auth_proxy_service.yaml b/config/rbac/auth_proxy_service.yaml index 7e3675472..5bd6a607d 100644 --- a/config/rbac/auth_proxy_service.yaml +++ b/config/rbac/auth_proxy_service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator name: controller-manager-metrics-service namespace: system spec: @@ -11,4 +11,4 @@ spec: port: 8443 targetPort: https selector: - control-plane: argocd-operator + control-plane: gitops-operator diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 731832a6a..d42f142e6 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -12,7 +12,7 @@ resources: # Comment the following 4 lines if you want to disable # the auth proxy (https://github.com/brancz/kube-rbac-proxy) # which protects your /metrics endpoint. -- auth_proxy_service.yaml +# - auth_proxy_service.yaml - auth_proxy_role.yaml - auth_proxy_role_binding.yaml -- auth_proxy_client_clusterrole.yaml +# - auth_proxy_client_clusterrole.yaml From bc7630bd27219be4a0593f71faf6579431040441 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Mon, 10 Jul 2023 08:30:29 -0400 Subject: [PATCH 03/11] reverse sdk version Signed-off-by: Jaideep Rao --- bundle.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 2a617ed8a..22c4cc45f 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8 LABEL operators.operatorframework.io.bundle.channel.default.v1=latest -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1 +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 From 56673ff91797ab810f8e9262933109af99fb2f88 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Mon, 10 Jul 2023 09:31:48 -0400 Subject: [PATCH 04/11] fix operator namespace in test Signed-off-by: Jaideep Rao --- .../parallel/1-051-validate_csv_permissions/01-validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml b/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml index 529d0dd00..ddf9f5211 100644 --- a/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml +++ b/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | set -e - res=$(oc auth can-i delete resourcequotas -n openshift-gitops --as system:serviceaccount:openshift-operators:gitops-operator-controller-manager) + res=$(oc auth can-i delete resourcequotas -n openshift-gitops --as system:serviceaccount:openshift-gitops-operator:openshift-gitops-operator-controller-manager) if test "$res" != "yes"; then echo "Can't delete resourcequotas" exit 1 From 41efcb93483c64aa58b71fc83bd552b80558e306 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Mon, 10 Jul 2023 12:06:02 -0400 Subject: [PATCH 05/11] replace openshift-operators with openshift-gitops-operator Signed-off-by: Jaideep Rao --- README.md | 2 +- bundle.Dockerfile | 2 +- .../gitops-operator.clusterserviceversion.yaml | 9 +++++---- bundle/metadata/annotations.yaml | 2 +- config/manager/kustomization.yaml | 3 ++- docs/OpenShift GitOps Usage Guide.md | 4 ++-- scripts/e2e-common.sh | 14 +++++++------- scripts/openshift-CI-kuttl-tests.sh | 4 ++-- scripts/openshift-interop-kuttl-tests.sh | 4 ++-- .../01-check_disable_dex_removed.yaml | 8 ++++---- .../1-090_validate_permissions/01-assert.yaml | 2 +- .../02-assert.yaml | 4 ++-- .../02-patch-subscription.yaml | 4 ++-- .../04-patch-subscription.yaml | 4 ++-- .../02-patch-subscription.yaml | 4 ++-- .../06-revert-patch.yaml | 4 ++-- .../04-check_controller_pod_status.yaml | 6 +++--- .../04-disable-dex-through-sub.yaml | 4 ++-- .../05-unset-disable-dex-env-var.yaml | 4 ++-- .../1-056_validate_managed-by/04-add_env.yaml | 4 ++-- .../1-056_validate_managed-by/05-check.yaml | 4 ++-- .../1-056_validate_managed-by/08-remove_env.yaml | 4 ++-- .../02-add_env.yaml | 4 ++-- .../03-check-env.yaml | 4 ++-- .../04-disable-env.yaml | 4 ++-- .../05-check-env.yaml | 4 ++-- .../06-empty-valued-env.yaml | 4 ++-- .../07-check-env.yaml | 4 ++-- .../08-remove-env.yaml | 4 ++-- .../02-install-dynamic-plugin.yaml | 4 ++-- 30 files changed, 67 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index aafbe32b4..245eabc9c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ spec: ![a relative link](docs/assets/operatorhub-listing.png) -3. Install the operator using the defaults in the wizard, and wait for it to show up in the list of "Installed Operators". If it doesn't install properly, you can check on its status in the "Installed Operators" tab in the `openshift-operators` namespace. +3. Install the operator in the `openshift-gitops-operator` namesapce using the defaults in the wizard, and optionally, select the checkbox to enable cluster monitoring on the namesapce. Wait for it to show up in the list of "Installed Operators". If it doesn't install properly, you can check on its status in the "Installed Operators" tab in the `openshift-gitops-operator` namespace. ![a relative link](docs/assets/installed-operator.png) diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 22c4cc45f..2a617ed8a 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8 LABEL operators.operatorframework.io.bundle.channel.default.v1=latest -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 diff --git a/bundle/manifests/gitops-operator.clusterserviceversion.yaml b/bundle/manifests/gitops-operator.clusterserviceversion.yaml index b6a288395..e316084a3 100644 --- a/bundle/manifests/gitops-operator.clusterserviceversion.yaml +++ b/bundle/manifests/gitops-operator.clusterserviceversion.yaml @@ -135,16 +135,17 @@ metadata: capabilities: Deep Insights console.openshift.io/plugins: '["gitops-plugin"]' containerImage: quay.io/redhat-developer/gitops-operator + createdAt: "2023-07-10T15:48:47Z" description: Enables teams to adopt GitOps principles for managing cluster configurations and application delivery across hybrid multi-cluster Kubernetes environments. operatorframework.io/cluster-monitoring: "true" operatorframework.io/suggested-namespace: openshift-gitops-operator operators.openshift.io/infrastructure-features: '["disconnected"]' - operators.operatorframework.io/builder: operator-sdk-v1.10.0+git + operators.operatorframework.io/builder: operator-sdk-v1.28.1 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/redhat-developer/gitops-operator support: Red Hat - name: gitops-operator.v1.8.0 + name: gitops-operator.v1.10.0-new-ns namespace: placeholder spec: apiservicedefinitions: {} @@ -891,7 +892,7 @@ spec: value: openshift-gitops - name: OPERATOR_NAME value: gitops-operator - image: quay.io/redhat-developer/gitops-operator:latest + image: quay.io/jrao/gitops-operator:1.10.0-new-ns livenessProbe: httpGet: path: /healthz @@ -977,4 +978,4 @@ spec: provider: name: Red Hat Inc replaces: gitops-operator.v1.7.3 - version: 1.8.0 + version: 1.10.0-new-ns diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index caaeabfc6..3a7b7aebb 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -6,7 +6,7 @@ annotations: operators.operatorframework.io.bundle.package.v1: gitops-operator operators.operatorframework.io.bundle.channels.v1: latest,gitops-1.8 operators.operatorframework.io.bundle.channel.default.v1: latest - operators.operatorframework.io.metrics.builder: operator-sdk-v1.10.0+git + operators.operatorframework.io.metrics.builder: operator-sdk-v1.28.1 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index c7ac940f7..d3bbfdd84 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -12,4 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: quay.io/redhat-developer/gitops-operator + newName: quay.io/jrao/gitops-operator + newTag: 1.10.0-new-ns diff --git a/docs/OpenShift GitOps Usage Guide.md b/docs/OpenShift GitOps Usage Guide.md index 9e0c2f6aa..213b2e4b1 100644 --- a/docs/OpenShift GitOps Usage Guide.md +++ b/docs/OpenShift GitOps Usage Guide.md @@ -47,7 +47,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: openshift-gitops-operator - namespace: openshift-operators + namespace: openshift-gitops-operator spec: channel: stable installPlanApproval: Automatic @@ -165,7 +165,7 @@ spec: ``` oc patch subscriptions.operators.coreos.com/openshift-gitops-operator \ --n openshift-operators \ +-n openshift-gitops-operator \ --type='merge' \ --patch '{ "spec": { "config": { "env": [ { "name": "DISABLE_DEX", "value": "true" } ] } } }' ``` diff --git a/scripts/e2e-common.sh b/scripts/e2e-common.sh index e4edee6cb..e71f8be51 100644 --- a/scripts/e2e-common.sh +++ b/scripts/e2e-common.sh @@ -134,7 +134,7 @@ function dump_cluster_state() { function dump_extra_cluster_state() { echo ">>> Gitops controller log:" - kubectl -n openshift-operators logs $(get_app_pod argocd-operator openshift-operators) --all-containers=true + kubectl -n openshift-gitops-operator logs $(get_app_pod argocd-operator openshift-gitops-operator) --all-containers=true } @@ -251,11 +251,11 @@ function uninstall_operator_resources() { oc wait --for=delete $deployment -n openshift-gitops --timeout=5m || fail_test "Failed to delete deployment: $deployment in openshift-gitops namespace" done - oc delete $(oc get csv -n openshift-operators -o name|grep gitops) -n openshift-operators || fail_test "Unable to delete CSV" + oc delete $(oc get csv -n openshift-gitops-operator -o name|grep gitops) -n openshift-gitops-operator || fail_test "Unable to delete CSV" - oc delete -n openshift-operators installplan $(oc get subscription gitops-operator -n openshift-operators -o jsonpath='{.status.installplan.name}') || fail_test "Unable to delete installplan" + oc delete -n openshift-gitops-operator installplan $(oc get subscription gitops-operator -n openshift-gitops-operator -o jsonpath='{.status.installplan.name}') || fail_test "Unable to delete installplan" - oc delete subscription gitops-operator -n openshift-operators --cascade=background || fail_test "Unable to delete subscription" + oc delete subscription gitops-operator -n openshift-gitops-operator --cascade=background || fail_test "Unable to delete subscription" echo -e ">> Delete arogo resources accross all namespaces" for res in applications applicationsets appprojects argocds; do @@ -273,13 +273,13 @@ function uninstall_operator_resources() { function install_operator_resources() { echo -e ">>Ensure Gitops subscription exists" - oc get subscription gitops-operator -n openshift-operators 2>/dev/null || \ + oc get subscription gitops-operator -n openshift-gitops-operator 2>/dev/null || \ cat <> Wait for GitopsService creation" wait_until_object_exist "gitopsservices.pipelines.openshift.io" "cluster" "openshift-gitops" || fail_test "gitops service haven't created yet" diff --git a/scripts/openshift-CI-kuttl-tests.sh b/scripts/openshift-CI-kuttl-tests.sh index 14146adb9..03e58dd41 100755 --- a/scripts/openshift-CI-kuttl-tests.sh +++ b/scripts/openshift-CI-kuttl-tests.sh @@ -18,8 +18,8 @@ export KUBECONFIG=$TMP_DIR/kubeconfig cp $KUBECONFIG /go/src/github.com/redhat-developer/gitops-operator/kubeconfig # Ensuring proper installation -pod=gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-operators -o yaml -subscription=gitops-operator- && oc get subscription `oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators +pod=openshift-gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o yaml +subscription=gitops-operator- && oc get subscription `oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator oc wait --for=condition=Ready -n openshift-gitops pod --timeout=15m -l 'app.kubernetes.io/name in (cluster,kam,openshift-gitops-application-controller,openshift-gitops-applicationset-controller,openshift-gitops-dex-server,openshift-gitops-redis,openshift-gitops-repo-server,openshift-gitops-server)' # Check argocd instance creation diff --git a/scripts/openshift-interop-kuttl-tests.sh b/scripts/openshift-interop-kuttl-tests.sh index 11a36e67f..c8c7097f9 100755 --- a/scripts/openshift-interop-kuttl-tests.sh +++ b/scripts/openshift-interop-kuttl-tests.sh @@ -17,8 +17,8 @@ export KUBECONFIG=$TMP_DIR/kubeconfig cp $KUBECONFIG /go/src/github.com/redhat-developer/gitops-operator/kubeconfig # Ensuring proper installation -pod=gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-operators -o yaml -oc get subscription -n openshift-operators +pod=openshift-gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o yaml +oc get subscription -n openshift-gitops-operator oc wait --for=condition=Ready -n openshift-gitops pod --timeout=15m -l 'app.kubernetes.io/name in (cluster,kam,openshift-gitops-application-controller,openshift-gitops-applicationset-controller,openshift-gitops-dex-server,openshift-gitops-redis,openshift-gitops-repo-server,openshift-gitops-server)' # Check argocd instance creation diff --git a/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml b/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml index 89daffe80..d66cebbf4 100644 --- a/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml +++ b/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml @@ -5,14 +5,14 @@ commands: set -e if [ -z $CI ]; then - operator_name_version=$(oc get subscription/openshift-gitops-operator -n openshift-operators -o jsonpath='{.status.installedCSV}') - if [ "$(oc get csv/"${operator_name_version}" -n openshift-operators -o jsonpath='{.spec.install.spec.deployments[].spec.template.spec.containers[].env}' | grep DISABLE_DEX)" != '' ]; then + operator_name_version=$(oc get subscription/openshift-gitops-operator -n openshift-gitops-operator -o jsonpath='{.status.installedCSV}') + if [ "$(oc get csv/"${operator_name_version}" -n openshift-gitops-operator -o jsonpath='{.spec.install.spec.deployments[].spec.template.spec.containers[].env}' | grep DISABLE_DEX)" != '' ]; then echo "DISABLE_DEX env var is still present in the operator CSV." exit 1 fi else - operator_name_version=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o jsonpath='{.status.installedCSV}') - if [ "$(oc get csv/"${operator_name_version}" -n openshift-operators -o jsonpath='{.spec.install.spec.deployments[].spec.template.spec.containers[].env}' | grep DISABLE_DEX)" != '' ]; then + operator_name_version=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o jsonpath='{.status.installedCSV}') + if [ "$(oc get csv/"${operator_name_version}" -n openshift-gitops-operator -o jsonpath='{.spec.install.spec.deployments[].spec.template.spec.containers[].env}' | grep DISABLE_DEX)" != '' ]; then echo "DISABLE_DEX env var is still present in the operator CSV." exit 1 fi diff --git a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml index 3b0e66814..be10f229a 100644 --- a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml +++ b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: name: gitops-operator.v1.8.0 - namespace: openshift-operators + namespace: openshift-gitops-operator spec: install: spec: diff --git a/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-assert.yaml b/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-assert.yaml index eb9bf5b7b..14db94442 100644 --- a/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-assert.yaml +++ b/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-assert.yaml @@ -1,8 +1,8 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: gitops-operator-controller-manager - namespace: openshift-operators + name: openshift-gitops-operator-controller-manager + namespace: openshift-gitops-operator status: readyReplicas: 1 replicas: 1 diff --git a/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml b/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml index 3d314746f..a59f225fc 100644 --- a/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml +++ b/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml @@ -5,12 +5,12 @@ commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_INSTANCE", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_INSTANCE", "value": "true"}]}}}' fi - script: sleep 120 diff --git a/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml b/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml index dacbc67b2..ea85d4c6a 100644 --- a/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml +++ b/test/openshift/e2e/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml @@ -5,11 +5,11 @@ commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' fi - script: sleep 120 diff --git a/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml b/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml index 075f051d4..e52de5ed0 100644 --- a/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml +++ b/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml @@ -5,12 +5,12 @@ commands: - script: | if ! [ -z $CI ]; then - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\ --type merge --patch '{"spec": {"config": {"env": [{"name": "CONTROLLER_CLUSTER_ROLE", "value": "custom-argocd-role"},{"name": "SERVER_CLUSTER_ROLE", "value": "custom-argocd-role"}]}}}' else - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "CONTROLLER_CLUSTER_ROLE", "value": "custom-argocd-role"},{"name": "SERVER_CLUSTER_ROLE", "value": "custom-argocd-role"}]}}}' fi diff --git a/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml b/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml index 66b703538..9fe27d989 100644 --- a/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml +++ b/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml @@ -3,8 +3,8 @@ kind: TestStep commands: - script: | if ! [ -z $CI ]; then - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' else - oc patch subscription/openshift-gitops-operator -n openshift-operators --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' + oc patch subscription/openshift-gitops-operator -n openshift-gitops-operator --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' fi - script: sleep 10 diff --git a/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml b/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml index b36c99f33..12e333c40 100644 --- a/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml +++ b/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml @@ -1,12 +1,12 @@ -# Check if the gitops-operator-controller-manager pod is running +# Check if the openshift-gitops-operator-controller-manager pod is running apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - script: | - oc rollout status deployment gitops-operator-controller-manager -n openshift-operators --timeout=1m + oc rollout status deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator --timeout=1m rollout_status=$? if [ "${rollout_status}" -ne 0 ]; then - echo "gitops-operator-controller-manager deployment was not successfully rolled out" + echo "openshift-gitops-operator-controller-manager deployment was not successfully rolled out" exit 1 fi exit 0 \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml b/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml index 2ddafb411..4ebab4f4f 100644 --- a/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml +++ b/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml @@ -4,11 +4,11 @@ commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": "true"}]}}}' fi - script: sleep 30 \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml b/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml index 3dccdcbeb..7370c8f25 100644 --- a/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml +++ b/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml @@ -4,11 +4,11 @@ commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": ""}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": ""}]}}}' fi - script: sleep 30 \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml index a0b1ee427..11ce6e5d7 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml @@ -6,11 +6,11 @@ commands: set -e if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION", "value": "true"}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml index b8e82a01e..2b85e11ae 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 @@ -11,7 +11,7 @@ commands: exit 0 fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml index 4c82f72f5..fa808c985 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml @@ -4,9 +4,9 @@ commands: # patches the subscription to set an environment variable - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' fi diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml index cb8316420..ab6251888 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml @@ -3,9 +3,9 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "true"}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml index 4ad4650c4..7d8f6c872 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK not set" @@ -13,7 +13,7 @@ commands: fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml index 4e564c8ee..c2d66933f 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml @@ -3,9 +3,9 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "false"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "false"}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml index 1ecbdf9fb..ba63941a7 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"false"' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" @@ -13,7 +13,7 @@ commands: fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"false"' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml index 837d7af6d..e27c36179 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml @@ -3,9 +3,9 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": ""}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": ""}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml index e25de220f..4ed58d2d9 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '""' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" @@ -13,7 +13,7 @@ commands: fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '""' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml index fcfccc076..4c5a6af9a 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if [ -z $CI ]; then - oc -n openshift-operators patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' + oc -n openshift-gitops-operator patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' else - oc -n openshift-operators patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' + oc -n openshift-gitops-operator patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml b/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml index 38a85bf87..60968b2fd 100644 --- a/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml +++ b/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml @@ -5,11 +5,11 @@ commands: set -eo pipefail # Get CSV name and also OCP version. - csv_name=$(oc get csv -n openshift-operators | awk '/gitops-operator/ {print $1}') + csv_name=$(oc get csv -n openshift-gitops-operator | awk '/gitops-operator/ {print $1}') ocp_version=$(oc version | awk '/Server Version/ {split($3,a,"-"); print a[1]}') # Patch the CSV to add the necessary env key:value for Dynamic Plugin - oc patch csv "${csv_name}" -n openshift-operators \ + oc patch csv "${csv_name}" -n openshift-gitops-operator \ --type='json' \ -p='[{ "op": "add", From da8ee9b7581479bc379263bfa3d174bc815e1c4f Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Wed, 12 Jul 2023 07:11:56 -0400 Subject: [PATCH 06/11] update non-olm installation for new namespace Signed-off-by: Jaideep Rao --- .../install-gitops-operator.sh | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/hack/non-olm-install/install-gitops-operator.sh b/hack/non-olm-install/install-gitops-operator.sh index 40b0b5f02..9fd3f96b7 100755 --- a/hack/non-olm-install/install-gitops-operator.sh +++ b/hack/non-olm-install/install-gitops-operator.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash -NAMESPACE_PREFIX=${NAMESPACE_PREFIX:-"gitops-operator-"} +NAMESPACE=${NAMESPACE:-"openshift-gitops-operator"} +NAME_PREFIX=${NAME_PREFIX:-"openshift-gitops-operator-"} GIT_REVISION=${GIT_REVISION:-"master"} MAX_RETRIES=3 @@ -59,15 +60,15 @@ function print_help() { function check_pod_status_ready() { # Wait for the deployment rollout to complete before trying to list the pods # to ensure that only pods corresponding to the new version is considered. - ${KUBECTL} rollout status deploy -n ${NAMESPACE_PREFIX}system --timeout=5m + ${KUBECTL} rollout status deploy -n ${NAMESPACE} --timeout=5m for binary in "$@"; do - pod_name=$(${KUBECTL} get pods --no-headers --field-selector="status.phase!=Succeeded" -o custom-columns=":metadata.name" -n ${NAMESPACE_PREFIX}system | grep "$binary"); + pod_name=$(${KUBECTL} get pods --no-headers --field-selector="status.phase!=Succeeded" -o custom-columns=":metadata.name" -n ${NAMESPACE} | grep "$binary"); if [ ! -z "$pod_name" ]; then echo "[DEBUG] Pod name : $pod_name"; - ${KUBECTL} wait pod --for=condition=Ready $pod_name -n ${NAMESPACE_PREFIX}system --timeout=150s; + ${KUBECTL} wait pod --for=condition=Ready $pod_name -n ${NAMESPACE} --timeout=150s; if [ $? -ne 0 ]; then echo "[INFO] Pod '$pod_name' failed to become Ready in desired time. Logs from the pod:" - ${KUBECTL} logs $pod_name -n ${NAMESPACE_PREFIX}system --all-containers; + ${KUBECTL} logs $pod_name -n ${NAMESPACE} --all-containers; echo "[ERROR] Install/Upgrade failed. Performing rollback to $PREV_IMAGE"; rollback fi @@ -140,8 +141,8 @@ function create_kustomization_init_file() { echo "[INFO] Creating kustomization.yaml file using manifests from revision '${GIT_REVISION}'" echo "apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: ${NAMESPACE_PREFIX}system -namePrefix: ${NAMESPACE_PREFIX} +namespace: ${NAMESPACE} +namePrefix: ${NAME_PREFIX} resources: - https://github.com/redhat-developer/gitops-operator/config/crd?ref=$GIT_REVISION&timeout=90s - https://github.com/redhat-developer/gitops-operator/config/rbac?ref=$GIT_REVISION&timeout=90s @@ -288,7 +289,7 @@ function check_and_install_prerequisites { # if so, stores the previous version which would be used for rollback in case of # a failure during installation. function get_prev_operator_image() { - for image in $(${KUBECTL} get deploy/gitops-operator-controller-manager -n ${NAMESPACE_PREFIX}system -o jsonpath='{..image}' 2>/dev/null) + for image in $(${KUBECTL} get deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} -o jsonpath='{..image}' 2>/dev/null) do if [[ "${image}" == *"operator"* ]]; then PREV_OPERATOR_IMG="${image}" @@ -418,9 +419,13 @@ function main() { prepare_kustomize_files print_info echo "[INFO] Performing $MODE operation for openshift-gitops-operator..." + if [[ $MODE == "Install" ]]; then + ${KUBECTL} create ns ${NAMESPACE} + ${KUBECTL} label ns ${NAMESPACE} openshift.io/cluster-monitoring=true + fi apply_kustomize_manifests # Check pod status and rollback if necessary. - check_pod_status_ready gitops-operator-controller-manager + check_pod_status_ready openshift-gitops-operator-controller-manager exit 0 ;; --uninstall | -u) @@ -433,6 +438,7 @@ function main() { # Remove the GitOpsService instance created for the default # ArgoCD instance created in openshift-gitops namespace. ${KUBECTL} delete gitopsservice/cluster + ${KUBECTL} delete ns ${NAMESPACE} delete_kustomize_manifests exit 0 ;; From 0f821e8d61aa08003c34f42613134a9639a697fc Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Thu, 27 Jul 2023 13:57:39 -0400 Subject: [PATCH 07/11] fix unintended manifest changes Signed-off-by: Jaideep Rao --- bundle.Dockerfile | 2 +- .../gitops-operator.clusterserviceversion.yaml | 13 +++++-------- bundle/metadata/annotations.yaml | 2 +- config/manager/kustomization.yaml | 3 +-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 2a617ed8a..22c4cc45f 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8 LABEL operators.operatorframework.io.bundle.channel.default.v1=latest -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1 +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 diff --git a/bundle/manifests/gitops-operator.clusterserviceversion.yaml b/bundle/manifests/gitops-operator.clusterserviceversion.yaml index e316084a3..54c883480 100644 --- a/bundle/manifests/gitops-operator.clusterserviceversion.yaml +++ b/bundle/manifests/gitops-operator.clusterserviceversion.yaml @@ -135,17 +135,16 @@ metadata: capabilities: Deep Insights console.openshift.io/plugins: '["gitops-plugin"]' containerImage: quay.io/redhat-developer/gitops-operator - createdAt: "2023-07-10T15:48:47Z" description: Enables teams to adopt GitOps principles for managing cluster configurations and application delivery across hybrid multi-cluster Kubernetes environments. operatorframework.io/cluster-monitoring: "true" operatorframework.io/suggested-namespace: openshift-gitops-operator operators.openshift.io/infrastructure-features: '["disconnected"]' - operators.operatorframework.io/builder: operator-sdk-v1.28.1 + operators.operatorframework.io/builder: operator-sdk-v1.10.0+git operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/redhat-developer/gitops-operator support: Red Hat - name: gitops-operator.v1.10.0-new-ns + name: gitops-operator.v1.8.0 namespace: placeholder spec: apiservicedefinitions: {} @@ -870,9 +869,7 @@ spec: - create serviceAccountName: openshift-gitops-operator-controller-manager deployments: - - label: - control-plane: gitops-operator - name: openshift-gitops-operator-controller-manager + - name: openshift-gitops-operator-controller-manager spec: replicas: 1 selector: @@ -892,7 +889,7 @@ spec: value: openshift-gitops - name: OPERATOR_NAME value: gitops-operator - image: quay.io/jrao/gitops-operator:1.10.0-new-ns + image: quay.io/redhat-developer/gitops-operator:latest livenessProbe: httpGet: path: /healthz @@ -978,4 +975,4 @@ spec: provider: name: Red Hat Inc replaces: gitops-operator.v1.7.3 - version: 1.10.0-new-ns + version: 1.8.0 diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 3a7b7aebb..caaeabfc6 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -6,7 +6,7 @@ annotations: operators.operatorframework.io.bundle.package.v1: gitops-operator operators.operatorframework.io.bundle.channels.v1: latest,gitops-1.8 operators.operatorframework.io.bundle.channel.default.v1: latest - operators.operatorframework.io.metrics.builder: operator-sdk-v1.28.1 + operators.operatorframework.io.metrics.builder: operator-sdk-v1.10.0+git operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index d3bbfdd84..c7ac940f7 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -12,5 +12,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: quay.io/jrao/gitops-operator - newTag: 1.10.0-new-ns + newName: quay.io/redhat-developer/gitops-operator From 66c421204a334c60c3c22af98aaef476c7bf53eb Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Thu, 27 Jul 2023 14:35:38 -0400 Subject: [PATCH 08/11] resolve merge conflicts Signed-off-by: Jaideep Rao --- .../08-remove-env.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml index b0c21f710..339d4df39 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml @@ -2,17 +2,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - script: | -<<<<<<< HEAD - if [ -z $CI ]; then - oc -n openshift-gitops-operator patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' -======= if ! [ -z $NON_OLM ]; then oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":null}]}]}}}}' elif [ -z $CI ]; then oc -n openshift-operators patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' ->>>>>>> e3dbee6a84368cfdc6898cb514d45f1ba0035325 else oc -n openshift-gitops-operator patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' fi \ No newline at end of file From a4abed463706febb61bb7012d6e4846afe12486e Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Wed, 2 Aug 2023 09:01:42 -0400 Subject: [PATCH 09/11] update test for failure Signed-off-by: Jaideep Rao --- .../e2e/parallel/1-090_validate_permissions/01-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml index be10f229a..91616202c 100644 --- a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml +++ b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml @@ -1,7 +1,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: - name: gitops-operator.v1.8.0 + name: gitops-operator.v1-10-0 namespace: openshift-gitops-operator spec: install: From 58fbf49bb9961f4eb8f15c65a5b0409726e5e753 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Thu, 3 Aug 2023 08:13:10 -0400 Subject: [PATCH 10/11] update csv name Signed-off-by: Jaideep Rao --- .../e2e/parallel/1-090_validate_permissions/01-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml index 91616202c..afe8c90ce 100644 --- a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml +++ b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml @@ -1,7 +1,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: - name: gitops-operator.v1-10-0 + name: gitops-operator.v1.10.0 namespace: openshift-gitops-operator spec: install: From 5a223ae1212252b78662554f9836f4b72417f5a4 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Tue, 5 Sep 2023 07:59:06 -0400 Subject: [PATCH 11/11] update all remaining references to use new namespace Signed-off-by: Jaideep Rao --- .../install-gitops-operator.sh | 22 +++++++++---------- hack/scripts/run-non-olm-kuttl-test.sh | 2 +- .../02-patch-subscription.yaml | 2 +- .../04-patch-subscription.yaml | 2 +- .../02-patch-subscription.yaml | 4 ++-- .../06-revert-patch.yaml | 4 ++-- .../04-disable-dex-through-sub.yaml | 2 +- .../05-unset-disable-dex-env-var.yaml | 2 +- .../1-056_validate_managed-by/04-add_env.yaml | 2 +- .../1-056_validate_managed-by/05-check.yaml | 4 ++-- .../08-remove_env.yaml | 4 ++-- .../02-add_env.yaml | 4 ++-- .../03-check-env.yaml | 4 ++-- .../04-disable-env.yaml | 4 ++-- .../05-check-env.yaml | 4 ++-- .../06-empty-valued-env.yaml | 4 ++-- .../07-check-env.yaml | 4 ++-- .../08-remove-env.yaml | 4 ++-- 18 files changed, 39 insertions(+), 39 deletions(-) diff --git a/hack/non-olm-install/install-gitops-operator.sh b/hack/non-olm-install/install-gitops-operator.sh index 0ebc09453..c86a8e742 100755 --- a/hack/non-olm-install/install-gitops-operator.sh +++ b/hack/non-olm-install/install-gitops-operator.sh @@ -62,7 +62,7 @@ function print_help() { function check_pod_status_ready() { # Wait for the deployment rollout to complete before trying to list the pods # to ensure that only pods corresponding to the new version is considered. - ${KUBECTL} rollout status deploy -n ${NAMESPACE_PREFIX}system --timeout=5m + ${KUBECTL} rollout status deploy -n openshift-gitops-operator --timeout=5m if [ $? -ne 0 ]; then echo "[INFO] Deployments did not reach healthy state within 5m. Rolling back" else @@ -70,16 +70,16 @@ function check_pod_status_ready() { return 0 fi - pod_name=$(${KUBECTL} get pods --no-headers --field-selector="status.phase!=Succeeded" -o custom-columns=":metadata.name" -n ${NAMESPACE_PREFIX}system | grep "${1}"); + pod_name=$(${KUBECTL} get pods --no-headers --field-selector="status.phase!=Succeeded" -o custom-columns=":metadata.name" -n openshift-gitops-operator | grep "${1}"); if [ -z "$pod_name" ]; then echo "[WARN] Ignoring empty pod name" return 0 fi echo "[DEBUG] Pod name : $pod_name"; - ${KUBECTL} wait pod --for=condition=Ready $pod_name -n ${NAMESPACE_PREFIX}system --timeout=150s; + ${KUBECTL} wait pod --for=condition=Ready $pod_name -n ${NAMESPACE} --timeout=150s; if [ $? -ne 0 ]; then echo "[INFO] Pod '$pod_name' failed to become Ready in desired time. Logs from the pod:" - ${KUBECTL} logs $pod_name -n ${NAMESPACE_PREFIX}system --all-containers; + ${KUBECTL} logs $pod_name -n ${NAMESPACE} --all-containers; echo "[ERROR] Install/Upgrade failed. Performing rollback"; rollback return 1 @@ -455,7 +455,7 @@ function migrate_olm_installation() { fi apply_kustomize_manifests # Check pod status if it becomes ready - check_pod_status_ready gitops-operator-controller-manager + check_pod_status_ready openshift-gitops-operator-controller-manager if [ $? -eq 0 ]; then # Non OLM installation is successful and its safe to remove the OLM specific @@ -469,20 +469,20 @@ function migrate_olm_installation() { # When migrating from OLM to non OLM installation, deployment created by the OLM operator # must be scaled down to avoid 2 conflicting operators operating on the same CR. function scale_down_olm_deploy() { - ${KUBECTL} scale deploy/gitops-operator-controller-manager -n openshift-operators --replicas=0 + ${KUBECTL} scale deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} --replicas=0 } # If migration to non OLM installation fails, revert to OLM based installation # by scaling back the OLM created deployments from 0 to 1. # Note: Rollback is possible only if the corresponding Subscription and ClusterServiceVersion objects are available. function rollback_to_olm() { - ${KUBECTL} scale deploy/gitops-operator-controller-manager -n openshift-operators --replicas=1 + ${KUBECTL} scale deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} --replicas=1 } # Deletes the subscription for openshift-gitops-operator function remove_subscription() { #Delete the gitops subscription - ${KUBECTL} delete subscription openshift-gitops-operator -n openshift-operators + ${KUBECTL} delete subscription openshift-gitops-operator -n ${NAMESPACE} } # Deletes the ClusterServiceVersion Object from the system @@ -493,13 +493,13 @@ function remove_installed_csv() { echo "[INFO] No installed CSV in Subscription" return fi - ${KUBECTL} delete clusterserviceversion ${installedCSV} -n openshift-operators + ${KUBECTL} delete clusterserviceversion ${installedCSV} -n ${NAMESPACE} } # Waits till the OLM removal is successful. function wait_for_olm_removal() { # Wait till the operator deployment is completely removed. - ${KUBECTL} wait --for=delete deploy/gitops-operator-controller-manager -n openshift-operators --timeout=60s + ${KUBECTL} wait --for=delete deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} --timeout=60s } # Extract the custom configuration set in the Subscription and @@ -507,7 +507,7 @@ function wait_for_olm_removal() { # the non-OLM installation. function extract_custom_env_in_subscription() { # Get the GitOps subscription object as yaml - ${KUBECTL} get subscription openshift-gitops-operator -n openshift-operators -o yaml > ${WORK_DIR}/subscription.yaml + ${KUBECTL} get subscription openshift-gitops-operator -n ${NAMESPACE} -o yaml > ${WORK_DIR}/subscription.yaml # check if config.env element is present element=$(${YQ} '.spec.config.env' ${WORK_DIR}/subscription.yaml) if [ "${element}" == "null" ]; then diff --git a/hack/scripts/run-non-olm-kuttl-test.sh b/hack/scripts/run-non-olm-kuttl-test.sh index 9b376bae5..f5b615ff4 100755 --- a/hack/scripts/run-non-olm-kuttl-test.sh +++ b/hack/scripts/run-non-olm-kuttl-test.sh @@ -54,7 +54,7 @@ done #replace the namespace for assert in test file -sed -i 's/openshift-operators/gitops-operator-system/g' $temp_dir/sequential/1-018_validate_disable_default_instance/02-assert.yaml \ +sed -i 's/openshift-operators/openshift-gitops-operator/g' $temp_dir/sequential/1-018_validate_disable_default_instance/02-assert.yaml \ $temp_dir/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml cleanup() { diff --git a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml index 88a54f797..21283708e 100644 --- a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml +++ b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml @@ -4,7 +4,7 @@ commands: # patches the subscription to set an environment variable - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_INSTANCE","value":"true"}]}]}}}}' elif [ -z $CI ]; then diff --git a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml index d58382aa6..332f439bd 100644 --- a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml +++ b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml @@ -4,7 +4,7 @@ commands: # patches the subscription to set an environment variable - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_INSTANCE","value":null}]}]}}}}' elif [ -z $CI ]; then diff --git a/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml b/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml index 0f6dc6697..da26bff46 100644 --- a/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml +++ b/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml @@ -5,12 +5,12 @@ commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"CONTROLLER_CLUSTER_ROLE","value":"custom-argocd-role"},{"name":"SERVER_CLUSTER_ROLE", "value":"custom-argocd-role"}]}]}}}}' elif ! [ -z $CI ]; then - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\ --type merge --patch '{"spec": {"config": {"env": [{"name": "CONTROLLER_CLUSTER_ROLE", "value": "custom-argocd-role"},{"name": "SERVER_CLUSTER_ROLE", "value": "custom-argocd-role"}]}}}' else diff --git a/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml b/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml index 73b424f70..a10ed6f37 100644 --- a/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml +++ b/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml @@ -3,11 +3,11 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"CONTROLLER_CLUSTER_ROLE","value":null},{"name":"SERVER_CLUSTER_ROLE", "value":null}]}]}}}}' elif ! [ -z $CI ]; then - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' else oc patch subscription/openshift-gitops-operator -n openshift-gitops-operator --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' fi diff --git a/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml b/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml index 8d6d18027..37d4af3e5 100644 --- a/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml +++ b/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEX","value":"true"}]}]}}}}' elif [ -z $CI ]; then diff --git a/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml b/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml index 5e58de18e..d379656a0 100644 --- a/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml +++ b/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEX","value":""}]}]}}}}' elif [ -z $CI ]; then diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml index 3ab211612..d2f2c412f 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml @@ -6,7 +6,7 @@ commands: set -e if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION","value":"true"}]}]}}}}' elif [ -z $CI ]; then diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml index 819f52ed6..dd39153ae 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION")|.value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 @@ -11,7 +11,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml index e41ab6d38..f86d9e9e8 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml @@ -4,10 +4,10 @@ commands: # patches the subscription to set an environment variable - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION","value":null}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' else oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml index cd0cc89ed..f51b4afbb 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml @@ -3,10 +3,10 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":"true"}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "true"}]}}}' else oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml index d526a3075..c33864cdd 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK not set" @@ -12,7 +12,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK not set" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml index e3ab4681c..04ce323e2 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml @@ -3,11 +3,11 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":"false"}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "false"}]}}}' else oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml index fbcaa6b6b..20b88d5ed 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') if ! [[ "${label_value}" == '"false"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" @@ -12,7 +12,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"false"' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml index fa2927dbc..096530976 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml @@ -3,11 +3,11 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":""}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": ""}]}}}' else oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml index fc9b64a07..46ba09587 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq -r '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq -r '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') if ! [[ "${label_value}" == null ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" exit 1 @@ -11,7 +11,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '""' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml index 339d4df39..a7d8c821a 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml @@ -3,11 +3,11 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":null}]}]}}}}' elif [ -z $CI ]; then - oc -n openshift-operators patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' + oc -n openshift-gitops-operator patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' else oc -n openshift-gitops-operator patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' fi \ No newline at end of file