Skip to content

Commit

Permalink
added PodSubnetIDs and VnetSubnetIDs fields (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra1-n authored Oct 12, 2023
1 parent 6811f23 commit cb57028
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
3 changes: 3 additions & 0 deletions examples/service/ocean/providers/azure_np/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func main() {
GracePeriod: spotinst.Int(600),
},
VirtualNodeGroupTemplate: &azure_np.VirtualNodeGroupTemplate{
AvailabilityZones: []string{"1", "2"},
NodePoolProperties: &azure_np.NodePoolProperties{
MaxPodsPerNode: spotinst.Int(110),
EnableNodePublicIP: spotinst.Bool(false),
Expand All @@ -76,6 +77,8 @@ func main() {
OsType: spotinst.String("Windows"),
OsSKU: spotinst.String("Windows2019"),
KubernetesVersion: spotinst.String("1.26"),
PodSubnetIDs: []string{"/subscriptions/123456-1234-1234-1234-123456789/resourceGroups/ExampleResourceGroup/providers/Microsoft.Network/virtualNetworks/ExampleVirtualNetwork/subnets/default"},
VnetSubnetIDs: []string{"/subscriptions/123456-1234-1234-1234-123456789/resourceGroups/ExampleResourceGroup/providers/Microsoft.Network/virtualNetworks/ExampleVirtualNetwork/subnets/default"},
},
NodeCountLimits: &azure_np.NodeCountLimits{
MinCount: spotinst.Int(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ func main() {
OsType: spotinst.String("Windows"),
OsSKU: spotinst.String("Windows2022"),
KubernetesVersion: spotinst.String("1.26"),
PodSubnetIDs: []string{"/subscriptions/123456-1234-1234-1234-123456789/resourceGroups/ExampleResourceGroup/providers/Microsoft.Network/virtualNetworks/ExampleVirtualNetwork/subnets/default"},
VnetSubnetIDs: []string{"/subscriptions/123456-1234-1234-1234-123456789/resourceGroups/ExampleResourceGroup/providers/Microsoft.Network/virtualNetworks/ExampleVirtualNetwork/subnets/default"},
},
NodeCountLimits: &azure_np.NodeCountLimits{
MinCount: spotinst.Int(0),
Expand Down
30 changes: 23 additions & 7 deletions service/ocean/providers/azure_np/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import "github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil"

// NodePoolProperties region
type NodePoolProperties struct {
MaxPodsPerNode *int `json:"maxPodsPerNode,omitempty"`
EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"`
OsDiskSizeGB *int `json:"osDiskSizeGB,omitempty"`
OsDiskType *string `json:"osDiskType,omitempty"`
OsType *string `json:"osType,omitempty"`
OsSKU *string `json:"osSKU,omitempty"`
KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
MaxPodsPerNode *int `json:"maxPodsPerNode,omitempty"`
EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"`
OsDiskSizeGB *int `json:"osDiskSizeGB,omitempty"`
OsDiskType *string `json:"osDiskType,omitempty"`
OsType *string `json:"osType,omitempty"`
OsSKU *string `json:"osSKU,omitempty"`
KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
PodSubnetIDs []string `json:"podSubnetIDs,omitempty"`
VnetSubnetIDs []string `json:"vnetSubnetIDs,omitempty"`

forceSendFields []string
nullFields []string
Expand Down Expand Up @@ -71,6 +73,20 @@ func (o *NodePoolProperties) SetKubernetesVersion(v *string) *NodePoolProperties
return o
}

func (o *NodePoolProperties) SetPodSubnetIDs(v []string) *NodePoolProperties {
if o.PodSubnetIDs = v; o.PodSubnetIDs == nil {
o.nullFields = append(o.nullFields, "PodSubnetIDs")
}
return o
}

func (o *NodePoolProperties) SetVnetSubnetIDs(v []string) *NodePoolProperties {
if o.VnetSubnetIDs = v; o.VnetSubnetIDs == nil {
o.nullFields = append(o.nullFields, "VnetSubnetIDs")
}
return o
}

// endregion

// NodeCountLimits region
Expand Down

0 comments on commit cb57028

Please sign in to comment.