@@ -24,8 +24,6 @@ import (
2424)
2525
2626const (
27- // ArcInstallationKey is the key used to indicate if the installation is for ARC AKS cluster.
28- ArcInstallationKey = "crd-installer.azurefleet.io/arc"
2927 // CRDInstallerLabelKey is the label key used to indicate that a CRD is managed by the installer.
3028 CRDInstallerLabelKey = "crd-installer.azurefleet.io/managed"
3129 // AzureManagedLabelKey is the label key used to indicate that a CRD is managed by an azure resource.
@@ -44,7 +42,7 @@ const (
4442 ModeHub = "hub"
4543 // ModeMember installs member cluster CRDs.
4644 ModeMember = "member"
47- // ModeArcMember installs member cluster CRDs with ARC labels .
45+ // ModeArcMember installs member cluster CRDs with ARC member label value .
4846 ModeArcMember = "arcMember"
4947)
5048
@@ -75,16 +73,17 @@ func InstallCRD(ctx context.Context, client client.Client, crd *apiextensionsv1.
7573 if existingCRD .Labels == nil {
7674 existingCRD .Labels = make (map [string ]string )
7775 }
78- if mode == ModeArcMember {
79- // For ARC AKS installation, we want to add an additional label to indicate this is an ARC managed cluster,
80- // needed for clean up of CRD by kube-addon-manager.
81- existingCRD .Labels [ArcInstallationKey ] = trueLabelValue
82- }
8376 // Ensure the label for management by the installer is set.
8477 existingCRD .Labels [CRDInstallerLabelKey ] = trueLabelValue
8578 // Also set the Azure managed label to indicate this is managed by Fleet,
8679 // needed for clean up of CRD by kube-addon-manager.
87- existingCRD .Labels [AzureManagedLabelKey ] = FleetLabelValue
80+ if mode == ModeArcMember {
81+ // For aks ARC, we set the label value to "arcMember" to avoid clean up of CRDs by OM.
82+ existingCRD .Labels [AzureManagedLabelKey ] = ModeArcMember
83+ } else {
84+ existingCRD .Labels [AzureManagedLabelKey ] = FleetLabelValue
85+ }
86+
8887 return nil
8988 }
9089 err := install (ctx , client , & existingCRD , mutFn )
0 commit comments