From 61231ce61a6a9708f0230c4a23942de717036e9e Mon Sep 17 00:00:00 2001 From: Sean Sundberg Date: Wed, 22 Apr 2020 11:45:26 -0500 Subject: [PATCH] Updates the check for the IBM CR pull secret - Replaces check for specific `default-icr-io` name with a pattern match Addresses draios/sysdig-cloud-scripts#110 --- agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh b/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh index 68beb886..1dbbaf35 100755 --- a/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh +++ b/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh @@ -261,7 +261,7 @@ function install_k8s_agent { # Use IBM Cloud Container Registry instead of docker.io sed -i.bak -e "s|\( *image: \)sysdig/${AGENT_STRING}|\1icr.io/ext/sysdig/${AGENT_STRING}:${AGENT_VERSION}|g" $DAEMONSET_FILE - ICR_SECRET_EXIST=$(kubectl -n default get secret default-icr-io >/dev/null 2>&1 || echo 1) + ICR_SECRET_EXIST=$(kubectl -n default get secret -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep -q icr-io || echo 1) if [ "$ICR_SECRET_EXIST" = 1 ]; then # Throw an error instead of running the command for them because it could # take a long time for the secrets to become populated