Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update machine-controller to v1.15.1 and add the imagePlan field for Azure #947

Merged
merged 2 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/templates/machinecontroller/cloudprovider_specs.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type AzureSpec struct {
RouteTableName string `json:"routeTableName"`
SecurityGroupName string `json:"securityGroupName"`
Zones []string `json:"zones"`
ImagePlan *AzureImagePlan `json:"imagePlan"`
SubnetName string `json:"subnetName"`
Tags map[string]string `json:"tags"`
VMSize string `json:"vmSize"`
Expand All @@ -129,3 +130,9 @@ type AzureSpec struct {
OSDiskSize int `json:"osDiskSize"`
DataDiskSize int `json:"dataDiskSize"`
}

type AzureImagePlan struct {
Name string `json:"name,omitempty"`
Publisher string `json:"publisher,omitempty"`
Product string `json:"product,omitempty"`
}
2 changes: 1 addition & 1 deletion pkg/templates/machinecontroller/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
MachineControllerNamespace = metav1.NamespaceSystem
MachineControllerAppLabelKey = "app"
MachineControllerAppLabelValue = "machine-controller"
MachineControllerTag = "v1.14.3"
MachineControllerTag = "v1.15.1"
)

// Deploy deploys MachineController deployment with RBAC on the cluster
Expand Down
6 changes: 6 additions & 0 deletions pkg/terraform/v1beta1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ func (c *Config) updateAzureWorkerset(existingWorkerSet *kubeonev1beta1.DynamicW
{key: "routeTableName", value: azureCloudConfig.RouteTableName},
{key: "securityGroupName", value: azureCloudConfig.SecurityGroupName},
{key: "zones", value: azureCloudConfig.Zones},
{key: "imagePlan", value: azureCloudConfig.ImagePlan},
{key: "subnetName", value: azureCloudConfig.SubnetName},
{key: "tags", value: azureCloudConfig.Tags},
{key: "vmSize", value: azureCloudConfig.VMSize},
Expand Down Expand Up @@ -495,6 +496,11 @@ func setWorkersetFlag(w *kubeonev1beta1.DynamicWorkerConfig, name string, value
if s == nil {
return nil
}
case machinecontroller.AzureImagePlan:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not needed because we use the pointer type, but I added it anyway because I can't test is it going to work without it.

case *machinecontroller.AzureImagePlan:
if s == nil {
return nil
}
default:
return errors.New("unsupported type")
}
Expand Down