fix the ut failure in pod (#1034)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 2m10s
Post / coverage (push) Failing after 34m46s
Post / images (amd64) (push) Failing after 8m6s
Post / images (arm64) (push) Failing after 7m44s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 1m7s

Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
Zhiwei Yin
2025-06-12 11:41:34 +08:00
committed by GitHub
parent 215cfed77e
commit 27fc65e174

View File

@@ -267,6 +267,10 @@ func KubeConfigFromSecretOption(s SecretOption, bootstrap bool) (*rest.Config, e
return nil, fmt.Errorf("unable to load bootstrap kubeconfig: %w", err)
}
} else {
if s.HubKubeconfigFile == "" {
return nil, fmt.Errorf("no hub kubeconfig found")
}
kubeConfig, err = clientcmd.BuildConfigFromFlags("", s.HubKubeconfigFile)
if err != nil {
return nil, fmt.Errorf("unable to load hub kubeconfig from file %q: %w", s.HubKubeconfigFile, err)