diff --git a/pkg/controllers/clusterinventory/clusterprofile/controller.go b/pkg/controllers/clusterinventory/clusterprofile/controller.go index b1de43f80..52c01a7ee 100644 --- a/pkg/controllers/clusterinventory/clusterprofile/controller.go +++ b/pkg/controllers/clusterinventory/clusterprofile/controller.go @@ -201,7 +201,6 @@ func (r *Reconciler) fillInClusterStatus(mc *clusterv1beta1.MemberCluster, cp *c } else { // throw an alert _ = controller.NewUnexpectedBehaviorError(fmt.Errorf("cluster certificate authority data not found in member cluster %s status", mc.Name)) - cp.Status.AccessProviders[0].Cluster.InsecureSkipTLSVerify = true } } diff --git a/pkg/propertyprovider/azure/provider.go b/pkg/propertyprovider/azure/provider.go index a02fcb469..ba1be87c3 100644 --- a/pkg/propertyprovider/azure/provider.go +++ b/pkg/propertyprovider/azure/provider.go @@ -261,9 +261,13 @@ func (p *PropertyProvider) Start(ctx context.Context, config *rest.Config) error } p.clusterCertificateAuthority = cadata p.clusterCertificateAuthorityObservedTime = time.Now() + klog.V(2).Info("Cached cluster certificate authority data from file") + } else if len(config.CAData) > 0 { + p.clusterCertificateAuthority = config.CAData + p.clusterCertificateAuthorityObservedTime = time.Now() klog.V(2).Info("Cached cluster certificate authority data") } else { - err := fmt.Errorf("rest.Config CAFile empty: %s", config.CAFile) + err := fmt.Errorf("rest.Config has empty CAFile and CAData") klog.ErrorS(err, "No certificate authority data available in rest.Config") }