Skip to content

Commit

Permalink
fix: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow committed Oct 28, 2023
1 parent 9100a3b commit 3f45a31
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
20 changes: 20 additions & 0 deletions scripts/library/argo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,23 @@ argo_install(){
argo_print_info

}

argo_disable_management(){
ARGO_DEPLOY_STABLE=(cluster kam openshift-gitops-applicationset-controller openshift-gitops-redis openshift-gitops-repo-server openshift-gitops-server)

for i in "${ARGO_DEPLOY_STABLE[@]}"
do
echo "Scaling OpenShift GitOps deployment $i to 0"
oc scale --replicas=0 deployment "$i" -n "${ARGO_NS}"
done

# shellcheck disable=SC2034
NAMESPACE="${ARGO_NS}"
k8s_null_finalizers_for_all_resource_instances applicationsets.argoproj.io
oc delete applicationsets.argoproj.io -n "${ARGO_NS}" --all
k8s_null_finalizers_for_all_resource_instances application.argoproj.io
oc delete application.argoproj.io -n "${ARGO_NS}" --all

oc delete -k "${ARGO_KUSTOMIZE_OPERATOR}"
oc delete -k "${ARGO_KUSTOMIZE_INSTANCE}"
}
2 changes: 1 addition & 1 deletion scripts/library/aws.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

aws_check_cli(){
which aws || \
which aws >/dev/null 2>&1 || \
pip install awscli -q || return
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/library/k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ k8s_null_finalizers(){
# -p '[{"op": "remove", "path":"/metadata/finalizers"}]'
}

k8s_null_finalizers_for_all_resource(){
k8s_null_finalizers_for_all_resource_instances(){
RESOURCE=${1}
[ -z ${RESOURCE+x} ] && return 1

Expand Down Expand Up @@ -96,7 +96,7 @@ k8s_ns_delete_most_resources_force(){
for i in $(k8s_get_most_api_resources)
do
echo "Resource:" "${i}"
k8s_null_finalizers_for_all_resource "${i}"
k8s_null_finalizers_for_all_resource_instances "${i}"
kubectl -n "${NAMESPACE}" \
delete "${i}" \
--all
Expand Down
4 changes: 2 additions & 2 deletions scripts/library/macros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ setup_operator_nvidia(){
# setup nvidia gpu operator
oc apply -k components/operators/gpu-operator-certified/operator/overlays/stable
k8s_wait_for_crd clusterpolicies.nvidia.com
oc apply -k components/operators/gpu-operator-certified/instance/overlays/time-slicing-4
oc apply -k components/operators/gpu-operator-certified/instance/overlays/time-slicing-2
}

setup_operator_pipelines(){
Expand All @@ -29,5 +29,5 @@ setup_operator_pipelines(){

setup_namespaces(){
# setup namespaces
oc apply -k components/configs/namespaces/overlays/default
oc apply -k components/configs/cluster/namespaces/overlays/default
}

0 comments on commit 3f45a31

Please sign in to comment.