From 58322d28ff649df795c8d34d513fbf34ddb58030 Mon Sep 17 00:00:00 2001 From: bmurray Date: Wed, 22 Feb 2023 15:08:39 -0800 Subject: [PATCH] . --- azure/const.go | 6 +++++- azure/scope/machinepool.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/azure/const.go b/azure/const.go index 61eb35813b0..ff655a4c5d7 100644 --- a/azure/const.go +++ b/azure/const.go @@ -29,5 +29,9 @@ const ( // for annotation formatting rules. RGTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-rg" - CustomDataHash = "sigs.k8s.io/cluster-api-provider-azure-vmss-custom-data-hash" + // CustomDataHashAnnotation is the key for the machine object annotation + // which tracks the hash of the custom data. + // See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + // for annotation formatting rules. + CustomDataHashAnnotation = "sigs.k8s.io/cluster-api-provider-azure-vmss-custom-data-hash" ) diff --git a/azure/scope/machinepool.go b/azure/scope/machinepool.go index a60b74c3b99..94910a17cfe 100644 --- a/azure/scope/machinepool.go +++ b/azure/scope/machinepool.go @@ -597,7 +597,7 @@ func (m *MachinePoolScope) HasBootstrapDataChanges(ctx context.Context) (bool, e if err != nil { return false, err } - return m.AzureMachinePool.GetAnnotations()[azure.CustomDataHash] != newHash, nil + return m.AzureMachinePool.GetAnnotations()[azure.CustomDataHashAnnotation] != newHash, nil } // updateCustomDataHash calculates the sha256 hash of the bootstrap data and saves it in AzureMachinePool.Status. @@ -606,7 +606,7 @@ func (m *MachinePoolScope) updateCustomDataHash(ctx context.Context) error { if err != nil { return err } - m.SetAnnotation(azure.CustomDataHash, newHash) + m.SetAnnotation(azure.CustomDataHashAnnotation, newHash) return nil }