Skip to content

Commit

Permalink
Merge pull request #49 from deitch/handle-explicit-false
Browse files Browse the repository at this point in the history
handle explicit ROLLER_KUBERNETES false
  • Loading branch information
deitch authored Jan 19, 2021
2 parents b925086 + f0b886f commit 3137b5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ func (k *kubernetesReadiness) prepareTermination(hostnames []string, ids []strin
}

func kubeGetClientset() (*kubernetes.Clientset, error) {
useKube := os.Getenv("ROLLER_KUBERNETES") == "true"
envValue := os.Getenv("ROLLER_KUBERNETES")
// if it is *explicitly* set to false, then do nothing
if envValue == "false" {
return nil, nil
}
// if it is not explicitly set to false, then it depends on if we are in a cluster or not
useKube := envValue == "true"
// creates the in-cluster config
config, err := rest.InClusterConfig()
if err != nil {
Expand Down

0 comments on commit 3137b5d

Please sign in to comment.