@@ -5,6 +5,7 @@ package main
5
5
import (
6
6
"os"
7
7
8
+ ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
8
9
ackcfg "github.com/aws-controllers-k8s/runtime/pkg/config"
9
10
ackrt "github.com/aws-controllers-k8s/runtime/pkg/runtime"
10
11
ackrtutil "github.com/aws-controllers-k8s/runtime/pkg/util"
@@ -16,7 +17,6 @@ import (
16
17
ctrlrtmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
17
18
svcsdk "github.com/aws/aws-sdk-go/service/{ { .ServicePackageName } }"
18
19
19
- ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
20
20
svcresource "github.com/aws-controllers-k8s/{ { .ServicePackageName } }-controller/pkg/resource"
21
21
svctypes "github.com/aws-controllers-k8s/{ { .ServicePackageName } }-controller/apis/{ { .APIVersion } }"
22
22
{ {- /* Import the go types from service controllers whose resources are referenced in this service controller.
@@ -26,20 +26,21 @@ resources across service controller. */ -}}
26
26
{ {- $apiVersion := .APIVersion } }
27
27
{ {- range $referencedServiceName := .ReferencedServiceNames } }
28
28
{ {- if not (eq $referencedServiceName $servicePackageName ) } }
29
- { { $referencedServiceName } }apitypes "github.com/aws-controllers-k8s/{ { $referencedServiceName } }-controller/apis/{ { $apiVersion } }"
29
+ { { $referencedServiceName } }apitypes "github.com/aws-controllers-k8s/{ { $referencedServiceName } }-controller/apis/{ { $apiVersion } }"
30
30
{ {- end } }
31
31
{ {- end } }
32
32
{ {/* TODO(a-hilaly): import apis/* packages to register webhooks */} }
33
33
{ {range $crdName := .SnakeCasedCRDNames } }_ "github.com/aws-controllers-k8s/{ { $servicePackageName } }-controller/pkg/resource/{ { $crdName } }"
34
34
{ {end} }
35
+ "github.com/aws-controllers-k8s/{ { .ServicePackageName } }-controller/pkg/version"
35
36
)
36
37
37
38
var (
38
- awsServiceAPIGroup = "{ { .APIGroup } }"
39
- awsServiceAlias = "{ { .ServicePackageName } }"
40
- awsServiceEndpointsID = svcsdk.EndpointsID
41
- scheme = runtime.NewScheme()
42
- setupLog = ctrlrt.Log.WithName("setup")
39
+ awsServiceAPIGroup = "{ { .APIGroup } }"
40
+ awsServiceAlias = "{ { .ServicePackageName } }"
41
+ awsServiceEndpointsID = svcsdk.EndpointsID
42
+ scheme = runtime.NewScheme()
43
+ setupLog = ctrlrt.Log.WithName("setup")
43
44
)
44
45
45
46
func init() {
@@ -49,7 +50,7 @@ func init() {
49
50
_ = ackv1alpha1.AddToScheme(scheme)
50
51
{ {- range $referencedServiceName := .ReferencedServiceNames } }
51
52
{ {- if not (eq $referencedServiceName $servicePackageName ) } }
52
- _ = { { $referencedServiceName } }apitypes.AddToScheme(scheme)
53
+ _ = { { $referencedServiceName } }apitypes.AddToScheme(scheme)
53
54
{ {- end } }
54
55
{ {- end } }
55
56
}
@@ -78,13 +79,13 @@ func main() {
78
79
}
79
80
80
81
mgr, err := ctrlrt.NewManager(ctrlrt.GetConfigOrDie(), ctrlrt.Options{
81
- Scheme: scheme,
82
- Port: port,
83
- Host: host,
82
+ Scheme: scheme,
83
+ Port: port,
84
+ Host: host,
84
85
MetricsBindAddress: ackCfg.MetricsAddr,
85
- LeaderElection: ackCfg.EnableLeaderElection,
86
+ LeaderElection: ackCfg.EnableLeaderElection,
86
87
LeaderElectionID: awsServiceAPIGroup,
87
- Namespace: ackCfg.WatchNamespace,
88
+ Namespace: ackCfg.WatchNamespace,
88
89
} )
89
90
if err != nil {
90
91
setupLog.Error(
@@ -102,7 +103,11 @@ func main() {
102
103
)
103
104
sc := ackrt.NewServiceController(
104
105
awsServiceAlias, awsServiceAPIGroup, awsServiceEndpointsID,
105
- ackrt.VersionInfo{ } , // TODO: populate version info
106
+ ackrt.VersionInfo{
107
+ version.GitCommit,
108
+ version.GitVersion,
109
+ version.BuildDate,
110
+ } ,
106
111
).WithLogger(
107
112
ctrlrt.Log,
108
113
).WithResourceManagerFactories(
0 commit comments