Skip to content
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

[MM-51418] Added missing pieces in EKS provisioning #923

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a30e544
support nodegroup deletion
mirshahriar Apr 25, 2023
320525a
updated
mirshahriar Apr 25, 2023
45d477b
Used plural name
mirshahriar Apr 25, 2023
74653c3
Merge branch 'master' into MM-51736
mirshahriar Apr 25, 2023
28fe650
fixed comments
mirshahriar Apr 25, 2023
e83457a
Merge remote-tracking branch 'origin/MM-51736' into MM-51736
mirshahriar Apr 25, 2023
a18fe78
Merge branch 'master' into MM-51736
mirshahriar Apr 27, 2023
7b6bad8
Use VPC CNI as Networking
mirshahriar May 3, 2023
b4642b5
Merge branch 'master' into feat/vpc-cni
mirshahriar May 3, 2023
3df308b
removed calico cni manifest
mirshahriar May 3, 2023
880ca54
Merge remote-tracking branch 'origin/feat/vpc-cni' into feat/vpc-cni
mirshahriar May 3, 2023
5782aed
Remove -local from cluster name
mirshahriar May 4, 2023
2c6fb72
Set InstanceType in LaunchTemplate
mirshahriar May 4, 2023
5d8c6c7
Associate public IP address by LaunchTemplate
mirshahriar May 4, 2023
f67fff4
Merge branch 'feat/vpc-cni' into MM-51418
mirshahriar May 4, 2023
59f4b45
update
mirshahriar May 4, 2023
2960309
Merge branch 'master' into MM-51418
mirshahriar May 4, 2023
344523f
updated
mirshahriar May 4, 2023
3cb8ba2
Merge branch 'master' into MM-51418
mirshahriar May 4, 2023
58e8ad2
updated
mirshahriar May 4, 2023
13d0cf5
updated
mirshahriar May 5, 2023
92a4034
Merge branch 'MM-51736' into MM-51418
mirshahriar May 5, 2023
43d5013
updated
mirshahriar May 5, 2023
cb849a2
Merge branch 'master' into MM-51418
mirshahriar May 5, 2023
4cd4867
updated
mirshahriar May 8, 2023
a2b52e0
support nodegroup size customization
mirshahriar May 8, 2023
92f796e
Merge branch 'master' into MM-51418
mirshahriar May 9, 2023
4b4bdd4
updated
mirshahriar May 9, 2023
ac7cef9
add metrics for nodegroup tasks
mirshahriar May 9, 2023
fc7a6b0
updated error & log messages
mirshahriar May 9, 2023
f376ad7
updated
mirshahriar May 9, 2023
c1207d3
Merge branch 'master' into MM-51418
mirshahriar May 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 52 additions & 15 deletions clusterdictionary/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
package clusterdictionary

import (
"strconv"
"strings"

ec2Types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/gookit/goutil/arrutil"
"github.com/mattermost/mattermost-cloud/model"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -130,6 +135,41 @@ func ApplyToPatchClusterSizeRequest(size string, request *model.PatchClusterSize
return nil
}

func processCustomSize(size string) (string, int64, int64, error) {
if len(size) == 0 {
return "", 0, 0, nil
}

parts := strings.Split(size, ";")
ngType := ec2Types.InstanceType(parts[0])

if !arrutil.In[ec2Types.InstanceType](ngType, ngType.Values()) {
return "", 0, 0, errors.Errorf("%s is not a valid InstanceType", ngType)
}

minCount := 2
maxCount := 2

for _, part := range parts[1:] {
switch {
case strings.HasPrefix(part, "min="):
minCount, _ = strconv.Atoi(strings.TrimPrefix(part, "min="))
case strings.HasPrefix(part, "max="):
maxCount, _ = strconv.Atoi(strings.TrimPrefix(part, "max="))
}
}

if minCount < 1 {
minCount = 1
}

if minCount > maxCount {
maxCount = minCount
}

return string(ngType), int64(minCount), int64(maxCount), nil
}

// AddToCreateClusterRequest takes a map of size keywords and adds the corresponding
// values to a CreateClusterRequest.
func AddToCreateClusterRequest(sizes map[string]string, request *model.CreateClusterRequest) error {
Expand All @@ -142,17 +182,15 @@ func AddToCreateClusterRequest(sizes map[string]string, request *model.CreateClu
}

for ng, ngSize := range sizes {
if !IsValidClusterSize(ngSize) {
return errors.Errorf("%s is not a valid size", ngSize)
ngType, minCount, maxCount, err := processCustomSize(ngSize)
if err != nil {
return err
}

values := ValidSizes[ngSize]

request.AdditionalNodeGroups[ng] = model.NodeGroupMetadata{
// These values are used in EKS configuration, but not in kops.
InstanceType: values.NodeInstanceType,
MinCount: values.NodeMinCount,
MaxCount: values.NodeMaxCount,
InstanceType: ngType,
MinCount: minCount,
MaxCount: maxCount,
}
}

Expand All @@ -171,16 +209,15 @@ func AddToCreateNodegroupsRequest(sizes map[string]string, request *model.Create
}

for ng, ngSize := range sizes {
if !IsValidClusterSize(ngSize) {
return errors.Errorf("%s is not a valid size", ngSize)
ngType, minCount, maxCount, err := processCustomSize(ngSize)
if err != nil {
return err
}

values := ValidSizes[ngSize]

request.Nodegroups[ng] = model.NodeGroupMetadata{
InstanceType: values.NodeInstanceType,
MinCount: values.NodeMinCount,
MaxCount: values.NodeMaxCount,
InstanceType: ngType,
MinCount: minCount,
MaxCount: maxCount,
}
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func executeClusterCreateCmd(flags clusterCreateFlags) error {
continue
}
if _, f := flags.additionalNodegroups[ng]; !f {
return fmt.Errorf("nodegroup %s not provided as additional nodegroups", ng)
return fmt.Errorf("nodegroup %s not provided as an additional nodegroup", ng)
}
}

Expand All @@ -145,7 +145,7 @@ func executeClusterCreateCmd(flags clusterCreateFlags) error {
continue
}
if _, f := flags.additionalNodegroups[ng]; !f {
return fmt.Errorf("nodegroup %s not provided as additional nodegroups", ng)
return fmt.Errorf("nodegroup %s not provided as an additional nodegroup", ng)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/cloud/cluster_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (flags *createRequestOptions) addFlags(command *cobra.Command) {
command.Flags().StringVar(&flags.clusterRoleARN, "cluster-role-arn", "", "AWS role ARN for cluster.")
command.Flags().StringVar(&flags.nodeRoleARN, "node-role-arn", "", "AWS role ARN for node.")
command.Flags().BoolVar(&flags.useEKS, "eks", false, "Create EKS cluster.")
command.Flags().StringToStringVar(&flags.additionalNodegroups, "additional-nodegroups", nil, "Additional nodegroups to create. The key is the name of the nodegroup and the value is the size constant.")
command.Flags().StringToStringVar(&flags.additionalNodegroups, "additional-nodegroups", nil, "Additional nodegroups to create. Example: --additional-nodegroups ng1=t3.medium;min=1;max=3")
command.Flags().StringSliceVar(&flags.nodegroupsWithPublicSubnet, "nodegroups-with-public-subnet", nil, "Nodegroups to create with public subnet. The value is the name of the nodegroup.")
command.Flags().StringSliceVar(&flags.nodegroupsWithSecurityGroup, "nodegroups-with-sg", nil, "Nodegroups to create with dedicated security group. The value is the name of the nodegroup.")
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/cloud/nodegroup_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type clusterNodegroupsCreateFlags struct {

func (flags *clusterNodegroupsCreateFlags) addFlags(command *cobra.Command) {
command.Flags().StringVar(&flags.clusterID, "cluster", "", "The id of the cluster to be modified.")
command.Flags().StringToStringVar(&flags.nodegroups, "nodegroups", nil, "Additional nodegroups to create. The key is the name of the nodegroup and the value is the size constant.")
command.Flags().StringSliceVar(&flags.nodegroupsWithPublicSubnet, "nodegroups-with-public-subnet", nil, "Nodegroups to create with public subnet. The value is the name of the nodegroup.")
command.Flags().StringSliceVar(&flags.nodegroupsWithSecurityGroup, "nodegroups-with-sg", nil, "Nodegroups to create with dedicated security group. The value is the name of the nodegroup.")
command.Flags().StringToStringVar(&flags.nodegroups, "nodegroups", nil, "Additional nodegroups to create. Example: --nodegroups ng1=t3.medium;min=1;max=3")
command.Flags().StringSliceVar(&flags.nodegroupsWithPublicSubnet, "nodegroups-with-public-subnet", nil, "Nodegroups to create with public subnet. The value is the name of the nodegroups.")
command.Flags().StringSliceVar(&flags.nodegroupsWithSecurityGroup, "nodegroups-with-sg", nil, "Nodegroups to create with dedicated security group. The value is the name of the nodegroupa.")

_ = command.MarkFlagRequired("cluster")
_ = command.MarkFlagRequired("nodegroups")
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ require (
github.com/cloudflare/cloudflare-go v0.54.0
github.com/go-sql-driver/mysql v1.6.0
github.com/golang/mock v1.6.0
github.com/gookit/goutil v0.6.8
github.com/gorilla/mux v1.8.0
github.com/gosuri/uilive v0.0.4
github.com/jmoiron/sqlx v1.3.5
Expand All @@ -49,7 +50,7 @@ require (
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
github.com/vrischmann/envconfig v1.3.0
golang.org/x/tools v0.2.0
golang.org/x/tools v0.6.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.0
k8s.io/apiextensions-apiserver v0.23.0
Expand Down Expand Up @@ -130,12 +131,12 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/mod v0.6.0 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
29 changes: 17 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,9 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c
github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw=
github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gookit/color v1.5.3 h1:twfIhZs4QLCtimkP7MOxlF3A0U/5cDPseRT9M/+2SCE=
github.com/gookit/goutil v0.6.8 h1:B2XXSCGav5TXWtKRT9i/s/owOLXXB7sY6UsfqeSLroE=
github.com/gookit/goutil v0.6.8/go.mod h1:u+Isykc6RQcZ4GQzulsaGm+Famd97U5Tzp3aQyo+jyA=
github.com/goph/emperror v0.17.2/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gophercloud/gophercloud v0.10.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss=
Expand Down Expand Up @@ -1492,6 +1495,7 @@ github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHM
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
Expand Down Expand Up @@ -1667,8 +1671,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1742,8 +1746,8 @@ golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -1781,6 +1785,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1896,15 +1901,15 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1916,8 +1921,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -2021,8 +2026,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM=
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
16 changes: 8 additions & 8 deletions internal/api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func handleRetryCreateCluster(c *Context, w http.ResponseWriter, r *http.Request

// Notify even if we didn't make changes, to expedite even the no-op operations above.
unlockOnce()
c.Supervisor.Do()
_ = c.Supervisor.Do()

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusAccepted)
Expand Down Expand Up @@ -249,7 +249,7 @@ func handleProvisionCluster(c *Context, w http.ResponseWriter, r *http.Request)

// Notify even if we didn't make changes, to expedite even the no-op operations above.
unlockOnce()
c.Supervisor.Do()
_ = c.Supervisor.Do()

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusAccepted)
Expand Down Expand Up @@ -350,7 +350,7 @@ func handleUpgradeKubernetes(c *Context, w http.ResponseWriter, r *http.Request)
}

unlockOnce()
c.Supervisor.Do()
_ = c.Supervisor.Do()

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusAccepted)
Expand Down Expand Up @@ -423,7 +423,7 @@ func handleResizeCluster(c *Context, w http.ResponseWriter, r *http.Request) {
}

unlockOnce()
c.Supervisor.Do()
_ = c.Supervisor.Do()

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusAccepted)
Expand All @@ -448,7 +448,7 @@ func handleCreateNodegroups(c *Context, w http.ResponseWriter, r *http.Request)

clusterDTO, status, unlockOnce := getClusterForTransition(c, clusterID, newState)
if status != 0 {
c.Logger.Debug("Cluster is not in a valid state for nodegroup creation")
c.Logger.Debug("Cluster is not in a valid state for nodegroups creation")
w.WriteHeader(status)
return
}
Expand All @@ -463,7 +463,7 @@ func handleCreateNodegroups(c *Context, w http.ResponseWriter, r *http.Request)
if clusterDTO.Provisioner == model.ProvisionerEKS {
err = clusterDTO.ProvisionerMetadataEKS.ValidateNodegroupsCreateRequest(createNodegroupsRequest.Nodegroups)
if err != nil {
c.Logger.WithError(err).Error("failed to validate nodegroups create request")
c.Logger.WithError(err).Error("Failed to validate nodegroups creation request")
w.WriteHeader(http.StatusBadRequest)
return
}
Expand Down Expand Up @@ -524,7 +524,7 @@ func handleDeleteNodegroup(c *Context, w http.ResponseWriter, r *http.Request) {
if clusterDTO.Provisioner == model.ProvisionerEKS {
err := clusterDTO.ProvisionerMetadataEKS.ValidateNodegroupDeleteRequest(nodegroup)
if err != nil {
c.Logger.WithError(err).Error("failed to validate nodegroup delete request")
c.Logger.WithError(err).Error("Failed to validate nodegroup deletion request")
w.WriteHeader(http.StatusBadRequest)
return
}
Expand Down Expand Up @@ -636,7 +636,7 @@ func handleDeleteCluster(c *Context, w http.ResponseWriter, r *http.Request) {
}

unlockOnce()
c.Supervisor.Do()
_ = c.Supervisor.Do()

w.WriteHeader(http.StatusAccepted)
}
Expand Down
Loading