Skip to content

Commit

Permalink
Migrate to sdk v2 - configuration loading (#6432)
Browse files Browse the repository at this point in the history
* Migrate to sdk v2 - configuration loading

* update references to eks instance selector

* fix lint

* add missing unit test expectation

* fix unit tests
  • Loading branch information
TiberiuGC authored Jul 4, 2023
1 parent cccd732 commit 38d294b
Show file tree
Hide file tree
Showing 37 changed files with 363 additions and 770 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ gocache := $(shell go env GOCACHE)
export GOBIN ?= $(gopath)/bin

AWS_SDK_GO_DIR ?= $(shell go list -m -f '{{.Dir}}' 'github.com/aws/aws-sdk-go')
AWS_SDK_V2_GO_DIR ?= $(shell go list -m -f '{{.Dir}}' 'github.com/aws/aws-sdk-go-v2')

generated_code_deep_copy_helper := pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go

generated_code_aws_sdk_mocks := $(wildcard pkg/eks/mocks/*API.go)

conditionally_generated_files := \
$(generated_code_deep_copy_helper) $(generated_code_aws_sdk_mocks)
$(generated_code_deep_copy_helper) $(generated_code_aws_sdk_mocks) $(generated_code_aws_sdk_v2_mocks)

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -143,7 +144,6 @@ generate-always: pkg/addons/default/assets/aws-node.yaml ## Generate code (requi
go generate ./pkg/authconfigmap
go generate ./pkg/awsapi/...
go generate ./pkg/eks
go generate ./pkg/eks/mocksv2
go generate ./pkg/drain
go generate ./pkg/actions/...
go generate ./pkg/executor
Expand Down Expand Up @@ -172,6 +172,9 @@ $(generated_code_deep_copy_helper): $(deep_copy_helper_input) ## Generate Kuber
$(generated_code_aws_sdk_mocks): $(call godeps,pkg/eks/mocks/mocks.go) ## Generate AWS SDK mocks
AWS_SDK_GO_DIR=$(AWS_SDK_GO_DIR) go generate ./pkg/eks/mocks

$(generated_code_aws_sdk_v2_mocks): $(call godeps,pkg/eks/mockv2s/generate.go) ## Generate AWS SDK V2 mocks
AWS_SDK_GO_DIR=$(AWS_SDK_V2_GO_DIR) go generate ./pkg/eks/mocksv2

.PHONY: generate-kube-reserved
generate-kube-reserved: ## Update instance list with respective specs
@cd ./pkg/nodebootstrap/ && go run reserved_generate.go
Expand Down
30 changes: 16 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ go 1.18

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/aws/amazon-ec2-instance-selector/v2 v2.4.1
github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20230601180523-74e721cb8c1e
github.com/aws/aws-sdk-go v1.44.290
github.com/aws/aws-sdk-go-v2 v1.18.1
github.com/aws/aws-sdk-go-v2/config v1.18.27
Expand All @@ -21,10 +21,10 @@ require (
github.com/aws/aws-sdk-go-v2/service/eks v1.27.14
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.15.12
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.19.13
github.com/aws/aws-sdk-go-v2/service/iam v1.20.3
github.com/aws/aws-sdk-go-v2/service/iam v1.21.0
github.com/aws/aws-sdk-go-v2/service/kms v1.22.2
github.com/aws/aws-sdk-go-v2/service/outposts v1.27.12
github.com/aws/aws-sdk-go-v2/service/ssm v1.36.6
github.com/aws/aws-sdk-go-v2/service/ssm v1.36.7
github.com/aws/aws-sdk-go-v2/service/sts v1.19.2
github.com/aws/smithy-go v1.13.5
github.com/benjamintf1/unmarshalledmatchers v1.0.0
Expand Down Expand Up @@ -150,11 +150,12 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.3 // indirect
github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.26.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect
github.com/awslabs/goformation/v4 v4.19.5 // indirect
github.com/aymanbagabas/go-osc52 v1.0.3 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bkielbasa/cyclop v1.2.0 // indirect
Expand All @@ -177,13 +178,13 @@ require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/charithe/durationcheck v0.0.9 // indirect
github.com/charmbracelet/bubbles v0.13.0 // indirect
github.com/charmbracelet/bubbletea v0.21.0 // indirect
github.com/charmbracelet/lipgloss v0.6.1-0.20220911181249-6304a734e792 // indirect
github.com/charmbracelet/bubbles v0.15.0 // indirect
github.com/charmbracelet/bubbletea v0.24.1 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
github.com/cncf/xds/go v0.0.0-20211216145620-d92e9ce0af51 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/containerd v1.6.18 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.12.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
Expand Down Expand Up @@ -216,7 +217,7 @@ require (
github.com/esimonov/ifshort v1.0.4 // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evertras/bubble-table v0.14.4 // indirect
github.com/evertras/bubble-table v0.15.2 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/firefart/nonamedreturns v1.0.4 // indirect
Expand Down Expand Up @@ -354,8 +355,9 @@ require (
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
github.com/mgechev/revive v1.2.4 // indirect
Expand All @@ -376,13 +378,13 @@ require (
github.com/moricho/tparallel v0.2.1 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.0 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/mango v0.1.0 // indirect
github.com/muesli/mango-cobra v1.2.0 // indirect
github.com/muesli/mango-pflag v0.1.0 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/roff v0.1.0 // indirect
github.com/muesli/termenv v0.12.1-0.20220901123159-d729275e0977 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/nakabonne/nestif v0.3.1 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
github.com/nishanths/exhaustive v0.8.3 // indirect
Expand Down Expand Up @@ -497,7 +499,7 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.21.0 // indirect
gocloud.dev v0.26.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
Expand Down
Loading

0 comments on commit 38d294b

Please sign in to comment.