-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make initial size or autoscaling policy required on creation time, no…
…degroup mutable, update tests
- Loading branch information
1 parent
14abe60
commit c390e14
Showing
3 changed files
with
100 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
mmv1/templates/terraform/pre_create/compute_node_group_url_replace.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
var sizeParam string | ||
if v, ok := d.GetOkExists("size"); ok { | ||
sizeParam = fmt.Sprintf("%v", v) | ||
} else if v, ok := d.GetOkExists("initial_size"); ok { | ||
if v, ok := d.GetOkExists("initial_size"); ok { | ||
sizeParam = fmt.Sprintf("%v", v) | ||
}else{ | ||
if _, ok := d.GetOkExists("autoscaling_policy"); ok{ | ||
sizeParam = fmt.Sprintf("%v", d.Get("autoscaling_policy.min_nodes")) | ||
}else{ | ||
return errors.New("An initial_size or autoscaling_policy must be configured on node group creation.") | ||
} | ||
} | ||
|
||
url = regexp.MustCompile("PRE_CREATE_REPLACE_ME").ReplaceAllLiteralString(url, sizeParam) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters