Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Automatically select kube context. #251

@stewartmiles

Description

@stewartmiles

At the moment the scripts have code like this...

CURRENT_CONTEXT=$(kubectl config current-context)

if [ "$?" != "0" ]; then
  bold "No current Kubernetes context is configured."
  exit 1
fi

which is only going to catch no current context and is likely going to be wrong if a user has been managing other clusters with kubectl.

Since installation properties ~/cloudshell_open/spinnaker-for-gcp/scripts/install/properties are used throughout a range of scripts in the project which means that only one Spinnaker deployment can be managed from a user account (since they're tied to the user's home directory). Since Spinnaker's GKE Kubernetes context can be derived from gke_${PROJECT_ID}_${ZONE}_${DEPLOYMENT_NAME}, how about making it easier on users by automatically selecting the GKE context for the current Spinnaker deployment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions