File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
2525 corev1 "k8s.io/api/core/v1"
2626 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2727 "k8s.io/apimachinery/pkg/types"
28+ "k8s.io/apimachinery/pkg/util/validation"
2829 "k8s.io/utils/ptr"
2930 infrav1alpha "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha1"
3031 "sigs.k8s.io/cluster-api-provider-azure/pkg/mutators"
@@ -285,6 +286,12 @@ func (r *AzureASOManagedMachinePoolReconciler) reconcileNormal(ctx context.Conte
285286}
286287
287288func expectedNodeLabels (poolName , nodeRG string ) map [string ]string {
289+ if len (poolName ) > validation .LabelValueMaxLength {
290+ poolName = poolName [:validation .LabelValueMaxLength ]
291+ }
292+ if len (nodeRG ) > validation .LabelValueMaxLength {
293+ nodeRG = nodeRG [:validation .LabelValueMaxLength ]
294+ }
288295 return map [string ]string {
289296 "kubernetes.azure.com/agentpool" : poolName ,
290297 "kubernetes.azure.com/cluster" : nodeRG ,
You can’t perform that action at this time.
0 commit comments