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

Feature: SidecarSet injection supports Partial strategy #1856

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

AiRanthem
Copy link
Member

@AiRanthem AiRanthem commented Dec 12, 2024

Ⅰ. Describe what this PR does

Now, SidecarSet supports two policies in injectionStrategy:

  1. Always, which is the default and current policy. Under this policy, all newly created Pods will be injected with the specified revision in injectionStrategy.
  2. Partial, under which only when the Pod is not selected by the Selector explicitly configured in UpdateStrategy will it be definitely injected with the specified revision. In all other conditions, newly created Pods have a probability of being injected with the latest Sidecar, where the probability is 1 - UpdateStrategy.Partition. If Partition is not a percentage or is not configured, its value is considered to be 0%.

Ⅱ. Does this pull request fix one issue?

fixes #1833

Ⅲ. Describe how to verify it

see the unit tests added

Ⅳ. Special notes for reviews

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
@AiRanthem
Copy link
Member Author

@furykerry please help me to name the TODOSidecarSetInjectRevisionPolicy

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 50.05%. Comparing base (0d0031a) to head (a253818).
Report is 131 commits behind head on master.

Files with missing lines Patch % Lines
...set/validating/sidecarset_create_update_handler.go 41.17% 9 Missing and 1 partial ⚠️
pkg/util/tools.go 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1856      +/-   ##
==========================================
+ Coverage   47.91%   50.05%   +2.13%     
==========================================
  Files         162      192      +30     
  Lines       23491    24717    +1226     
==========================================
+ Hits        11256    12372    +1116     
- Misses      11014    11071      +57     
- Partials     1221     1274      +53     
Flag Coverage Δ
unittests 50.05% <80.00%> (+2.13%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
@AiRanthem AiRanthem changed the title SidecarSet injection supports TODO strategy SidecarSet injection supports Partial strategy Dec 13, 2024
@AiRanthem AiRanthem changed the title SidecarSet injection supports Partial strategy Feature: SidecarSet injection supports Partial strategy Dec 13, 2024
@AiRanthem AiRanthem marked this pull request as ready for review December 13, 2024 08:35
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
@furykerry
Copy link
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] SidecarSet support 'PartitionBased' policy to inject old/new revision according to Partition
2 participants