Skip to content

Commit

Permalink
Merge pull request #1993 from facchettos/connect-fix-20
Browse files Browse the repository at this point in the history
now checks for the users v20 backport
  • Loading branch information
FabianKramm authored Jul 29, 2024
2 parents 9972ca5 + 0c659f1 commit a55cc8a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/platform/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,22 @@ func CreateVirtualClusterInstanceOptions(ctx context.Context, client Client, con

// get server
for _, val := range kubeConfig.Clusters {
contextOptions.Server = val.Server
if val != nil {
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")
}

contextOptions.InsecureSkipTLSVerify = true
Expand Down

0 comments on commit a55cc8a

Please sign in to comment.