Skip to content

Commit 39a4f25

Browse files
committed
remove aws/aws-controllers-k8s from code-generator
The code-generator was still referencing the github.com/aws-controllers-k8s/[email protected] version which itself referenced still the original github.com/aws/aws-controllers-k8s library. This was causing a number of issues for generated controllers, including leaving old Go module dependencies around. Also adds a call to `git fetch --all --tags` to the `cloneSDKRepo()` function in `ack-generate` to ensure that the most up-to-date tags are pulled for the aws-sdk-go local cached repository. Calling `git checkout tags/v1.37.4` when the latest cached aws-sdk-go was at 1.35.5 was causing a frustrating "error: returned 1" garbage to be returned by the `scripts/build-controller.sh` because the `exec.Cmd()` was burying the response from Git which was clearly stating no such git tag or file could be located.
1 parent cb1d017 commit 39a4f25

File tree

3 files changed

+8
-85
lines changed

3 files changed

+8
-85
lines changed

cmd/ack-generate/command/common.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ func cloneSDKRepo(srcPath string) (string, error) {
8989
clonePath := filepath.Join(srcPath, "aws-sdk-go")
9090
if optRefreshCache {
9191
if _, err := os.Stat(filepath.Join(clonePath, ".git")); !os.IsNotExist(err) {
92-
cmd := exec.Command("git", "-C", clonePath, "checkout", "tags/"+sdkVersion)
92+
cmd := exec.Command("git", "-C", clonePath, "fetch", "--all", "--tags")
93+
if err = cmd.Run(); err != nil {
94+
return "", err
95+
}
96+
cmd = exec.Command("git", "-C", clonePath, "checkout", "tags/"+sdkVersion)
9397
return clonePath, cmd.Run()
9498
}
9599
}

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.0.3
6+
github.com/aws-controllers-k8s/runtime v0.0.4
77
github.com/aws/aws-sdk-go v1.37.4
88
github.com/dlclark/regexp2 v1.4.0
99
// pin to v0.1.1 due to release problem with v0.1.2

0 commit comments

Comments
 (0)