Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Add zoned property to azure spec (#73)
Browse files Browse the repository at this point in the history
Signed-off-by: Borja Clemente <[email protected]>
  • Loading branch information
clebs authored Apr 7, 2020
1 parent 6a475a0 commit d94a8db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions expand/expand_azure_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package expand

import (
"encoding/json"
"strconv"

azAlpha1 "github.com/gardener/gardener-extension-provider-azure/pkg/apis/azure/v1alpha1"
corev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
"github.com/hashicorp/terraform/helper/schema"
Expand Down Expand Up @@ -29,6 +31,9 @@ func azureConfig(az []interface{}) *corev1beta1.ProviderConfig {
if v, ok := in["networks"].([]interface{}); ok && len(v) > 0 {
azConfigObj.Networks = azNetworks(v)
}
if v, ok := in["zoned"].(string); ok {
azConfigObj.Zoned, _ = strconv.ParseBool(v) // we ignore the error because it will already set "zoned" to false, which is the default.
}
obj.Raw, _ = json.Marshal(azConfigObj)
return &obj
}
Expand Down
5 changes: 5 additions & 0 deletions shoot/schema_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import (
func azureResource() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"zoned": {
Type: schema.TypeString,
Description: "Boolean telling if the cluster has availability zones",
Optional: true,
},
"networks": {
Type: schema.TypeList,
Description: "Networks is the network configuration (VNet, subnets, etc.).",
Expand Down

0 comments on commit d94a8db

Please sign in to comment.