diff --git a/cluster-scope/base/batch/jobs/odf-enable-console-plugin/job.yaml b/cluster-scope/base/batch/jobs/odf-enable-console-plugin/job.yaml new file mode 100644 index 00000000..057239a7 --- /dev/null +++ b/cluster-scope/base/batch/jobs/odf-enable-console-plugin/job.yaml @@ -0,0 +1,29 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: enable-odf-console-plugin + annotations: + argocd.argoproj.io/hook: "PostSync" + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: enable-odf-plugin + image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest + command: + - /bin/bash + - -c + - | + echo "Patching the console to enable ODF console plugin" + oc patch consoles.operator.openshift.io cluster \ + --type merge --patch '{"spec": {"plugins": ["odf-console"]}}' + if [[ $? -eq 0 ]]; then + echo "ODF console enabled, patch was applied ok" + else + echo "Failed to patch console" + exit 1 + fi + serviceAccount: openshift-gitops-argocd-application-controller + serviceAccountName: openshift-gitops-argocd-application-controller + restartPolicy: Never diff --git a/cluster-scope/base/batch/jobs/odf-enable-console-plugin/kustomization.yaml b/cluster-scope/base/batch/jobs/odf-enable-console-plugin/kustomization.yaml new file mode 100644 index 00000000..7574a6fe --- /dev/null +++ b/cluster-scope/base/batch/jobs/odf-enable-console-plugin/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-gitops +resources: + - job.yaml