Skip to content

Conversation

RedbackThomson
Copy link
Contributor

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

Description of changes:

  • Removes duplication of the CONTROLLER_TOOLS_VERSION variable
  • Deletes the defunct k8s.sh script (not being used anywhere in this repo)

I have tested the new controller-gen against the dynamodb controller and saw no changes in output CRDs (except for the version number in an annotation). None of the breaking changes called out in the release between 0.4.0 and 0.6.1 should have any effect on our generator.

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

@ack-bot ack-bot requested review from a-hilaly and vijtrip2 July 22, 2021 23:53
#
# Usage:
#
# if controller_gen_version_equals "v0.4.0"; then
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: /s/controller_gen_version_equals/k8s_controller_gen_version_equals

source "$SCRIPTS_DIR/lib/k8s.sh"

if ! is_installed controller-gen; then
if ! is_installed controller-gen || ! k8s_controller_gen_version_equals "$CONTROLLER_TOOLS_VERSION"; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Could there be possible collision between which controller-gen binary will be picked up if there is an already installed old version?
IOW, should other version be uninstalled? or better, should the script always install controller-gen in a specific path(which it does) and use complete path to invoke binary to avoid name collision in $PATH ?

Copy link
Member

Choose a reason for hiding this comment

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

Good point @vijtrip2 , older versions should be uninstalled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Many of our ACK contributors also use controller-gen (of different versions) for other projects. I don't want to dictate what version they have on their systems, if they've previously installed something else. From what I've seen, this script overrides the default version of controller-gen by default - but I do think it's a good idea to place it in a logical spot (say in ~/.cache) and re-use that path, rather than putting it into $PATH

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just looked into this and I don't really want to expand the scope of this particular PR into something like that. I think there are lots of places for errors to creep in. This PR is meant to just increment the version number and clean up some scripts.

@vijtrip2
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Jul 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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,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 619ff29 into aws-controllers-k8s:main Jul 23, 2021
ack-bot pushed a commit to aws-controllers-k8s/test-infra that referenced this pull request Jul 26, 2021
ack-bot pushed a commit to aws-controllers-k8s/community that referenced this pull request Aug 4, 2021
Issue #, if available: aws-controllers-k8s/code-generator#135

Description of changes:

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