Skip to content
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

changes due to controller-runtime v0.11.0 upgrade #63

Merged
merged 2 commits into from
Jan 6, 2022

Conversation

vijtrip2
Copy link
Contributor

@vijtrip2 vijtrip2 commented Jan 6, 2022

Issue #, if available: aws-controllers-k8s/community#1112

Description of changes:

  • Upgrade of controller-runtime to v0.11.0
  • Upgrade of go.mod to 1.17 because that is minimal go version for controller-runtime library
  • Keeping the indirect import in go.mod file because removing them causes the error "go.mod needs changes. Run go mod tidy" during local development

At go 1.17 and above, the go command adds an indirect requirement for each module that provides any package imported (even indirectly) by a package or test in the main module or passed as an argument to go get. These more comprehensive requirements enable module graph pruning and lazy module loading.

  • Reconcile method in reconcilers now accepts a context.Context parameter
  • Replace ACK RuntimeMetaObject with controller-runtime Object
  • Replace desired.RuntimeObject().DeepCopyObject() with desired.DeepCopy().RuntimeObject() because the former does not return implementation of controller-runtime Object
  • Remove RuntimeMetaObject() method from AWSResource interface
  • Use controller-runtime client Object instead of apimachinery runtime Object

  • Tested locally by running e2e tests for ecr-controller
  • Validated that newly generated image has no golang security vulnerabilities.

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

@vijtrip2
Copy link
Contributor Author

vijtrip2 commented Jan 6, 2022

note: unit test is currently failing because prow base image for testing the controller is not using go1.17. working on fixing it

ack-bot pushed a commit to aws-controllers-k8s/test-infra that referenced this pull request Jan 6, 2022
Description of changes:

* This is needed for testing ACK core libraries after controller-runtime dependency update which uses minimum go version 1.17

PR with failing test: aws-controllers-k8s/runtime#63

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

jaypipes commented Jan 6, 2022

  • Replace ACK RuntimeMetaObject with controller-runtime Object

👍 🎉

Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

So excited for these changes. Only took 2 years for this to be merged, but I'm glad we got there.

go.mod Show resolved Hide resolved
pkg/runtime/tags.go Outdated Show resolved Hide resolved
@RedbackThomson
Copy link
Contributor

/test unit-test

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

I like @RedbackThomson's naming suggestion too

pkg/runtime/reconciler_test.go Show resolved Hide resolved
pkg/types/aws_resource.go Show resolved Hide resolved
@RedbackThomson
Copy link
Contributor

Let's do it!
/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 6, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 6, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaypipes, RedbackThomson, vijtrip2

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [RedbackThomson,jaypipes,vijtrip2]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit dff8696 into aws-controllers-k8s:main Jan 6, 2022
RedbackThomson pushed a commit to RedbackThomson/ack-test-infra that referenced this pull request Jan 8, 2022
Description of changes:

* This is needed for testing ACK core libraries after controller-runtime dependency update which uses minimum go version 1.17

PR with failing test: aws-controllers-k8s/runtime#63

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants