Skip to content

link ack-runtime with code-generator via go.mod #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

jaypipes
Copy link
Collaborator

Even though Go code in the code-generator doesn't actually import the
ack-runtime library (github.com/aws-controllers-k8s/runtime), the
templates contained in the code-generator do produce Go code that
imports the ack-runtime. So, in order to fake out a Go module dependency
between the code-generator and the ack-runtime, I've added a simple test
file in pkg/generate/ack/runtime_test.go that effectively couples the
ack-runtime library at v0.0.3.

When we make changes in the ack-runtime that break backwards
compatibility, we can now update the SemVer in the ack-runtime repo and
the commits to the code-generator that change the produced Go code that
follows the new interfaces in ack-runtime can update the depended-on
ack-runtime version in the code-generator repository's go.mod file.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Even though Go code in the code-generator doesn't actually import the
ack-runtime library (github.com/aws-controllers-k8s/runtime), the
templates contained in the code-generator *do* produce Go code that
imports the ack-runtime. So, in order to fake out a Go module dependency
between the code-generator and the ack-runtime, I've added a simple test
file in pkg/generate/ack/runtime_test.go that effectively couples the
ack-runtime library at v0.0.3.

When we make changes in the ack-runtime that break backwards
compatibility, we can now update the SemVer in the ack-runtime repo and
the commits to the code-generator that change the produced Go code that
follows the new interfaces in ack-runtime can update the depended-on
ack-runtime version in the code-generator repository's go.mod file.
@@ -14,5 +15,5 @@ require (
github.com/spf13/cobra v1.1.1
github.com/stretchr/testify v1.7.0
golang.org/x/mod v0.4.1
k8s.io/apimachinery v0.20.2
k8s.io/apimachinery v0.18.6
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: this was necessary in order to avoid this issue: kubernetes/client-go#741

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's 🚢 it!

Copy link
Member

@surajkota surajkota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally, lgtm!

Thanks

@jaypipes jaypipes merged commit deb2eb0 into aws-controllers-k8s:main Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants