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

Fix cluster targeting and missing customizations #1473

Merged
merged 5 commits into from Apr 20, 2023

Conversation

raulcabello
Copy link
Contributor

@raulcabello raulcabello commented Apr 13, 2023

There are two types of Targets:

  • Targets defined in a GitRepo. These targets are used to create BundleDeployments, and are duplicated into TargetRestrictions
  • TargetCustomizations defined in fleet.yaml. There are used just for customization

This PR fixes two issues:

  • Check if there is any TargetCustomization that should be applied, and it is not in the TargetRestrictions. Before we were matching target just if they were inside TargetRestrictions. This was causing some customizations to be ignored

  • We were iteration a map here which order might be different in different executions. This was causing this issue. This PR adds the iteration for clusters groups inside the loop of matches, that guarantees the order will never be different.

refers to #1254

@raulcabello raulcabello marked this pull request as ready for review April 14, 2023 15:24
@raulcabello raulcabello requested a review from a team as a code owner April 14, 2023 15:24
@raulcabello raulcabello changed the title targeting wip Fix targeting issues Apr 14, 2023
Copy link
Contributor

@weyfonk weyfonk left a comment

Choose a reason for hiding this comment

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

Nice work, thanks for this :)
Leaving a few comments here, happy to discuss them to better understand your focus and any additional context.

pkg/target/target.go Show resolved Hide resolved
pkg/bundlematcher/match.go Outdated Show resolved Hide resolved
pkg/bundlematcher/match.go Outdated Show resolved Hide resolved
pkg/bundlematcher/match.go Outdated Show resolved Hide resolved
pkg/bundlematcher/match.go Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/utils.go Outdated Show resolved Hide resolved
@raulcabello raulcabello force-pushed the targeting branch 2 times, most recently from 17da2f9 to f9457f9 Compare April 18, 2023 14:48
Copy link
Contributor

@weyfonk weyfonk left a comment

Choose a reason for hiding this comment

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

Added a few suggestions on wording of test descriptions, similar to what has already been applied on the first test case. Happy to discuss, also feel free to reword ;)

integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
manno
manno previously approved these changes Apr 20, 2023
integrationtests/controller/bundle/utils.go Outdated Show resolved Hide resolved
integrationtests/controller/bundle/bundle_targets_test.go Outdated Show resolved Hide resolved
raulcabello and others added 5 commits April 20, 2023 15:07
There are two types of Targets:
- Targets defined in a GitRepo. These targets are used to create BundleDeployments, and are duplicated into TargetRestrictions
- TargetCustomizations defined in fleet.yaml. There are used just for customization

Check if there is any TargetCustomization that should be applied, and it is not in the TargetRestrictions.

Add the iteration for clusters groups inside the loop of matches, that guarantees the order will never be different

Signed-off-by: raul <raul.cabello@suse.com>
Co-authored-by: Corentin Néau <tan.neau@suse.com>
Signed-off-by: raul <raul.cabello@suse.com>
…integration tests

Signed-off-by: raul <raul.cabello@suse.com>
Co-authored-by: Corentin Néau <tan.neau@suse.com>
Conditions inside ignore conditions field will be ignored when checking the Bundle state

Signed-off-by: raul <raul.cabello@suse.com>
@raulcabello raulcabello merged commit bdfbfe4 into rancher:master Apr 20, 2023
11 checks passed
@raulcabello raulcabello deleted the targeting branch April 20, 2023 14:05
@manno manno changed the title Fix targeting issues Fix cluster targeting and missing customizations Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants