Skip to content

Commit

Permalink
Merge pull request #3468 from sedefsavas/1.24
Browse files Browse the repository at this point in the history
Bump Kubernetes to v1.24.0 and fix AWSMachinePool minsize
  • Loading branch information
k8s-ci-robot authored Jul 29, 2022
2 parents 8a9080a + b581910 commit d6dcb17
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 585 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ spec:
default: 1
description: MinSize defines the minimum size of the group.
format: int32
minimum: 1
minimum: 0
type: integer
mixedInstancesPolicy:
description: MixedInstancesPolicy describes how multiple instance
Expand Down
2 changes: 1 addition & 1 deletion exp/api/v1beta1/awsmachinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type AWSMachinePoolSpec struct {

// MinSize defines the minimum size of the group.
// +kubebuilder:default=1
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Minimum=0
MinSize int32 `json:"minSize"`

// MaxSize defines the maximum size of the group.
Expand Down
2 changes: 1 addition & 1 deletion exp/api/v1beta1/awsmanagedmachinepool_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (r *AWSManagedMachinePool) validateScaling() field.ErrorList {
max := r.Spec.Scaling.MaxSize
if min != nil {
if *min < 0 {
allErrs = append(allErrs, field.Invalid(minField, *min, "must be greater than zero"))
allErrs = append(allErrs, field.Invalid(minField, *min, "must be greater or equal zero"))
}
if max != nil && *max < *min {
allErrs = append(allErrs, field.Invalid(maxField, *max, fmt.Sprintf("must be greater than field %s", minField.String())))
Expand Down
13 changes: 13 additions & 0 deletions exp/api/v1beta1/awsmanagedmachinepool_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"

infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1"
utildefaulting "sigs.k8s.io/cluster-api/util/defaulting"
Expand Down Expand Up @@ -126,6 +127,18 @@ func TestAWSManagedMachinePool_ValidateCreate(t *testing.T) {
},
wantErr: true,
},
{
name: "minSize 0 is accepted",
pool: &AWSManagedMachinePool{
Spec: AWSManagedMachinePoolSpec{
EKSNodegroupName: "eks-node-group-3",
Scaling: &ManagedMachinePoolScaling{
MinSize: pointer.Int32(0),
},
},
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exp/controllers/awsmachinepool_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
Namespace: "default",
},
Spec: expinfrav1.AWSMachinePoolSpec{
MinSize: int32(1),
MinSize: int32(0),
MaxSize: int32(1),
},
}
Expand Down
24 changes: 15 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-aws

go 1.17

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.1.2
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.1.5

require (
github.com/alessio/shellescape v1.4.1
Expand Down Expand Up @@ -38,32 +38,34 @@ require (
k8s.io/klog/v2 v2.70.1
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
sigs.k8s.io/aws-iam-authenticator v0.5.9
sigs.k8s.io/cluster-api v1.1.2
sigs.k8s.io/cluster-api/test v1.1.2
sigs.k8s.io/cluster-api v1.1.5
sigs.k8s.io/cluster-api/test v1.1.5
sigs.k8s.io/controller-runtime v0.11.2
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/BurntSushi/toml v1.0.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/containerd v1.5.9 // indirect
github.com/coredns/caddy v1.1.0 // indirect
github.com/coredns/corefile-migration v1.0.14 // indirect
github.com/coredns/corefile-migration v1.0.17 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v20.10.12+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.16+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect
Expand All @@ -86,6 +88,7 @@ require (
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gosuri/uitable v0.0.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -98,8 +101,10 @@ require (
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -117,6 +122,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b // indirect
github.com/sanathkr/yaml v0.0.0-20170819201035-0056894fa522 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
Expand Down Expand Up @@ -145,6 +151,6 @@ require (
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/kubectl v0.23.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/kind v0.11.1 // indirect
sigs.k8s.io/kind v0.14.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
)
Loading

0 comments on commit d6dcb17

Please sign in to comment.