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

add status.labelSelector field to unitedDeployment to support scale sub-resource #1314

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

diannaowa
Copy link
Contributor

@diannaowa diannaowa commented Jun 14, 2023

Ⅰ. Describe what this PR does

Add status.labelSelector field to unitedDeployment to support scale sub-resource

Ⅱ. Does this pull request fix one issue?

fixes #1308

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

…ub-resource

Signed-off-by: liuzhenwei <dui_zhang@163.com>
@kruise-bot kruise-bot requested review from FillZpp and zmberg June 14, 2023 04:13
@kruise-bot kruise-bot added the size/M size/M: 30-99 label Jun 14, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #1314 (d9b8bd1) into master (b7977a7) will decrease coverage by 0.09%.
The diff coverage is 37.50%.

❗ 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.

@@            Coverage Diff             @@
##           master    #1314      +/-   ##
==========================================
- Coverage   48.59%   48.50%   -0.09%     
==========================================
  Files         151      151              
  Lines       21042    21210     +168     
==========================================
+ Hits        10225    10288      +63     
- Misses       9700     9793      +93     
- Partials     1117     1129      +12     
Flag Coverage Δ
unittests 48.50% <37.50%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...er/uniteddeployment/uniteddeployment_controller.go 71.71% <37.50%> (+0.34%) ⬆️

... and 10 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@diannaowa
Copy link
Contributor Author

This is a romantic PR id

@@ -231,6 +233,14 @@ func (r *ReconcileUnitedDeployment) Reconcile(_ context.Context, request reconci
return reconcile.Result{}, err
}

selector, err := util.ValidatedLabelSelectorAsSelector(instance.Spec.Selector)
Copy link
Member

Choose a reason for hiding this comment

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

just using ValidatedLabelSelectorAsSelector is not enough to identify some label selector errors, you can call LabelSelectorAsSelector and check if there is any error. Similar code is in the cloneset validation validateCloneSetSpec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

yes, it seems the uniteddeployment webhook already validate the selector, is it necessary to validate again the controller

Copy link
Contributor Author

@diannaowa diannaowa Jun 14, 2023

Choose a reason for hiding this comment

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

yes, it seems the uniteddeployment webhook already validate the selector, is it necessary to validate again the controller

Unnecessary, but we need converts the LabelSelector api type into internalSelector, i think.

Copy link
Member

@furykerry furykerry left a comment

Choose a reason for hiding this comment

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

/lgtm

@zmberg
Copy link
Member

zmberg commented Jun 15, 2023

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zmberg

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

@kruise-bot kruise-bot merged commit ffcf189 into openkruise:master Jun 15, 2023
diannaowa added a commit to diannaowa/kruise that referenced this pull request Aug 29, 2023
…ub-resource (openkruise#1314)

Signed-off-by: liuzhenwei <dui_zhang@163.com>
lilongfeng0902 pushed a commit to lilongfeng0902/kruise that referenced this pull request Sep 12, 2023
…ub-resource (openkruise#1314)

Signed-off-by: liuzhenwei <dui_zhang@163.com>
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] UnitedDeployment supports scale sub-resource
5 participants