-
Notifications
You must be signed in to change notification settings - Fork 393
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
Support for spot instances on Azure #571
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,9 @@ func resourceClusterSchema() map[string]*schema.Schema { | |
Optional: true, | ||
Computed: true, | ||
} | ||
s["aws_attributes"].ConflictsWith = []string{"azure_attributes", "gcp_attributes"} | ||
s["azure_attributes"].ConflictsWith = []string{"aws_attributes", "gcp_attributes"} | ||
s["gcp_attributes"].ConflictsWith = []string{"aws_attributes", "azure_attributes"} | ||
s["is_pinned"] = &schema.Schema{ | ||
Type: schema.TypeBool, | ||
Optional: true, | ||
|
@@ -321,6 +324,12 @@ func modifyClusterRequest(clusterModel *Cluster) { | |
} | ||
clusterModel.AwsAttributes = &awsAttributes | ||
} | ||
if clusterModel.AzureAttributes != nil { | ||
clusterModel.AzureAttributes = nil | ||
} | ||
if clusterModel.GcpAttributes != nil { | ||
clusterModel.GcpAttributes = nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can we add a unit test here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let me add it... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
} | ||
clusterModel.EnableElasticDisk = false | ||
clusterModel.NodeTypeID = "" | ||
clusterModel.DriverNodeTypeID = "" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,8 @@ func ResourceInstancePool() *schema.Resource { | |
s["custom_tags"].ForceNew = true | ||
s["enable_elastic_disk"].ForceNew = true | ||
s["enable_elastic_disk"].Default = true | ||
s["aws_attributes"].ConflictsWith = []string{"azure_attributes"} | ||
s["azure_attributes"].ConflictsWith = []string{"aws_attributes"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no gcp attributes for instance pools? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no instance pools support yet, so I can't test it - will add later |
||
// TODO: check if it's really force new... | ||
if v, err := common.SchemaPath(s, "aws_attributes", "availability"); err == nil { | ||
v.ForceNew = true | ||
|
@@ -71,6 +73,12 @@ func ResourceInstancePool() *schema.Resource { | |
if v, err := common.SchemaPath(s, "aws_attributes", "spot_bid_price_percent"); err == nil { | ||
v.ForceNew = true | ||
} | ||
if v, err := common.SchemaPath(s, "azure_attributes", "availability"); err == nil { | ||
v.ForceNew = true | ||
} | ||
if v, err := common.SchemaPath(s, "azure_attributes", "spot_bid_max_price"); err == nil { | ||
v.ForceNew = true | ||
} | ||
if v, err := common.SchemaPath(s, "disk_spec", "disk_type", "azure_disk_volume_type"); err == nil { | ||
v.ForceNew = true | ||
// nolint | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we add a unit test here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But does it make sense to nil the field if it's not nil?..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all Azure attributes now are related to the Spot instances only, and if we're using instance pools, then we shouldn't override instance types?