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

predownload image after some number updated pods ready #904

Conversation

shiyan2016
Copy link
Member

Ⅰ. Describe what this PR does

predownload image after some number updated pods ready

Ⅱ. Does this pull request fix one issue?

fixes #876

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

@kruise-bot kruise-bot added the size/S size/S 10-29 label Feb 17, 2022
@shiyan2016 shiyan2016 changed the title predownload image after some number updated pods ready WIP: predownload image after some number updated pods ready Feb 17, 2022
@shiyan2016 shiyan2016 force-pushed the feature/image-predownload-min-ready-pods branch from 307b86f to c8f0055 Compare February 17, 2022 06:51
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

Merging #904 (c8f0055) into master (411bda2) will increase coverage by 0.06%.
The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
+ Coverage   49.24%   49.31%   +0.06%     
==========================================
  Files         119      119              
  Lines       11082    11091       +9     
==========================================
+ Hits         5457     5469      +12     
+ Misses       4786     4783       -3     
  Partials      839      839              
Flag Coverage Δ
unittests 49.31% <54.54%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
pkg/controller/cloneset/cloneset_controller.go 53.43% <54.54%> (+2.84%) ⬆️

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 411bda2...c8f0055. Read the comment docs.

@shiyan2016 shiyan2016 force-pushed the feature/image-predownload-min-ready-pods branch from c8f0055 to 2292914 Compare February 17, 2022 07:25
@kruise-bot kruise-bot added size/M size/M: 30-99 and removed size/S size/S 10-29 labels Feb 17, 2022
@shiyan2016 shiyan2016 force-pushed the feature/image-predownload-min-ready-pods branch 2 times, most recently from de918dc to 9d4e750 Compare February 17, 2022 10:47
@shiyan2016 shiyan2016 changed the title WIP: predownload image after some number updated pods ready predownload image after some number updated pods ready Feb 17, 2022
package pub

const (
ImagePreDownloadMinUpdatedReadyPods = "apps.kruise.io/image-predownload-min-updated-ready-pods"
Copy link
Member

Choose a reason for hiding this comment

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

How about define it in apis/apps/v1alpha1/imagepulljob_types.go with some other existing keys?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

minUpdatedReadyPodsCount := 0
minUpdatedReadyPods, ok := instance.Annotations[appspub.ImagePreDownloadMinUpdatedReadyPods]
if ok {
if minUpdatedReadyPodsCount, err = strconv.Atoi(minUpdatedReadyPods); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Should we use intOrString to support percentage or just integer?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Signed-off-by: shiyan2016 <shiyan20160606@gmail.com>
@shiyan2016 shiyan2016 force-pushed the feature/image-predownload-min-ready-pods branch from 9d4e750 to f978173 Compare February 28, 2022 06:38
Copy link
Member

@FillZpp FillZpp left a comment

Choose a reason for hiding this comment

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

/lgtm

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FillZpp

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 d3e8035 into openkruise:master Feb 28, 2022
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] PreDownloadImage after some number count pods update ready
4 participants