Skip to content

Commit 38e309d

Browse files
fix template for create custom implementation scenario (#100)
Issue #, if available: Code generator fails when custom implementation is provided for create scenario Steps to reproduce: 1. Run `make build-ack-generate && make build-controller SERVICE=$SERVICE` 2. Observe: > /Users/kumargsh/ws/github_ws/go/src/github.com/aws-controllers-k8s/elasticache-controller/pkg/resource/snapshot/sdk.go:311:17: expected ';', found created Error: not all generators ran successfully 3. Corresponding `sdk.go` code: > exit := rlog.Trace("rm.sdkCreate") defer exit(err)created, err = rm.CustomCreateSnapshot(ctx, desired) if created != nil || err != nil { return created, err } Observe, missing newline after `defer exit(err)` Description of changes: Updated the template. Testing * `make test` passed. * ElastiCache service controller gets generated fine. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 4e0e553 commit 38e309d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/pkg/resource/sdk.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (rm *resourceManager) sdkCreate(
5656
{{- if $hookCode := Hook .CRD "sdk_create_pre_build_request" }}
5757
{{ $hookCode }}
5858
{{- end }}
59-
{{- if $customMethod := .CRD.GetCustomImplementation .CRD.Ops.Create -}}
59+
{{- if $customMethod := .CRD.GetCustomImplementation .CRD.Ops.Create }}
6060
created, err = rm.{{ $customMethod }}(ctx, desired)
6161
if created != nil || err != nil {
6262
return created, err

0 commit comments

Comments
 (0)