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

update for default resource tags #335

Merged
merged 12 commits into from
Jun 10, 2022

Conversation

vijtrip2
Copy link
Contributor

@vijtrip2 vijtrip2 commented May 19, 2022

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

Description of changes:

  • Removes service.k8s.aws/managed=true and services.k8s.aws/created=%UTC_NOW% tags and adds the new services.k8s.aws/controller-version=%CONTROLLER_VERSION% tag as resource-tags input for ACK controller.
  • Updates ACK runtime to v0.19.0
  • Adds new TagConfig field inside ResourceConfig
  • Adds the code-generation for implementation of AWSResourceManager.EnsureTags()

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 May 19, 2022

Note to reviewer: controller-tests expected to fail due to VersionInfo refactoring from "pkg/runtime" to "pkg/types" inside ack runtime. PR -> aws-controllers-k8s/runtime#87

Locally tested that this code-generator change works as expected.

@RedbackThomson
Copy link
Contributor

👍🏼 Will wait for the runtime PR to be merged

@vijtrip2
Copy link
Contributor Author

/hold

@ack-bot ack-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 20, 2022
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

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.

Merging this as-is. It looks like we need to update the tests to modify the go.mod files for dynamodb/ecr/s3 controllers to the being-updated-to ACK runtime version?

@jaypipes jaypipes added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jun 8, 2022
@a-hilaly
Copy link
Member

a-hilaly commented Jun 8, 2022

Merging this as-is. It looks like we need to update the tests to modify the go.mod files for dynamodb/ecr/s3 controllers to the being-updated-to ACK runtime version?

@jaypipes We still don't have the part that generates EnsureTags methods for resources. This should wait for now

@vijtrip2
Copy link
Contributor Author

vijtrip2 commented Jun 9, 2022

/unhold

@ack-bot ack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2022
@vijtrip2
Copy link
Contributor Author

vijtrip2 commented Jun 9, 2022

Note to reviewer: DynamoDB, S3, ECR tests are expected to fail because they need an update inside their generator.yaml to ignore tagging, or provide path for the tagging field. I am planning to update the generator.yaml for these controllers when their auto generation failure issue gets created by ack-bot.

Failures in this PR are because the default top level Tags field does not exist inside Backup(Dynamo), Bucket(S3) and PullThroughCache(ECR) resources.

@vijtrip2 vijtrip2 requested review from jaypipes and a-hilaly June 9, 2022 07:16
pkg/generate/code/initialize_field.go Show resolved Hide resolved
pkg/model/crd.go Outdated Show resolved Hide resolved
pkg/model/crd.go Outdated Show resolved Hide resolved
@vijtrip2 vijtrip2 requested a review from brycahta June 9, 2022 18:20
pkg/model/crd.go Outdated Show resolved Hide resolved
templates/pkg/resource/manager.go.tpl Show resolved Hide resolved
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.

great start, @vijtrip2! few notes inline but overall looking good.

pkg/generate/code/initialize_field.go Outdated Show resolved Hide resolved
pkg/generate/code/initialize_field.go Outdated Show resolved Hide resolved
pkg/generate/code/initialize_field.go Outdated Show resolved Hide resolved
pkg/generate/code/initialize_field.go Outdated Show resolved Hide resolved
templates/pkg/resource/manager.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/tags.go.tpl Show resolved Hide resolved
templates/pkg/resource/tags.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/tags.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/tags.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/tags.go.tpl Outdated Show resolved Hide resolved
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.

Just had 2 more nits. But I think the functionality and logic is all solid.

pkg/generate/code/initialize_field.go Show resolved Hide resolved
templates/pkg/resource/tags.go.tpl Show resolved Hide resolved
@ack-bot
Copy link
Collaborator

ack-bot commented Jun 9, 2022

@vijtrip2: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
s3-olm-test 4900b99 link /test s3-olm-test
dynamodb-controller-test 4900b99 link /test dynamodb-controller-test
s3-controller-test 4900b99 link /test s3-controller-test
ecr-controller-test 4900b99 link /test ecr-controller-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

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.

Rock on brother Vijay :) Really smooth work. ++

} else {
elemAccessPrefix = fmt.Sprintf("%s%s", elemAccessPrefix,
r.Config().PrefixConfig.StatusField)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@jaypipes
Copy link
Collaborator

/lgtm

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

ack-bot commented Jun 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, 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 [A-Hilaly,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 160b839 into aws-controllers-k8s:main Jun 10, 2022
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.

6 participants