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

CNF-14376: Handle special overrides for extraLabels and extraAnnotations #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Missxiaoguo
Copy link
Collaborator

@Missxiaoguo Missxiaoguo commented Sep 20, 2024

In normal cases, ClusterInstance input data from the ClusterRequest overrides the defaults from the configmap. However, for the fields extraLabels and extraAnnotations, the default values from the configmap should take precedence if the same labels/annotations exist in both. The extraLabels provided in the default configmap are specific to the templated policies. They shouldn’t be overridden by ClusterRequest.

Add a function to handle these special overrides. If extraLabels or extraAnnotations are present in both the ClusterRequest and the configmap, the values from ClusterRequest will be overriden with the defaults.

The utility merge function is invoked after to perform the normal merging behavior, where ClusterRequest overrides defaults if both exist.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 20, 2024

@Missxiaoguo: This pull request references CNF-14376 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

In normal cases, ClusterInstance input data from the ClusterRequest overrides the defaults from the configmap. However, for the fields extraLabels and extraAnnotations, the default values from the configmap should take precedence if the same labels/annotations exist in both.

Add a function to handle these special overrides. If extraLabels or extraAnnotations are present in both the ClusterRequest and the configmap, the values from ClusterRequest will be overriden with the defaults.

The utility merge function is invoked after to perform the normal merging behavior, where ClusterRequest overrides defaults if both exist.

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 openshift-eng/jira-lifecycle-plugin repository.

@alegacy
Copy link
Contributor

alegacy commented Sep 20, 2024

Could you amend your commit comment to add a sentence or two after this sentence to explain why this is the case?

"However, for the fields extraLabels and extraAnnotations, the default values from the configmap should take precedence if the same labels/annotations exist in both"

Copy link
Contributor

@alegacy alegacy left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2024
Copy link

openshift-ci bot commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from alegacy. 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

In normal cases, ClusterInstance input data from the ClusterRequest overrides
the defaults from the configmap. However, for the fields extraLabels and
extraAnnotations, the default values from the configmap should take precedence
if the same labels/annotations exist in both. The extraLabels provided in the
default configmap are specific to the templated policies. They shouldn’t be
overridden by ClusterRequest.

Add a function to handle these special overrides. If extraLabels or extraAnnotations
are present in both the ClusterRequest and the configmap, the values from
ClusterRequest will be overriden with the defaults.

The utility merge function is invoked after to perform the normal merging behavior,
where ClusterRequest overrides defaults if both exist.
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 20, 2024

@Missxiaoguo: This pull request references CNF-14376 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

In normal cases, ClusterInstance input data from the ClusterRequest overrides the defaults from the configmap. However, for the fields extraLabels and extraAnnotations, the default values from the configmap should take precedence if the same labels/annotations exist in both. The extraLabels provided in the default configmap are specific to the templated policies. They shouldn’t be
overridden by ClusterRequest.

Add a function to handle these special overrides. If extraLabels or extraAnnotations are present in both the ClusterRequest and the configmap, the values from ClusterRequest will be overriden with the defaults.

The utility merge function is invoked after to perform the normal merging behavior, where ClusterRequest overrides defaults if both exist.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Sep 20, 2024

@Missxiaoguo: This pull request references CNF-14376 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

In normal cases, ClusterInstance input data from the ClusterRequest overrides the defaults from the configmap. However, for the fields extraLabels and extraAnnotations, the default values from the configmap should take precedence if the same labels/annotations exist in both. The extraLabels provided in the default configmap are specific to the templated policies. They shouldn’t be overridden by ClusterRequest.

Add a function to handle these special overrides. If extraLabels or extraAnnotations are present in both the ClusterRequest and the configmap, the values from ClusterRequest will be overriden with the defaults.

The utility merge function is invoked after to perform the normal merging behavior, where ClusterRequest overrides defaults if both exist.

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 openshift-eng/jira-lifecycle-plugin repository.

@alegacy
Copy link
Contributor

alegacy commented Sep 20, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants