Skip to content

Commit 79f3d72

Browse files
authored
eks/mng: fix MNG desired capacity (#170)
* eks/mng: fix MNG desired capacity Signed-off-by: Gyuho Lee <leegyuho@amazon.com> * vendor: update AWS SDK Go, update CHANGELOG Signed-off-by: Gyuho Lee <leegyuho@amazon.com> * eksconfig: update versions Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
1 parent 99e72c3 commit 79f3d72

File tree

11 files changed

+1431
-325
lines changed

11 files changed

+1431
-325
lines changed

CHANGELOG/CHANGELOG-1.5.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33
<hr>
44

55

6+
## [v1.5.2](https://github.com/aws/aws-k8s-tester/releases/tag/v1.5.2) (2020-09-12)
7+
8+
See [code changes](https://github.com/aws/aws-k8s-tester/compare/v1.5.1...v1.5.2).
9+
10+
### `eks`
11+
12+
- Fix [`eks/mng` `desiredSize` parameter in CloudFormation](https://github.com/aws/aws-k8s-tester/pull/170).
13+
14+
### Dependency
15+
16+
- Upgrade [`github.com/aws/aws-sdk-go`](https://github.com/aws/aws-sdk-go/releases) from [`v1.34.20`](https://github.com/aws/aws-sdk-go/releases/tag/v1.34.20) to [`v1.34.22`](https://github.com/aws/aws-sdk-go/releases/tag/v1.34.22).
17+
18+
### Go
19+
20+
- Compile with [*Go 1.15.2*](https://golang.org/doc/devel/release.html#go1.15).
21+
22+
23+
24+
<hr>
25+
26+
27+
28+
629
## [v1.5.1](https://github.com/aws/aws-k8s-tester/releases/tag/v1.5.1) (2020-09-10)
730

831
See [code changes](https://github.com/aws/aws-k8s-tester/compare/v1.5.0...v1.5.1).
@@ -13,7 +36,7 @@ See [code changes](https://github.com/aws/aws-k8s-tester/compare/v1.5.0...v1.5.1
1336

1437
### Dependency
1538

16-
- Upgrade [`github.com/aws/aws-sdk-go`](https://github.com/aws/aws-sdk-go/releases) from [`v1.34.20`](https://github.com/aws/aws-sdk-go/releases/tag/v1.34.20) to [`v1.34.20`](https://github.com/aws/aws-sdk-go/releases/tag/v1.34.20).
39+
- Upgrade [`github.com/aws/aws-sdk-go`](https://github.com/aws/aws-sdk-go/releases) from [`v1.34.18`](https://github.com/aws/aws-sdk-go/releases/tag/v1.34.18) to [`v1.34.20`](https://github.com/aws/aws-sdk-go/releases/tag/v1.34.20).
1740

1841
### Go
1942

eks/mng/nodes.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,28 @@ func (ts *tester) createASGs() (err error) {
290290

291291
tg := templateMNG{}
292292
if cur.ReleaseVersion != "" {
293+
ts.cfg.Logger.Info("adding release version parameter",
294+
zap.String("mng-name", mngName),
295+
zap.String("release-version", cur.ReleaseVersion),
296+
)
293297
tg.ParameterReleaseVersion = parametersReleaseVersion
294298
tg.PropertyReleaseVersion = propertyReleaseVersion
295299
stackInput.Parameters = append(stackInput.Parameters, &cloudformation.Parameter{
296300
ParameterKey: aws.String("ReleaseVersion"),
297301
ParameterValue: aws.String(cur.ReleaseVersion),
298302
})
299303
}
304+
if cur.ASGDesiredCapacity > 0 {
305+
ts.cfg.Logger.Info("adding desired capacity parameter",
306+
zap.String("mng-name", mngName),
307+
zap.Int("desired-capacity", cur.ASGDesiredCapacity),
308+
)
309+
tg.ASGDesiredCapacity = int64(cur.ASGDesiredCapacity)
310+
stackInput.Parameters = append(stackInput.Parameters, &cloudformation.Parameter{
311+
ParameterKey: aws.String("ASGDesiredCapacity"),
312+
ParameterValue: aws.String(fmt.Sprintf("%d", cur.ASGDesiredCapacity)),
313+
})
314+
}
300315
tpl := template.Must(template.New("TemplateMNG").Parse(TemplateMNG))
301316
buf := bytes.NewBuffer(nil)
302317
if err := tpl.Execute(buf, tg); err != nil {
@@ -339,13 +354,6 @@ func (ts *tester) createASGs() (err error) {
339354
ParameterValue: aws.String(fmt.Sprintf("%d", cur.ASGMaxSize)),
340355
})
341356
}
342-
if cur.ASGDesiredCapacity > 0 {
343-
tg.ASGDesiredCapacity = int64(cur.ASGDesiredCapacity)
344-
stackInput.Parameters = append(stackInput.Parameters, &cloudformation.Parameter{
345-
ParameterKey: aws.String("ASGDesiredCapacity"),
346-
ParameterValue: aws.String(fmt.Sprintf("%d", cur.ASGDesiredCapacity)),
347-
})
348-
}
349357
if len(cur.InstanceTypes) > 0 {
350358
stackInput.Parameters = append(stackInput.Parameters, &cloudformation.Parameter{
351359
ParameterKey: aws.String("InstanceTypes"),

eksconfig/add-on-cluster-loader-local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func getDefaultAddOnClusterLoaderLocal() *AddOnClusterLoaderLocal {
125125
Enable: false,
126126

127127
ClusterLoaderPath: "/tmp/clusterloader2",
128-
ClusterLoaderDownloadURL: "https://github.com/aws/aws-k8s-tester/releases/download/v1.5.1/clusterloader2-linux-amd64",
128+
ClusterLoaderDownloadURL: "https://github.com/aws/aws-k8s-tester/releases/download/v1.5.2/clusterloader2-linux-amd64",
129129

130130
Runs: 2,
131131
Timeout: 30 * time.Minute,

eksconfig/add-on-cluster-loader-remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func getDefaultAddOnClusterLoaderRemote() *AddOnClusterLoaderRemote {
134134
Enable: false,
135135

136136
ClusterLoaderPath: "/tmp/clusterloader2",
137-
ClusterLoaderDownloadURL: "https://github.com/aws/aws-k8s-tester/releases/download/v1.5.1/clusterloader2-linux-amd64",
137+
ClusterLoaderDownloadURL: "https://github.com/aws/aws-k8s-tester/releases/download/v1.5.2/clusterloader2-linux-amd64",
138138

139139
Runs: 2,
140140
Timeout: 30 * time.Minute,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ replace (
4343
)
4444

4545
require (
46-
github.com/aws/aws-sdk-go v1.34.20
46+
github.com/aws/aws-sdk-go v1.34.22
4747
github.com/briandowns/spinner v1.11.1
4848
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575
4949
github.com/davecgh/go-spew v1.1.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7/go.mod h1:
102102
github.com/aws/aws-sdk-go v1.6.10/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k=
103103
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
104104
github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
105-
github.com/aws/aws-sdk-go v1.34.20 h1:D9otznteZZyN5pRyFETqveYia/85Xzk7+RaPGB1I9fE=
106-
github.com/aws/aws-sdk-go v1.34.20/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
105+
github.com/aws/aws-sdk-go v1.34.22 h1:7V2sKilVVgHqdjbW+O/xaVWYfnmuLwZdF/+6JuUh6Cw=
106+
github.com/aws/aws-sdk-go v1.34.22/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
107107
github.com/bazelbuild/bazel-gazelle v0.18.2/go.mod h1:D0ehMSbS+vesFsLGiD6JXu3mVEzOlfUl8wNnq+x/9p0=
108108
github.com/bazelbuild/bazel-gazelle v0.19.1-0.20191105222053-70208cbdc798/go.mod h1:rPwzNHUqEzngx1iVBfO/2X2npKaT3tqPqqHW6rVsn/A=
109109
github.com/bazelbuild/buildtools v0.0.0-20190731111112-f720930ceb60/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU=

vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/aws/aws-sdk-go/aws/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)