Skip to content

Commit 27fc65e

Browse files
authored
fix the ut failure in pod (#1034)
Signed-off-by: Zhiwei Yin <[email protected]>
1 parent 215cfed commit 27fc65e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/registration/register/common.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ func KubeConfigFromSecretOption(s SecretOption, bootstrap bool) (*rest.Config, e
267267
return nil, fmt.Errorf("unable to load bootstrap kubeconfig: %w", err)
268268
}
269269
} else {
270+
if s.HubKubeconfigFile == "" {
271+
return nil, fmt.Errorf("no hub kubeconfig found")
272+
}
273+
270274
kubeConfig, err = clientcmd.BuildConfigFromFlags("", s.HubKubeconfigFile)
271275
if err != nil {
272276
return nil, fmt.Errorf("unable to load hub kubeconfig from file %q: %w", s.HubKubeconfigFile, err)

0 commit comments

Comments
 (0)