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

Simplify target customisations for namespace labels and annotations #2664

Conversation

weyfonk
Copy link
Contributor

@weyfonk weyfonk commented Jul 23, 2024

Follow-up to #2583.
Refers to #2262 and #2441.

This simplifies end-to-end tests and the implementation for using namespace labels and annotations as target customisations.

In bundle deployment options, maps are used directly instead of pointers to maps for namespace labels and namespace annotations.
Manual tests suggest that Kubernetes represents bundles deployments with identical YAML in both cases, ie whether pointers to maps or simple maps are used to represent those fields.

@weyfonk weyfonk requested a review from a team as a code owner July 23, 2024 09:22
@weyfonk weyfonk force-pushed the namespace-labels-annotations-target-custom-follow-up branch from 94d291f to 9fb2143 Compare July 29, 2024 12:03
@weyfonk weyfonk requested a review from a team July 29, 2024 12:04
@weyfonk weyfonk force-pushed the namespace-labels-annotations-target-custom-follow-up branch from 9fb2143 to 0fcd577 Compare July 29, 2024 15:24
weyfonk added 5 commits August 7, 2024 11:54
Now that the necessary directory has been merged into
`rancher/fleet-test-data`, this commit makes use of it instead of a
fork's directory.
One only needs to loop over targets once to populate both.
This fetches the cluster namespace from the cluster object itself, as
opposed to using a hard-coded namespace with a seemingly arbitrary
value.
Pointers to maps are superfluous, as iterating over an empty map will be
a no-op, and we do not need to otherwise differentiate an empty map from
an unset one.
This still leaves original namespace labels and annotations as pointers
to maps in bundle deployment options, for backward compatibility.
This simplifies dealing with bundle deployment options, since an empty
map is semantically equivalent to a nil pointer.
@weyfonk weyfonk force-pushed the namespace-labels-annotations-target-custom-follow-up branch from 0fcd577 to 8e71c25 Compare August 7, 2024 09:54
@kkaempf kkaempf added this to the v2.10.0 milestone Aug 9, 2024
@manno manno merged commit 6ac70f9 into rancher:main Aug 12, 2024
12 checks passed
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.

3 participants