Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

now checks for the users #1992

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading