Skip to content

Commit eac8d8a

Browse files
authored
Import Aws service package and pass EndpointsID to serviceController (#154)
Issue #, if available: aws-controllers-k8s/community#896 Description of changes: Import service and get its EndpointsID to pass this into the NewServiceController By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ac31817 commit eac8d8a

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GO111MODULE=on
66
AWS_SERVICE=$(shell echo $(SERVICE) | tr '[:upper:]' '[:lower:]')
77

88
# Build ldflags
9-
VERSION ?= "v0.10.0"
9+
VERSION ?= "v0.11.0"
1010
GITCOMMIT=$(shell git rev-parse HEAD)
1111
BUILDDATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
1212
IMPORT_PATH=github.com/aws-controllers-k8s/code-generator

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/code-generator
33
go 1.14
44

55
require (
6-
github.com/aws-controllers-k8s/runtime v0.10.0
6+
github.com/aws-controllers-k8s/runtime v0.11.0
77
github.com/aws/aws-sdk-go v1.37.10
88
github.com/dlclark/regexp2 v1.4.0
99
// pin to v0.1.1 due to release problem with v0.1.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
6767
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
6868
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
6969
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
70-
github.com/aws-controllers-k8s/runtime v0.10.0 h1:MPZ4mPeap2mP/EKU6Pk7a7phiBSYaeZ9QJX38OPecXo=
71-
github.com/aws-controllers-k8s/runtime v0.10.0/go.mod h1:kG2WM4JAmLgf67cgZV9IZUkY2DsrUzsaNbmhFMfb05c=
70+
github.com/aws-controllers-k8s/runtime v0.11.0 h1:M8gSC6qs2yxLDRh75htYdal4lPf3Uodh0SKeiXSgPno=
71+
github.com/aws-controllers-k8s/runtime v0.11.0/go.mod h1:kG2WM4JAmLgf67cgZV9IZUkY2DsrUzsaNbmhFMfb05c=
7272
github.com/aws/aws-sdk-go v1.37.10 h1:LRwl+97B4D69Z7tz+eRUxJ1C7baBaIYhgrn5eLtua+Q=
7373
github.com/aws/aws-sdk-go v1.37.10/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
7474
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=

templates/cmd/controller/main.go.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1515
ctrlrt "sigs.k8s.io/controller-runtime"
1616
ctrlrtmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
17+
svcsdk "github.com/aws/aws-sdk-go/service/{{ .ServiceIDClean }}"
1718

1819
ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
1920
svcresource "github.com/aws-controllers-k8s/{{ .ServiceIDClean }}-controller/pkg/resource"
@@ -26,6 +27,7 @@ import (
2627
var (
2728
awsServiceAPIGroup = "{{ .APIGroup }}"
2829
awsServiceAlias = "{{ .ServiceIDClean }}"
30+
awsServiceEndpointsID = svcsdk.EndpointsID
2931
scheme = runtime.NewScheme()
3032
setupLog = ctrlrt.Log.WithName("setup")
3133
)
@@ -84,7 +86,7 @@ func main() {
8486
"aws.service", awsServiceAlias,
8587
)
8688
sc := ackrt.NewServiceController(
87-
awsServiceAlias, awsServiceAPIGroup,
89+
awsServiceAlias, awsServiceAPIGroup, awsServiceEndpointsID,
8890
ackrt.VersionInfo{}, // TODO: populate version info
8991
).WithLogger(
9092
ctrlrt.Log,

0 commit comments

Comments
 (0)