Skip to content

Commit

Permalink
Use argocd post-sync hooks to enable ODF console plugin
Browse files Browse the repository at this point in the history
Run a post-sync hook [1] to enable the ODF console plugin.

[1]: https://argo-cd.readthedocs.io/en/stable/user-guide/resource_hooks/

x-branch: feature/odf
  • Loading branch information
larsks committed Jul 1, 2022
1 parent dc1cabf commit 9422c83
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cluster-scope/base/batch/jobs/odf-enable-console-plugin/job.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: openshift-gitops
resources:
- job.yaml

0 comments on commit 9422c83

Please sign in to comment.