Skip to content

Refactor and uniform tags comparison/update logic #196

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
Jun 4, 2024

Conversation

a-hilaly
Copy link
Member

@a-hilaly a-hilaly commented Jun 4, 2024

Fixes aws-controllers-k8s/community#2063

During the early days of ACK, the ec2 controller didn't have a lot of CRDs and most of the work around tag handling was some sort of copy/pasta from resource to resource. Time passed and now ec2-controller has 15 resources each with a slightly different tags handling implementations - making it very hard for us to maintain and bug fix if something goes wrong.

This patch does a few things to simplify the life of an ACK developer:

  • Moves a lot of the tags handling logic into a single, simple and maintainable package (pkg/tags).
  • Rely back on generated tags delta computation (back then this wasn't supported)
  • Add type safety around the algorithm that was used to compare two array slices.

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

@ack-prow ack-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2024
@ack-prow ack-prow bot requested review from jljaco and vijtrip2 June 4, 2024 05:08
@ack-prow ack-prow bot added the approved label Jun 4, 2024
@a-hilaly a-hilaly force-pushed the refactor-tags branch 2 times, most recently from 2545661 to 58f6b17 Compare June 4, 2024 07:01
@a-hilaly a-hilaly changed the title WIP: Refactor and uniform tags comparison/update logic Refactor and uniform tags comparison/update logic Jun 4, 2024
@ack-prow ack-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2024
@yuxiang-zhang
Copy link
Member

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2024
@ack-prow ack-prow bot merged commit a6f8761 into aws-controllers-k8s:main Jun 4, 2024
5 of 6 checks passed
Copy link

ack-prow bot commented Jun 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, yuxiang-zhang

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:

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

nnbu pushed a commit to nnbu/ack-ec2-controller that referenced this pull request Sep 18, 2024
…s#196)

Fixes aws-controllers-k8s/community#2063

During the early days of ACK, the ec2 controller didn't have a lot of CRDs and most of the work around tag handling was some sort of copy/pasta from resource to resource. Time passed and now ec2-controller has 15 resources each with a slightly different tags handling implementations - making it very hard for us to maintain and bug fix if something goes wrong.

This patch does a few things to simplify the life of an ACK developer:
- Moves a lot of the tags handling logic into a single, simple and maintainable package (`pkg/tags`).
- Rely back on generated tags delta computation (back then this wasn't supported)
- Add type safety around the algorithm that was used to compare two array slices.

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.

[EC2] Panic on invalid memory address or nil pointer deference
2 participants