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

SidecarSet inject history revision #1021

Merged
merged 1 commit into from
Jul 22, 2022
Merged

Conversation

veophi
Copy link
Member

@veophi veophi commented Jul 14, 2022

Signed-off-by: mingzhou.swx [email protected]

Ⅰ. Describe what this PR does

Allow SidecarSet inject specific history sidecar to Pods.
issue: #783

Ⅱ. Does this pull request fix one issue?

fixes #710

@kruise-bot kruise-bot requested review from FillZpp and zmberg July 14, 2022 04:17
@kruise-bot kruise-bot added the size/XL size/XL: 500-999 label Jul 14, 2022
podIn := pod1.DeepCopy()
podOut := podIn.DeepCopy()
decoder, _ := admission.NewDecoder(scheme.Scheme)
client := fake.NewFakeClient(env...)
Copy link

Choose a reason for hiding this comment

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

SA1019: fake.NewFakeClient is deprecated: Please use NewClientBuilder instead.

Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.

When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}

for name, sidecarSet := range errorCases {
allErrs := validateSidecarSetSpec(&sidecarSet, field.NewPath("spec"))
fakeClient := fake.NewFakeClientWithScheme(testScheme, SidecarSetRevisions...)
Copy link

Choose a reason for hiding this comment

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

SA1019: fake.NewFakeClientWithScheme is deprecated: Please use NewClientBuilder instead.

Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.

When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -20,19 +20,20 @@
"context"
"encoding/json"
"fmt"
Copy link

Choose a reason for hiding this comment

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

goimports: File is not goimports-ed

Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.

When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@veophi veophi force-pushed the revision branch 2 times, most recently from 0fff9e3 to 3f73b49 Compare July 14, 2022 07:55
@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2022

Codecov Report

Merging #1021 (d7f3fa3) into master (c29b0c1) will decrease coverage by 0.48%.
The diff coverage is 18.71%.

@@            Coverage Diff             @@
##           master    #1021      +/-   ##
==========================================
- Coverage   49.63%   49.15%   -0.49%     
==========================================
  Files         124      124              
  Lines       12078    12253     +175     
==========================================
+ Hits         5995     6023      +28     
- Misses       5167     5306     +139     
- Partials      916      924       +8     
Flag Coverage Δ
unittests 49.15% <18.71%> (-0.49%) ⬇️

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

Impacted Files Coverage Δ
pkg/control/sidecarcontrol/hash.go 0.00% <0.00%> (ø)
pkg/control/sidecarcontrol/history_control.go 0.00% <0.00%> (ø)
pkg/control/sidecarcontrol/util.go 49.03% <ø> (ø)
...troller/sidecarset/sidecarset_pod_event_handler.go 63.15% <0.00%> (-3.51%) ⬇️
pkg/controller/sidecarset/sidecarset_processor.go 65.67% <15.00%> (-4.33%) ⬇️
pkg/webhook/pod/mutating/sidecarset.go 61.50% <22.80%> (-13.21%) ⬇️
...set/validating/sidecarset_create_update_handler.go 52.60% <63.63%> (+1.44%) ⬆️
...arset/mutating/sidecarset_create_update_handler.go 23.33% <100.00%> (ø)
pkg/controller/uniteddeployment/revision.go 66.41% <0.00%> (-1.53%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c29b0c1...d7f3fa3. Read the comment docs.


func SetDefaultInjectRevision(strategy *v1alpha1.SidecarSetInjectionStrategy) {
if strategy.Revision != nil {
if len(strategy.Revision.Policy) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

if strategy.Revision.Policy == “”

apis/apps/defaults/v1alpha1.go Outdated Show resolved Hide resolved
pkg/controller/sidecarset/sidecarset_processor.go Outdated Show resolved Hide resolved
pkg/webhook/pod/mutating/sidecarset.go Outdated Show resolved Hide resolved
pkg/webhook/pod/mutating/sidecarset.go Outdated Show resolved Hide resolved
@veophi veophi force-pushed the revision branch 2 times, most recently from b06bdcf to 00f4d80 Compare July 14, 2022 12:52
@veophi veophi force-pushed the revision branch 3 times, most recently from d433066 to 3a4bfd9 Compare July 15, 2022 03:11
@veophi
Copy link
Member Author

veophi commented Jul 15, 2022

/cc @pigletfly

@kruise-bot
Copy link

@veophi: GitHub didn't allow me to request PR reviews from the following users: pigletfly.

Note that only openkruise members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @pigletfly

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.

@veophi
Copy link
Member Author

veophi commented Jul 15, 2022

/cc @willise

@kruise-bot
Copy link

@veophi: GitHub didn't allow me to request PR reviews from the following users: willise.

Note that only openkruise members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @willise

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.

@veophi veophi force-pushed the revision branch 2 times, most recently from 364e6f6 to d7f3fa3 Compare July 18, 2022 04:39
apis/apps/v1alpha1/sidecarset_types.go Outdated Show resolved Hide resolved
pkg/control/sidecarcontrol/hash.go Outdated Show resolved Hide resolved
pkg/control/sidecarcontrol/util.go Outdated Show resolved Hide resolved
pkg/controller/sidecarset/sidecarset_processor.go Outdated Show resolved Hide resolved
@veophi veophi force-pushed the revision branch 4 times, most recently from 9a5e279 to bd59872 Compare July 18, 2022 12:43
@FillZpp
Copy link
Member

FillZpp commented Jul 19, 2022

/lgtm

@zmberg
Copy link
Member

zmberg commented Jul 19, 2022

/lgtm

@FillZpp FillZpp added this to the v1.3.0 milestone Jul 21, 2022
@furykerry
Copy link
Member

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: furykerry

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 fa8abc4 into openkruise:master Jul 22, 2022
diannaowa pushed a commit to diannaowa/kruise that referenced this pull request Sep 14, 2022
Signed-off-by: mingzhou.swx <[email protected]>

Co-authored-by: mingzhou.swx <[email protected]>
Signed-off-by: Liu Zhenwei <[email protected]>
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]Support version control for SidecarSet
6 participants