Skip to content

Commit

Permalink
Add support for Azure platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishchay Kumar committed Apr 4, 2019
1 parent c1ba218 commit 9d99eec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/template/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
unitsDir = "units"

platformAWS = "aws"
platformAzure = "azure"
platformOpenstack = "openstack"
platformLibvirt = "libvirt"
platformNone = "none"
Expand Down Expand Up @@ -119,7 +120,7 @@ func platformFromControllerConfigSpec(ic *mcfgv1.ControllerConfigSpec) (string,
return "", fmt.Errorf("cannot generateMachineConfigs with an empty platform field")
case platformBase:
return "", fmt.Errorf("platform _base unsupported")
case platformAWS, platformOpenstack, platformLibvirt, platformNone:
case platformAWS, platformAzure, platformOpenstack, platformLibvirt, platformNone:
// TODO: these constants are wrong, they should match what is reported by the infrastructure provider
return ic.Platform, nil
default:
Expand Down Expand Up @@ -348,6 +349,8 @@ func cloudProvider(cfg RenderConfig) (interface{}, error) {
switch cfg.Platform {
case platformAWS:
return platformAWS, nil
case platformAzure:
return platformAzure, nil
case platformOpenstack:
return platformOpenstack, nil
case platformVSphere:
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func createDiscoveredControllerConfigSpec(infra *configv1.Infrastructure, networ
switch infra.Status.Platform {
case configv1.AWSPlatform:
platform = "aws"
case configv1.AzurePlatform:
platform = "azure"
case configv1.OpenStackPlatform:
platform = "openstack"
case configv1.LibvirtPlatform:
Expand Down

0 comments on commit 9d99eec

Please sign in to comment.