Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennenMM7 committed Feb 22, 2023
1 parent 68f3dc8 commit 58322d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion azure/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
4 changes: 2 additions & 2 deletions azure/scope/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}

Expand Down

0 comments on commit 58322d2

Please sign in to comment.