Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
javaducky authored and JorTurFer committed Aug 23, 2023
2 parents 789ffcf + e2f6e51 commit a1bde18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ func (mi *ModuleInstance) newClient(c goja.ConstructorCall) *goja.Object {
func getClientConfig(options KubeConfig) (*rest.Config, error) {
kubeconfig := options.ConfigPath
if kubeconfig == "" {
// are we in-cluster?
config, err := rest.InClusterConfig()
if err == nil {
return config, nil
}
// we aren't in-cluster
home := homedir.HomeDir()
if home == "" {
return nil, errors.New("home directory not found")
Expand Down

0 comments on commit a1bde18

Please sign in to comment.