CircleCI-Public / gcp-gke-orb

Interact with Google Kubernetes Engine (GKE) from CircleCI
https://circleci.com/orbs/registry/orb/circleci/gcp-gke
MIT License
7 stars 21 forks source link

doesn't seem to work on k8s #55

Closed sebastian-lerner closed 1 year ago

sebastian-lerner commented 2 years ago

Orb version:

latest one?

What happened:

i've got a report from a customer who says an orb is not working on their container runner within their k8s cluster. we think it's because of this specific part of the orb's logic:

if grep 'docker\|lxc' /proc/1/cgroup > /dev/null 2>&1; then
  if [[ $(command -v gcloud) == "" ]]; then
    install
  else
    echo "gcloud CLI is already installed."
  fi

if the grep string was updated to grep 'docker\|lxc\|kube' /proc/1/cgroup we think this will work on k8s (it seems to work on our test cluster).

Expected behavior:

the orb works on self-hosted runner in k8s just like it works on Cloud.

Additional Information:

i dont trust myself submitting a PR, but it is this line: https://github.com/CircleCI-Public/gcp-cli-orb/blob/master/src/commands/install.yml#L25

EricRibeiro commented 1 year ago

After further investigation, we learned the user lacks sudo in their execution environment. The gcloud CLI requires the command to remove existing installations that differ from the version requested by the user. They were instructed to install sudo before calling the orb's command.

In https://github.com/CircleCI-Public/gcp-cli-orb/pull/51, we are putting checks in place to inform the user in case they lack dependencies.