From 6b736f74e9df57ec9fcd5cf148658018f293368e Mon Sep 17 00:00:00 2001 From: Xudong Liu Date: Sun, 7 Nov 2021 21:27:25 -0800 Subject: [PATCH] fix avi as control plane ha bootstrap cluster error Signed-off-by: Xudong Liu --- pkg/haprovider/haprovider.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/haprovider/haprovider.go b/pkg/haprovider/haprovider.go index f54383a4..71388250 100644 --- a/pkg/haprovider/haprovider.go +++ b/pkg/haprovider/haprovider.go @@ -134,11 +134,16 @@ func (r *HAProvider) annotateService(ctx context.Context, cluster *clusterv1.Clu akoov1alpha1.TKGClusterNameSpaceLabel: cluster.Namespace, } + if ako_operator.IsBootStrapCluster() { + return serviceAnnotation, nil + } + aviInfraSetting, err := r.getAviInfraSettingFromCluster(ctx, cluster) if err != nil { return serviceAnnotation, err } - if aviInfraSetting != nil && !ako_operator.IsBootStrapCluster() { + + if aviInfraSetting != nil { // add AVIInfraSetting annotation when creating HA svc serviceAnnotation[akoov1alpha1.HAAVIInfraSettingAnnotationsKey] = aviInfraSetting.Name }