Skip to content

Commit

Permalink
Forming well named const
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennenMM7 committed Feb 22, 2023
1 parent f0d7bf0 commit 68f3dc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions azure/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ const (
// See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
// 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"
)
9 changes: 3 additions & 6 deletions azure/scope/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ import (
// ScalesetsServiceName is the name of the scalesets service.
// TODO: move this to scalesets.go once we remove the usage in this package,
// added here to avoid a circular dependency.
const (
ScalesetsServiceName = "scalesets"
CustomDataHash = "CustomDataHash"
)
const ScalesetsServiceName = "scalesets"

type (
// MachinePoolScopeParams defines the input parameters used to create a new MachinePoolScope.
Expand Down Expand Up @@ -600,7 +597,7 @@ func (m *MachinePoolScope) HasBootstrapDataChanges(ctx context.Context) (bool, e
if err != nil {
return false, err
}
return m.AzureMachinePool.GetAnnotations()[CustomDataHash] != newHash, nil
return m.AzureMachinePool.GetAnnotations()[azure.CustomDataHash] != newHash, nil
}

// updateCustomDataHash calculates the sha256 hash of the bootstrap data and saves it in AzureMachinePool.Status.
Expand All @@ -609,7 +606,7 @@ func (m *MachinePoolScope) updateCustomDataHash(ctx context.Context) error {
if err != nil {
return err
}
m.SetAnnotation(CustomDataHash, newHash)
m.SetAnnotation(azure.CustomDataHash, newHash)
return nil
}

Expand Down

0 comments on commit 68f3dc8

Please sign in to comment.