balena-io-examples / google-iot

Google Cloud IoT integration
Apache License 2.0
15 stars 8 forks source link

Setup script won't run from SDK installed from Apt #18

Open kb2ma opened 3 years ago

kb2ma commented 3 years ago

Running on an Ubuntu 20.04 laptop with Google Cloud SDK installed from the Apt package google-cloud-sdk. The setup script gcp-setup.sh fails with the message below.

kbee@system76:~/dev/google-iot/repo$ scripts/gcp-setup.sh 
*** GCP Prereqs: Install ***
ERROR: (gcloud.components.install) 
You cannot perform this action because the Cloud SDK component manager 
is disabled for this installation. You can run the following command 
to achieve the same result for this installation: 

sudo apt-get install google-cloud-sdk

In fact the Apt package installation disables the SDK component manager. However we can work around this limitation as described below.

The setup script is attempting to install only the alpha component, but this component already is included with with Apt package. So, a reasonable resolution is to test for the presence of this component before attempting to install it.