Skip to content

Commit

Permalink
Merge pull request #1992 from facchettos/fix-connect
Browse files Browse the repository at this point in the history
now checks for the users
  • Loading branch information
FabianKramm authored Jul 29, 2024
2 parents 04df2b6 + 401b8a2 commit 2b5bc24
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/platform/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,16 @@ func CreateVirtualClusterInstanceOptions(ctx context.Context, client Client, con
contextOptions.Server = val.Server
}
}

if len(kubeConfig.AuthInfos) == 0 {
return kubeconfig.ContextOptions{}, errors.New("ingress access is configured but no credentials were present in the kubeconfig")
}
// find the first user and fill cert data with it
for _, v := range kubeConfig.AuthInfos {
contextOptions.ClientCertificateData = v.ClientCertificateData
contextOptions.ClientKeyData = v.ClientKeyData
break
}
if contextOptions.Server == "" {
return kubeconfig.ContextOptions{}, errors.New("could not determine server url")
}
Expand Down

0 comments on commit 2b5bc24

Please sign in to comment.