Skip to content

Commit

Permalink
Impl flatternASKConfig for os_disk_type
Browse files Browse the repository at this point in the history
  • Loading branch information
apasyniuk committed Dec 15, 2023
1 parent a179b42 commit 3c1707f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions castai/resource_node_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,29 @@ func flattenAKSConfig(config *sdk.NodeconfigV1AKSConfig) []map[string]interface{
m["max_pods_per_node"] = *config.MaxPodsPerNode
}

if v := config.MaxPodsPerNode; v != nil {
m["os_disk_type"] = fromAKSDiskType(config.OsDiskType)
}

return []map[string]interface{}{m}
}

func fromAKSDiskType(osDiskType *sdk.NodeconfigV1AKSConfigOsDiskType) string {
if osDiskType == nil {
return ""
}
switch *osDiskType {
case sdk.OSDISKTYPESTANDARD:
return "standard"
case sdk.OSDISKTYPESTANDARDSSD:
return "standard-ssd"
case sdk.OSDISKTYPEPREMIUMSSD:
return "premium-ssd"
default:
return ""
}
}

func toGKEConfig(obj map[string]interface{}) *sdk.NodeconfigV1GKEConfig {
if obj == nil {
return nil
Expand Down

0 comments on commit 3c1707f

Please sign in to comment.