From a4fc1f4883a81638a900e3321a381ee08dc75a2d Mon Sep 17 00:00:00 2001 From: Trevor Royer Date: Fri, 26 Jul 2024 10:57:48 -0600 Subject: [PATCH] add disable instance component (#319) --- .../disable-default-instance/README.md | 23 +++++++++++++++++++ .../kustomization.yaml | 7 ++++++ .../patch-subscription.yaml | 9 ++++++++ 3 files changed, 39 insertions(+) create mode 100644 openshift-gitops-operator/operator/components/disable-default-instance/README.md create mode 100644 openshift-gitops-operator/operator/components/disable-default-instance/kustomization.yaml create mode 100644 openshift-gitops-operator/operator/components/disable-default-instance/patch-subscription.yaml diff --git a/openshift-gitops-operator/operator/components/disable-default-instance/README.md b/openshift-gitops-operator/operator/components/disable-default-instance/README.md new file mode 100644 index 00000000..4e45ea5a --- /dev/null +++ b/openshift-gitops-operator/operator/components/disable-default-instance/README.md @@ -0,0 +1,23 @@ +# disable-default-instance + +## Purpose +This component disables the creation of a default ArgoCD instance in the `openshift-gitops` namespace. + +For more information on this option please refer to the following: + +[5 global environment variables provided by OpenShift GitOps](https://developers.redhat.com/articles/2023/03/06/5-global-environment-variables-provided-openshift-gitops) + +## Usage + +This component can be added to a base by adding the `components` section to your overlay `kustomization.yaml` file: + +``` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +components: + - ../../components/disable-default-instance +``` diff --git a/openshift-gitops-operator/operator/components/disable-default-instance/kustomization.yaml b/openshift-gitops-operator/operator/components/disable-default-instance/kustomization.yaml new file mode 100644 index 00000000..0002be23 --- /dev/null +++ b/openshift-gitops-operator/operator/components/disable-default-instance/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +patches: + - path: patch-subscription.yaml + target: + kind: Subscription diff --git a/openshift-gitops-operator/operator/components/disable-default-instance/patch-subscription.yaml b/openshift-gitops-operator/operator/components/disable-default-instance/patch-subscription.yaml new file mode 100644 index 00000000..722d5522 --- /dev/null +++ b/openshift-gitops-operator/operator/components/disable-default-instance/patch-subscription.yaml @@ -0,0 +1,9 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: openshift-gitops-operator +spec: + config: + env: + - name: DISABLE_DEFAULT_ARGOCD_INSTANCE + value: true