Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constants for kind names #4233

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.3/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -

# Deploy CAAPH
curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/download/v0.1.0-alpha.9/addon-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -
curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/download/v0.1.0-alpha.10/addon-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -

# Deploy CAPZ
$(KIND) load docker-image $(CONTROLLER_IMG)-$(ARCH):$(TAG) --name=$(KIND_CLUSTER_NAME)
Expand Down
14 changes: 7 additions & 7 deletions api/v1beta1/azurecluster_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func TestVnetDefaults(t *testing.T) {
},
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand All @@ -161,7 +161,7 @@ func TestVnetDefaults(t *testing.T) {
ResourceGroup: "cluster-test",
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand All @@ -183,7 +183,7 @@ func TestVnetDefaults(t *testing.T) {
},
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand All @@ -206,7 +206,7 @@ func TestVnetDefaults(t *testing.T) {
},
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand All @@ -228,7 +228,7 @@ func TestVnetDefaults(t *testing.T) {
},
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand All @@ -251,7 +251,7 @@ func TestVnetDefaults(t *testing.T) {
},
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand All @@ -273,7 +273,7 @@ func TestVnetDefaults(t *testing.T) {
},
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/azurecluster_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *AzureCluster) validateCluster(old *AzureCluster) (admission.Warnings, e
}

return nil, apierrors.NewInvalid(
schema.GroupKind{Group: "infrastructure.cluster.x-k8s.io", Kind: "AzureCluster"},
schema.GroupKind{Group: "infrastructure.cluster.x-k8s.io", Kind: AzureClusterKind},
c.Name, allErrs)
}

Expand Down Expand Up @@ -147,7 +147,7 @@ func validateIdentityRef(identityRef *corev1.ObjectReference, fldPath *field.Pat
if identityRef == nil {
return field.Required(fldPath, "identityRef is required")
}
if identityRef.Kind != "AzureClusterIdentity" {
if identityRef.Kind != AzureClusterIdentityKind {
return field.NotSupported(fldPath.Child("name"), identityRef.Name, []string{"AzureClusterIdentity"})
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azurecluster_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ func createValidCluster() *AzureCluster {
NetworkSpec: createValidNetworkSpec(),
AzureClusterClassSpec: AzureClusterClassSpec{
IdentityRef: &corev1.ObjectReference{
Kind: "AzureClusterIdentity",
Kind: AzureClusterIdentityKind,
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion api/v1beta1/azurecluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ func (c *AzureCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings
return c.validateCluster(old)
}

return nil, apierrors.NewInvalid(GroupVersion.WithKind("AzureCluster").GroupKind(), c.Name, allErrs)
// replace with constant
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterKind).GroupKind(), c.Name, allErrs)
}

// validateSubnetUpdate validates a ClusterSpec.NetworkSpec.Subnets for immutability.
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azureclusteridentity_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ func (c *AzureClusterIdentity) validateClusterIdentity() (admission.Warnings, er
if len(allErrs) == 0 {
return nil, nil
}
return nil, apierrors.NewInvalid(GroupVersion.WithKind("AzureClusterIdentity").GroupKind(), c.Name, allErrs)
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterIdentityKind).GroupKind(), c.Name, allErrs)
}
2 changes: 1 addition & 1 deletion api/v1beta1/azureclusteridentity_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (c *AzureClusterIdentity) ValidateUpdate(oldRaw runtime.Object) (admission.
if len(allErrs) == 0 {
return c.validateClusterIdentity()
}
return nil, apierrors.NewInvalid(GroupVersion.WithKind("AzureClusterIdentity").GroupKind(), c.Name, allErrs)
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterIdentityKind).GroupKind(), c.Name, allErrs)
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremachine_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ func (m mockClient) Get(ctx context.Context, key client.ObjectKey, obj client.Ob
case *clusterv1.Cluster:
obj.Spec = clusterv1.ClusterSpec{
InfrastructureRef: &corev1.ObjectReference{
Kind: "AzureCluster",
Kind: AzureClusterKind,
Name: "test-cluster",
Namespace: "default",
},
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremachine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ func (m mockDefaultClient) Get(ctx context.Context, key client.ObjectKey, obj cl
obj.Spec.SubscriptionID = m.SubscriptionID
case *clusterv1.Cluster:
obj.Spec.InfrastructureRef = &corev1.ObjectReference{
Kind: "AzureCluster",
Kind: AzureClusterKind,
Name: "test-cluster",
}
default:
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremanagedcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (r *AzureManagedCluster) ValidateUpdate(oldRaw runtime.Object) (admission.W
}

if len(allErrs) != 0 {
return nil, apierrors.NewInvalid(GroupVersion.WithKind("AzureManagedCluster").GroupKind(), r.Name, allErrs)
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureManagedClusterKind).GroupKind(), r.Name, allErrs)
}

return nil, nil
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremanagedcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (mw *azureManagedControlPlaneWebhook) ValidateUpdate(ctx context.Context, o
return nil, m.Validate(mw.Client)
}

return nil, apierrors.NewInvalid(GroupVersion.WithKind("AzureManagedControlPlane").GroupKind(), m.Name, allErrs)
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureManagedControlPlaneKind).GroupKind(), m.Name, allErrs)
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
Expand Down
13 changes: 13 additions & 0 deletions api/v1beta1/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,16 @@ const (
// value for the label is the CAPI Cluster Name.
OwnedByClusterLabelKey = NameAzureProviderPrefix + string(ResourceLifecycleOwned)
)

const (
// AzureClusterKind indicates the kind of an AzureCluster.
AzureClusterKind = "AzureCluster"
// AzureMachinePoolKind indicates the kind of an AzureMachinePool.
AzureMachinePoolKind = "AzureMachinePool"
// AzureManagedClusterKind indicates the kind of an AzureManagedCluster.
AzureManagedClusterKind = "AzureManagedCluster"
// AzureManagedControlPlaneKind indicates the kind of an AzureManagedControlPlane.
AzureManagedControlPlaneKind = "AzureManagedControlPlane"
// AzureClusterIdentityKind indicates the kind of an AzureClusterIdentity.
AzureClusterIdentityKind = "AzureClusterIdentity"
)
2 changes: 1 addition & 1 deletion azure/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func (s *ClusterScope) GroupSpecs() []azure.ASOResourceSpecGetter[*asoresourcesv
Location: s.Location(),
ClusterName: s.ClusterName(),
AdditionalTags: s.AdditionalTags(),
Owner: *metav1.NewControllerRef(s.AzureCluster, infrav1.GroupVersion.WithKind("AzureCluster")),
Owner: *metav1.NewControllerRef(s.AzureCluster, infrav1.GroupVersion.WithKind(infrav1.AzureClusterKind)),
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion azure/scope/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (m *MachinePoolScope) createMachine(ctx context.Context, machine azure.VMSS
OwnerReferences: []metav1.OwnerReference{
{
APIVersion: infrav1exp.GroupVersion.String(),
Kind: "AzureMachinePool",
Kind: infrav1.AzureMachinePoolKind,
Name: m.AzureMachinePool.Name,
BlockOwnerDeletion: ptr.To(true),
UID: m.AzureMachinePool.UID,
Expand Down
2 changes: 1 addition & 1 deletion azure/scope/machinepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ func getReadyAzureMachinePoolMachines(count int32) []infrav1exp.AzureMachinePool
OwnerReferences: []metav1.OwnerReference{
{
Name: "amp",
Kind: "AzureMachinePool",
Kind: infrav1.AzureMachinePoolKind,
APIVersion: infrav1exp.GroupVersion.String(),
},
},
Expand Down
4 changes: 2 additions & 2 deletions azure/scope/managedcontrolplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (s *ManagedControlPlaneScope) GroupSpecs() []azure.ASOResourceSpecGetter[*a
Location: s.Location(),
ClusterName: s.ClusterName(),
AdditionalTags: s.AdditionalTags(),
Owner: *metav1.NewControllerRef(s.ControlPlane, infrav1.GroupVersion.WithKind("AzureManagedControlPlane")),
Owner: *metav1.NewControllerRef(s.ControlPlane, infrav1.GroupVersion.WithKind(infrav1.AzureManagedControlPlaneKind)),
},
}
}
Expand Down Expand Up @@ -655,7 +655,7 @@ func (s *ManagedControlPlaneScope) MakeEmptyKubeConfigSecret() corev1.Secret {
Name: secret.Name(s.Cluster.Name, secret.Kubeconfig),
Namespace: s.Cluster.Namespace,
OwnerReferences: []metav1.OwnerReference{
*metav1.NewControllerRef(s.ControlPlane, infrav1.GroupVersion.WithKind("AzureManagedControlPlane")),
*metav1.NewControllerRef(s.ControlPlane, infrav1.GroupVersion.WithKind(infrav1.AzureManagedControlPlaneKind)),
},
Labels: map[string]string{clusterv1.ClusterNameLabel: s.Cluster.Name},
},
Expand Down
4 changes: 2 additions & 2 deletions controllers/asosecret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (asos *ASOSecretReconciler) SetupWithManager(ctx context.Context, mgr ctrl.
// Add a watch on clusterv1.Cluster object for unpause notifications.
if err = c.Watch(
source.Kind(mgr.GetCache(), &clusterv1.Cluster{}),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureCluster"), mgr.GetClient(), &infrav1.AzureCluster{})),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind(infrav1.AzureClusterKind), mgr.GetClient(), &infrav1.AzureCluster{})),
predicates.ClusterUnpaused(log),
predicates.ResourceNotPausedAndHasFilterLabel(log, asos.WatchFilterValue),
); err != nil {
Expand All @@ -112,7 +112,7 @@ func (asos *ASOSecretReconciler) Reconcile(ctx context.Context, req ctrl.Request
ctx, log, done := tele.StartSpanWithLogger(ctx, "controllers.ASOSecret.Reconcile",
tele.KVP("namespace", req.Namespace),
tele.KVP("name", req.Name),
tele.KVP("kind", "AzureCluster"),
tele.KVP("kind", infrav1.AzureClusterKind),
)
defer done()

Expand Down
4 changes: 2 additions & 2 deletions controllers/azurecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (acr *AzureClusterReconciler) SetupWithManager(ctx context.Context, mgr ctr
// Add a watch on clusterv1.Cluster object for pause/unpause notifications.
if err = c.Watch(
source.Kind(mgr.GetCache(), &clusterv1.Cluster{}),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureCluster"), mgr.GetClient(), &infrav1.AzureCluster{})),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind(infrav1.AzureClusterKind), mgr.GetClient(), &infrav1.AzureCluster{})),
ClusterUpdatePauseChange(log),
predicates.ResourceHasFilterLabel(log, acr.WatchFilterValue),
); err != nil {
Expand Down Expand Up @@ -126,7 +126,7 @@ func (acr *AzureClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reque
"controllers.AzureClusterReconciler.Reconcile",
tele.KVP("namespace", req.Namespace),
tele.KVP("name", req.Name),
tele.KVP("kind", "AzureCluster"),
tele.KVP("kind", infrav1.AzureClusterKind),
)
defer done()

Expand Down
4 changes: 2 additions & 2 deletions controllers/azureidentity_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (r *AzureIdentityReconciler) SetupWithManager(ctx context.Context, mgr ctrl
// Add a watch on clusterv1.Cluster object for unpause notifications.
if err = c.Watch(
source.Kind(mgr.GetCache(), &clusterv1.Cluster{}),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureCluster"), mgr.GetClient(), &infrav1.AzureCluster{})),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind(infrav1.AzureClusterKind), mgr.GetClient(), &infrav1.AzureCluster{})),
predicates.ClusterUnpaused(log),
predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue),
); err != nil {
Expand All @@ -107,7 +107,7 @@ func (r *AzureIdentityReconciler) Reconcile(ctx context.Context, req ctrl.Reques
ctx, log, done := tele.StartSpanWithLogger(ctx, "controllers.AzureIdentityReconciler.Reconcile",
tele.KVP("namespace", req.Namespace),
tele.KVP("name", req.Name),
tele.KVP("kind", "AzureCluster"),
tele.KVP("kind", infrav1.AzureClusterKind),
)
defer done()

Expand Down
2 changes: 1 addition & 1 deletion controllers/azurejson_machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (r *AzureJSONMachineReconciler) Reconcile(ctx context.Context, req ctrl.Req
return ctrl.Result{}, nil
}

_, kind := infrav1.GroupVersion.WithKind("AzureCluster").ToAPIVersionAndKind()
_, kind := infrav1.GroupVersion.WithKind(infrav1.AzureClusterKind).ToAPIVersionAndKind()

// only look at azure clusters
if cluster.Spec.InfrastructureRef == nil {
Expand Down
2 changes: 1 addition & 1 deletion controllers/azurejson_machine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestAzureJSONMachineReconciler(t *testing.T) {
Spec: clusterv1.ClusterSpec{
InfrastructureRef: &corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "AzureCluster",
Kind: infrav1.AzureClusterKind,
Name: "my-azure-cluster",
},
},
Expand Down
6 changes: 3 additions & 3 deletions controllers/azurejson_machinepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (r *AzureJSONMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl
"controllers.AzureJSONMachinePoolReconciler.Reconcile",
tele.KVP("namespace", req.Namespace),
tele.KVP("name", req.Name),
tele.KVP("kind", "AzureMachinePool"),
tele.KVP("kind", infrav1.AzureMachinePoolKind),
)
defer done()

Expand Down Expand Up @@ -138,7 +138,7 @@ func (r *AzureJSONMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl

log = log.WithValues("cluster", cluster.Name)

_, kind := infrav1.GroupVersion.WithKind("AzureCluster").ToAPIVersionAndKind()
_, kind := infrav1.GroupVersion.WithKind(infrav1.AzureClusterKind).ToAPIVersionAndKind()

// only look at azure clusters
if cluster.Spec.InfrastructureRef == nil {
Expand Down Expand Up @@ -186,7 +186,7 @@ func (r *AzureJSONMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl
}
}

apiVersion, kind := infrav1.GroupVersion.WithKind("AzureMachinePool").ToAPIVersionAndKind()
apiVersion, kind := infrav1.GroupVersion.WithKind(infrav1.AzureMachinePoolKind).ToAPIVersionAndKind()
owner := metav1.OwnerReference{
APIVersion: apiVersion,
Kind: kind,
Expand Down
2 changes: 1 addition & 1 deletion controllers/azurejson_machinepool_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestAzureJSONPoolReconciler(t *testing.T) {
Spec: clusterv1.ClusterSpec{
InfrastructureRef: &corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "AzureCluster",
Kind: infrav1.AzureClusterKind,
Name: "my-azure-cluster",
},
},
Expand Down
2 changes: 1 addition & 1 deletion controllers/azurejson_machinetemplate_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (r *AzureJSONTemplateReconciler) Reconcile(ctx context.Context, req ctrl.Re
log.Info("infra ref is nil")
return ctrl.Result{}, nil
}
if cluster.Spec.InfrastructureRef.Kind != "AzureCluster" {
if cluster.Spec.InfrastructureRef.Kind != infrav1.AzureClusterKind {
log.WithValues("kind", cluster.Spec.InfrastructureRef.Kind).Info("infra ref was not an AzureCluster")
return ctrl.Result{}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/azurejson_machinetemplate_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestAzureJSONTemplateReconciler(t *testing.T) {
Spec: clusterv1.ClusterSpec{
InfrastructureRef: &corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "AzureCluster",
Kind: infrav1.AzureClusterKind,
Name: "my-azure-cluster",
},
},
Expand Down
2 changes: 1 addition & 1 deletion controllers/azuremachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ func getFakeCluster(changes ...func(*clusterv1.Cluster)) *clusterv1.Cluster {
Spec: clusterv1.ClusterSpec{
InfrastructureRef: &corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "AzureCluster",
Kind: infrav1.AzureClusterKind,
Name: "my-azure-cluster",
},
},
Expand Down
4 changes: 2 additions & 2 deletions controllers/azuremanagedcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (amcr *AzureManagedClusterReconciler) SetupWithManager(ctx context.Context,
// Add a watch on clusterv1.Cluster object for unpause notifications.
if err = c.Watch(
source.Kind(mgr.GetCache(), &clusterv1.Cluster{}),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureManagedCluster"), mgr.GetClient(), &infrav1.AzureManagedCluster{})),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind(infrav1.AzureManagedClusterKind), mgr.GetClient(), &infrav1.AzureManagedCluster{})),
predicates.ClusterUnpaused(log),
predicates.ResourceNotPausedAndHasFilterLabel(log, amcr.WatchFilterValue),
); err != nil {
Expand All @@ -109,7 +109,7 @@ func (amcr *AzureManagedClusterReconciler) Reconcile(ctx context.Context, req ct
"controllers.AzureManagedClusterReconciler.Reconcile",
tele.KVP("namespace", req.Namespace),
tele.KVP("name", req.Name),
tele.KVP("kind", "AzureManagedCluster"),
tele.KVP("kind", infrav1.AzureManagedClusterKind),
)
defer done()

Expand Down
Loading