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 (
25
25
corev1 "k8s.io/api/core/v1"
26
26
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
27
27
"k8s.io/apimachinery/pkg/types"
28
+ "k8s.io/apimachinery/pkg/util/validation"
28
29
"k8s.io/utils/ptr"
29
30
infrav1alpha "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha1"
30
31
"sigs.k8s.io/cluster-api-provider-azure/pkg/mutators"
@@ -285,6 +286,12 @@ func (r *AzureASOManagedMachinePoolReconciler) reconcileNormal(ctx context.Conte
285
286
}
286
287
287
288
func 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
+ }
288
295
return map [string ]string {
289
296
"kubernetes.azure.com/agentpool" : poolName ,
290
297
"kubernetes.azure.com/cluster" : nodeRG ,
You can’t perform that action at this time.
0 commit comments