Fix 'namespace karmada-cluster not found' when cluster is being registered with 'pull' mode
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
This commit is contained in:
parent
371ecba406
commit
161c16de24
|
@ -160,11 +160,6 @@ func JoinCluster(controlPlaneRestConfig, clusterConfig *rest.Config, opts Comman
|
|||
|
||||
klog.V(1).Infof("joining cluster config. endpoint: %s", clusterConfig.Host)
|
||||
|
||||
// ensure namespace where the cluster object be stored exists in control plane.
|
||||
if _, err = util.EnsureNamespaceExist(controlPlaneKubeClient, opts.ClusterNamespace, opts.DryRun); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
registerOption := util.ClusterRegisterOption{
|
||||
ClusterNamespace: opts.ClusterNamespace,
|
||||
ClusterName: opts.ClusterName,
|
||||
|
|
|
@ -98,6 +98,11 @@ func ObtainCredentialsFromMemberCluster(clusterKubeClient kubeclient.Interface,
|
|||
|
||||
// RegisterClusterInControllerPlane represents register cluster in controller plane
|
||||
func RegisterClusterInControllerPlane(opts ClusterRegisterOption, controlPlaneKubeClient kubeclient.Interface, generateClusterInControllerPlane generateClusterInControllerPlaneFunc) error {
|
||||
// ensure namespace where the cluster object be stored exists in control plane.
|
||||
if _, err := EnsureNamespaceExist(controlPlaneKubeClient, opts.ClusterNamespace, opts.DryRun); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
impersonatorSecret := &corev1.Secret{}
|
||||
secret := &corev1.Secret{}
|
||||
var err error
|
||||
|
|
Loading…
Reference in New Issue