Skip to content

Commit

Permalink
Fix some error with environment configmap (#694)
Browse files Browse the repository at this point in the history
* Added KUBECONFIG otherwise it uses the default
* Delete the configmap before creating a new one

Signed-off-by: Pedro Ruivo <[email protected]>
  • Loading branch information
pruivo authored Jan 22, 2024
1 parent cad88ea commit 004c285
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions provision/rosa-cross-dc/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,11 @@ tasks:
- ROSA_CLUSTER_NAME
cmds:
- echo "Creating configmap with environment data."
- KUBECONFIG="{{.ISPN_DIR}}/.task/kubecfg/{{.ROSA_CLUSTER_NAME}}" oc -n {{.KC_NAMESPACE_PREFIX}}keycloak create configmap env-config --from-file={{.ENV_DATA_JSON_PATH}} || (kubectl -n {{.KC_NAMESPACE_PREFIX}}keycloak create configmap env-config --from-file={{.ENV_DATA_JSON_PATH}})
- KUBECONFIG="{{.ISPN_DIR}}/.task/kubecfg/{{.ROSA_CLUSTER_NAME}}" kubectl -n {{.KC_NAMESPACE_PREFIX}}keycloak delete configmap env-config --ignore-not-found
- KUBECONFIG="{{.ISPN_DIR}}/.task/kubecfg/{{.ROSA_CLUSTER_NAME}}" kubectl -n {{.KC_NAMESPACE_PREFIX}}keycloak create configmap env-config --from-file={{.ENV_DATA_JSON_PATH}}
preconditions:
- test -f "{{.ENV_DATA_JSON_PATH}}"
- test -f "{{.ISPN_DIR}}/.task/kubecfg/{{.ROSA_CLUSTER_NAME}}"

delete-env-configmap:
internal: true
Expand All @@ -910,4 +912,6 @@ tasks:
- ROSA_CLUSTER_NAME
cmds:
- echo "Deleting configmap with environment data."
- bash -c "kubectl -n {{.KC_NAMESPACE_PREFIX}}keycloak delete configmap env-config || exit 0"
- KUBECONFIG="{{.ISPN_DIR}}/.task/kubecfg/{{.ROSA_CLUSTER_NAME}}" kubectl -n {{.KC_NAMESPACE_PREFIX}}keycloak delete configmap env-config --ignore-not-found
preconditions:
- test -f "{{.ISPN_DIR}}/.task/kubecfg/{{.ROSA_CLUSTER_NAME}}"

0 comments on commit 004c285

Please sign in to comment.