-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use argocd post-sync hooks to enable ODF console plugin
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
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
cluster-scope/base/batch/jobs/odf-enable-console-plugin/job.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
5 changes: 5 additions & 0 deletions
5
cluster-scope/base/batch/jobs/odf-enable-console-plugin/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |