Skip to content

Commit

Permalink
chore: Update drift reason (#4451)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Aug 17, 2023
1 parent f8b542b commit f859357
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/cloudprovider/drift.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
)

const (
AMIDrift cloudprovider.DriftReason = "AMIDrift"
SubnetDrift cloudprovider.DriftReason = "SubnetDrift"
SecurityGroupDrift cloudprovider.DriftReason = "SecurityGroupDrift"
NodeTemplateStaticDrift cloudprovider.DriftReason = "NodeTemplateStaticDrift"
AMIDrift cloudprovider.DriftReason = "AMIDrift"
SubnetDrift cloudprovider.DriftReason = "SubnetDrift"
SecurityGroupDrift cloudprovider.DriftReason = "SecurityGroupDrift"
NodeTemplateDrift cloudprovider.DriftReason = "NodeTemplateDrift"
)

func (c *CloudProvider) isNodeTemplateDrifted(ctx context.Context, machine *v1alpha5.Machine, provisioner *v1alpha5.Provisioner, nodeTemplate *v1alpha1.AWSNodeTemplate) (cloudprovider.DriftReason, error) {
Expand Down Expand Up @@ -132,7 +132,7 @@ func (c *CloudProvider) areStaticFieldsDrifted(machine *v1alpha5.Machine, nodeTe
return ""
}
if nodeTemplateHash != machineHash {
return NodeTemplateStaticDrift
return NodeTemplateDrift
}
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudprovider/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ var _ = Describe("CloudProvider", func() {
ExpectApplied(ctx, env.Client, updatedAWSNodeTemplate)
isDrifted, err = cloudProvider.IsMachineDrifted(ctx, machine)
Expect(err).NotTo(HaveOccurred())
Expect(isDrifted).To(Equal(cloudprovider.NodeTemplateStaticDrift))
Expect(isDrifted).To(Equal(cloudprovider.NodeTemplateDrift))
},
Entry("InstanceProfile Drift", v1alpha1.AWSNodeTemplateSpec{AWS: v1alpha1.AWS{InstanceProfile: aws.String("profile-2")}}),
Entry("UserData Drift", v1alpha1.AWSNodeTemplateSpec{UserData: aws.String("userdata-test-2")}),
Expand Down

0 comments on commit f859357

Please sign in to comment.