Skip to content

Commit

Permalink
don't fail if not in-cluster (#64)
Browse files Browse the repository at this point in the history
Signed-off-by: Nandor Kracser <bonifaido@gmail.com>
  • Loading branch information
bonifaido authored Nov 25, 2020
1 parent afd322f commit 2e8f3e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion k8s/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa
// Attempt to load in-cluster config
cfg, err = restclient.InClusterConfig()
if err != nil {
return nil, fmt.Errorf("Failed to configure: %s", err)
// Fallback to standard config if we are not running inside a cluster
if err == restclient.ErrNotInCluster {
cfg = &restclient.Config{}
} else {
return nil, fmt.Errorf("Failed to configure: %s", err)
}
}
}

Expand Down

0 comments on commit 2e8f3e3

Please sign in to comment.