Skip to content

Commit

Permalink
Rename AzureMachinePool template type to AzureMachinePoolMachineTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed May 26, 2021
1 parent 130c336 commit ceb3a5d
Show file tree
Hide file tree
Showing 12 changed files with 183 additions and 562 deletions.
2 changes: 1 addition & 1 deletion azure/scope/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (m *MachinePoolScope) PatchObject(ctx context.Context) error {

// AzureMachineTemplate gets the Azure machine template in this scope.
func (m *MachinePoolScope) AzureMachineTemplate(ctx context.Context) (*infrav1.AzureMachineTemplate, error) {
ctx, span := tele.Tracer().Start(ctx, "scope.MachinePoolScope.AzureMachineTemplate")
ctx, span := tele.Tracer().Start(ctx, "scope.MachinePoolScope.AzureMachinePoolMachineTemplate")
defer span.End()

ref := m.MachinePool.Spec.Template.Spec.InfrastructureRef
Expand Down
2 changes: 1 addition & 1 deletion azure/scope/machinepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestMachinePoolScope_Name(t *testing.T) {
Name: "machine-90123456",
},
Spec: infrav1exp.AzureMachinePoolSpec{
Template: infrav1exp.AzureMachineTemplate{
Template: infrav1exp.AzureMachinePoolMachineTemplate{
OSDisk: infrav1.OSDisk{
OSType: "Windows",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
description: RoleAssignmentName is the name of the role assignment to create for a system assigned identity. It can be any valid GUID. If not specified, a random GUID will be generated.
type: string
template:
description: Template contains the details used to build a replica virtual machine within the Machine Pool
description: Template contains the details used to build a replica virtual machine within the Machine Pool.
properties:
acceleratedNetworking:
description: AcceleratedNetworking enables or disables Azure accelerated networking. If omitted, it will be set based on whether the requested VMSize supports accelerated networking. If AcceleratedNetworking is set to true with a VMSize that does not support it, Azure will return an error.
Expand Down

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions exp/api/v1alpha3/azuremachinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
)

type (
// AzureMachineTemplate defines the template for an AzureMachine.
AzureMachineTemplate struct {
// AzureMachinePoolMachineTemplate defines the template for an AzureMachinePool machine.
AzureMachinePoolMachineTemplate struct {
// VMSize is the size of the Virtual Machine to build.
// See https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/createorupdate#virtualmachinesizetypes
VMSize string `json:"vmSize"`
Expand Down Expand Up @@ -73,8 +73,8 @@ type (
// Location is the Azure region location e.g. westus2
Location string `json:"location"`

// Template contains the details used to build a replica virtual machine within the Machine Pool
Template AzureMachineTemplate `json:"template"`
// Template contains the details used to build a replica virtual machine within the Machine Pool.
Template AzureMachinePoolMachineTemplate `json:"template"`

// AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the
// Azure provider. If both the AzureCluster and the AzureMachine specify the same tag name with different values, the
Expand Down
136 changes: 68 additions & 68 deletions exp/api/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 48 additions & 48 deletions exp/api/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exp/api/v1alpha4/azuremachinepool_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func createMachinePoolWithSSHPublicKey(t *testing.T, sshPublicKey string) *Azure
func hardcodedAzureMachinePoolWithSSHKey(sshPublicKey string) *AzureMachinePool {
return &AzureMachinePool{
Spec: AzureMachinePoolSpec{
Template: AzureMachineTemplate{
Template: AzureMachinePoolMachineTemplate{
SSHPublicKey: sshPublicKey,
},
},
Expand Down
10 changes: 5 additions & 5 deletions exp/api/v1alpha4/azuremachinepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestAzureMachinePool_Validate(t *testing.T) {
Factory: func(_ *gomega.GomegaWithT) *exp.AzureMachinePool {
return &exp.AzureMachinePool{
Spec: exp.AzureMachinePoolSpec{
Template: exp.AzureMachineTemplate{
Template: exp.AzureMachinePoolMachineTemplate{
Image: &infrav1.Image{
SharedGallery: &infrav1.AzureSharedGalleryImage{
SubscriptionID: "foo",
Expand All @@ -69,7 +69,7 @@ func TestAzureMachinePool_Validate(t *testing.T) {
Factory: func(_ *gomega.GomegaWithT) *exp.AzureMachinePool {
return &exp.AzureMachinePool{
Spec: exp.AzureMachinePoolSpec{
Template: exp.AzureMachineTemplate{
Template: exp.AzureMachinePoolMachineTemplate{
Image: new(infrav1.Image),
},
},
Expand All @@ -85,7 +85,7 @@ func TestAzureMachinePool_Validate(t *testing.T) {
Factory: func(_ *gomega.GomegaWithT) *exp.AzureMachinePool {
return &exp.AzureMachinePool{
Spec: exp.AzureMachinePoolSpec{
Template: exp.AzureMachineTemplate{
Template: exp.AzureMachinePoolMachineTemplate{
TerminateNotificationTimeout: to.IntPtr(7),
},
},
Expand All @@ -100,7 +100,7 @@ func TestAzureMachinePool_Validate(t *testing.T) {
Factory: func(_ *gomega.GomegaWithT) *exp.AzureMachinePool {
return &exp.AzureMachinePool{
Spec: exp.AzureMachinePoolSpec{
Template: exp.AzureMachineTemplate{
Template: exp.AzureMachinePoolMachineTemplate{
TerminateNotificationTimeout: to.IntPtr(20),
},
},
Expand All @@ -116,7 +116,7 @@ func TestAzureMachinePool_Validate(t *testing.T) {
Factory: func(_ *gomega.GomegaWithT) *exp.AzureMachinePool {
return &exp.AzureMachinePool{
Spec: exp.AzureMachinePoolSpec{
Template: exp.AzureMachineTemplate{
Template: exp.AzureMachinePoolMachineTemplate{
TerminateNotificationTimeout: to.IntPtr(3),
},
},
Expand Down
Loading

0 comments on commit ceb3a5d

Please sign in to comment.