diff --git a/k8s/c2d_deployer.Makefile b/k8s/c2d_deployer.Makefile index 3d91afe08c..c8e94041d6 100644 --- a/k8s/c2d_deployer.Makefile +++ b/k8s/c2d_deployer.Makefile @@ -67,10 +67,16 @@ TESTER_BUILDER := tester-builder-$(shell echo $$RANDOM) echo "Downloading crane version $$VERSION..."; \ curl -sL "https://github.com/google/go-containerregistry/releases/download/$$VERSION/go-containerregistry_$${OS}_$${ARCH}.tar.gz" > go-containerregistry.tar.gz; \ tar -zxvf go-containerregistry.tar.gz crane; \ - sudo mv crane /usr/local/bin/crane; \ - chmod 755 /usr/local/bin/crane; \ + if command -v sudo &>/dev/null; then \ + sudo mv crane /usr/local/bin/crane; \ + sudo chmod 755 /usr/local/bin/crane; \ + sudo chmod +x /usr/local/bin/crane; \ + else \ + mv crane /usr/local/bin/crane; \ + chmod 755 /usr/local/bin/crane; \ + chmod +x /usr/local/bin/crane; \ + fi; \ rm go-containerregistry.tar.gz; \ - sudo chmod +x /usr/local/bin/crane; \ echo "crane successfully installed"; \ else \ echo "crane is already installed"; \