Skip to content

Filter System tags before patching #172

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

michaelhtm
Copy link
Member

Description of changes:
This change ensures that neither ACK tags nor AWS tags will be patched.

Sometimes if there's a tag sync issues, these tags get patched to the controller.

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

This change ensures that neither ACK tags nor AWS tags
will be patched.

Sometimes if there's a tag sync issues, these tags get patched
to the controller.
@ack-prow ack-prow bot requested a review from a-hilaly February 20, 2025 22:18
Copy link

ack-prow bot commented Feb 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: michaelhtm
Once this PR has been reviewed and has the lgtm label, please assign jlbutler for approval by writing /assign @jlbutler in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@ack-prow ack-prow bot requested a review from jlbutler February 20, 2025 22:18
@michaelhtm
Copy link
Member Author

/retest

2 similar comments
@michaelhtm
Copy link
Member Author

/retest

@a-hilaly
Copy link
Member

a-hilaly commented Mar 4, 2025

/retest

This change introduces some changes to the mocks directory.
Copy link

ack-prow bot commented Mar 4, 2025

@michaelhtm: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
verify-attribution ea14871 link false /test verify-attribution
sagemaker-controller-test ea14871 link true /test sagemaker-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.

michaelhtm added a commit to michaelhtm/ack-code-generator that referenced this pull request Mar 6, 2025
When converting between ACK tags (map[string]string) and
resource tags(which could be either a list of Tag struct or map[string]*string)
can be tricky. One issue that we found was order preservation, especially when
converting from `map[string]string` to list of `Tag`.  The changed order, when
patched to the resource in the cluster, would trigger a reconciliation, for an
unpredictable amount of times (at least until we luckily convert to the list with
a preserved order.)

This change introduces two new functions, similar to the existing ones.

The `toACKTagsWithKeyOrder` has the same function as `ToACKTags`,
but besides returning the ACK tags, it also returns a list of keys in the same
order it is in the resource.

The `fromACKTagsWithKeyOrder`, also similar to `FromACKTags`, accepts
the keyOrder returned by `toACKTagsWithKeyOrder`, and rebuilds the resource
tags, if it's a list, in the same order as it was before. Any extra tags will be added
in random order.

These two new functions will be called before and after `mirrowAWSTags` and
`FilterSystemTags`. The extra tags mentioned earlier are the AWS tags that are
mirrored from the latest resource (more explanation on what they are [here](aws-controllers-k8s/runtime#170)) and will be filtered before getting patched with [this](aws-controllers-k8s/runtime#172)
change.
This will ensure that the tags in desired will maintain their order and avoid triggering
unnecessary reconciliations.
michaelhtm added a commit to michaelhtm/ack-code-generator that referenced this pull request Mar 6, 2025
When converting between ACK tags (map[string]string) and
resource tags(which could be either a list of Tag struct or map[string]*string)
can be tricky. One issue that we found was order preservation, especially when
converting from `map[string]string` to list of `Tag`.  The changed order, when
patched to the resource in the cluster, would trigger a reconciliation, for an
unpredictable amount of times (at least until we luckily convert to the list with
a preserved order.)

This change introduces two new functions, similar to the existing ones.

The `toACKTagsWithKeyOrder` has the same function as `ToACKTags`,
but besides returning the ACK tags, it also returns a list of keys in the same
order it is in the resource.

The `fromACKTagsWithKeyOrder`, also similar to `FromACKTags`, accepts
the keyOrder returned by `toACKTagsWithKeyOrder`, and rebuilds the resource
tags, if it's a list, in the same order as it was before. Any extra tags will be added
in random order.

These two new functions will be called before and after `mirrowAWSTags` and
`FilterSystemTags`. The extra tags mentioned earlier are the AWS tags that are
mirrored from the latest resource (more explanation on what they are [here](aws-controllers-k8s/runtime#170)) and will be filtered before getting patched with [this](aws-controllers-k8s/runtime#172)
change.
This will ensure that the tags in desired will maintain their order and avoid triggering
unnecessary reconciliations.
michaelhtm added a commit to michaelhtm/ack-code-generator that referenced this pull request Mar 7, 2025
When converting between ACK tags (map[string]string) and
resource tags(which could be either a list of Tag struct or map[string]*string)
can be tricky. One issue that we found was order preservation, especially when
converting from `map[string]string` to list of `Tag`.  The changed order, when
patched to the resource in the cluster, would trigger a reconciliation, for an
unpredictable amount of times (at least until we luckily convert to the list with
a preserved order.)

This change introduces two new functions, similar to the existing ones.

The `toACKTagsWithKeyOrder` has the same function as `ToACKTags`,
but besides returning the ACK tags, it also returns a list of keys in the same
order it is in the resource.

The `fromACKTagsWithKeyOrder`, also similar to `FromACKTags`, accepts
the keyOrder returned by `toACKTagsWithKeyOrder`, and rebuilds the resource
tags, if it's a list, in the same order as it was before. Any extra tags will be added
in random order.

These two new functions will be called before and after `mirrowAWSTags` and
`FilterSystemTags`. The extra tags mentioned earlier are the AWS tags that are
mirrored from the latest resource (more explanation on what they are [here](aws-controllers-k8s/runtime#170)) and will be filtered before getting patched with [this](aws-controllers-k8s/runtime#172)
change.
This will ensure that the tags in desired will maintain their order and avoid triggering
unnecessary reconciliations.
ack-prow bot pushed a commit to aws-controllers-k8s/code-generator that referenced this pull request Mar 10, 2025
…#572)

Description of changes:
When converting between ACK tags (map[string]string) and 
resource tags(which could be either a list of Tag struct or map[string]*string)
can be tricky. One issue that we found was order preservation, especially when 
converting from `map[string]string` to list of `Tag`.  The changed order, when 
patched to the resource in the cluster, would trigger a reconciliation, for an
unpredictable amount of times (at least until we luckily convert to the list with
a preserved order.)

This change introduces two new functions, similar to the existing ones.

The `toACKTagsWithKeyOrder` has the same function as `ToACKTags`,
but besides returning the ACK tags, it also returns a list of keys in the same
order it is in the resource.

The `fromACKTagsWithKeyOrder`, also similar to `FromACKTags`, accepts
the keyOrder returned by `toACKTagsWithKeyOrder`, and rebuilds the resource
tags, if it's a list, in the same order as it was before. Any extra tags will be added
in random order.

These two new functions will be called before and after `mirrowAWSTags` and
`FilterSystemTags`. The extra tags mentioned earlier are the AWS tags that are 
mirrored from the latest resource (more explanation on what they are [here](aws-controllers-k8s/runtime#170)) and will be filtered before getting patched with [this](aws-controllers-k8s/runtime#172)
change.
This will ensure that the tags in desired will maintain their order and avoid triggering
unnecessary reconciliations.

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants