Skip to content

Conversation

@tremes
Copy link
Contributor

@tremes tremes commented May 29, 2023

DVO tries to group objects with the same app label value. Before this update, the operator tried to read the following paths to get the app label value:

  • metadata.labels.app
  • spec.selector.matchLabels.app

The problem with this approach is that labels can match using matchExpressions. An example is:

key: app
operator: NotIn
values:
- foo
- bar

which means match everything except of resources with app=foo or app=bar. This is a more effective approach but more complex.

The problem is that we don't know the set of app label values (in a namespace) in advance. So the logic here is to sort the found GroupVersionKinds according their group (this adds the apps/v1 group between the first in the slice) and then process the app label selectors.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented May 29, 2023

@tremes: This pull request references DVO-105 which is a valid jira issue.

In response to this:

DVO tries to group objects with the same app label value. Before this update, the operator tried to read the following paths to get the app label value:

  • metadata.labels.app
  • spec.selector.matchLabels.app

The problem with this approach is that labels can match using matchExpressions. An example is:

key: app
operator: NotIn
values:
- foo
- bar

which means match everything except of resources with app=foo or app=bar. This is a more effective approach but more complex.

The problem is that we don't know the set of app label values (in a namespace) in advance. So the logic here is to sort the found GroupVersionKinds according their group (this adds the apps/v1 group between the first in the slice) and then process the app label selectors.

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.

@codecov-commenter
Copy link

Codecov Report

Merging #252 (ce4ddbe) into master (2726809) will increase coverage by 2.31%.
The diff coverage is 77.21%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #252      +/-   ##
==========================================
+ Coverage   44.39%   46.70%   +2.31%     
==========================================
  Files          22       23       +1     
  Lines         910      972      +62     
==========================================
+ Hits          404      454      +50     
- Misses        472      479       +7     
- Partials       34       39       +5     
Impacted Files Coverage Δ
pkg/utils/app_label.go 71.42% <71.42%> (ø)
pkg/controller/generic_reconciler.go 69.59% <91.30%> (+3.53%) ⬆️

Copy link
Contributor

@ncaak ncaak 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 label Jun 9, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jun 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncaak, tremes

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

@openshift-merge-robot openshift-merge-robot merged commit 90c9bce into app-sre:master Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants