Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sohankunkerkar
Copy link
Member

Fixes: #6835

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Yes

Add support for pinned_images in crio configuration
With this change, users can indicate to the kubelet not to perform garbage collection on certain images.

@sohankunkerkar sohankunkerkar requested a review from mrunalp as a code owner May 1, 2023 15:04
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels May 1, 2023
@openshift-ci openshift-ci bot requested review from QiWang19 and klihub May 1, 2023 15:04
@sohankunkerkar sohankunkerkar changed the title *: add support for pinned_images in crio configuration [WIP] *: add support for pinned_images in crio configuration May 1, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 1, 2023
@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch from eee2f50 to 3ddab6a Compare May 1, 2023 16:54
@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch 3 times, most recently from 3b65e7d to 91d11ef Compare May 3, 2023 20:27
@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch 3 times, most recently from 2921be0 to f8bfaa6 Compare May 3, 2023 21:52
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #6862 (f9abf50) into main (a90d001) will increase coverage by 0.11%.
The diff coverage is 91.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6862      +/-   ##
==========================================
+ Coverage   49.64%   49.75%   +0.11%     
==========================================
  Files         127      127              
  Lines       15040    15090      +50     
==========================================
+ Hits         7466     7508      +42     
- Misses       6686     6693       +7     
- Partials      888      889       +1     

@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch from f8bfaa6 to b8ec87d Compare May 3, 2023 23:47
@sohankunkerkar sohankunkerkar changed the title [WIP] *: add support for pinned_images in crio configuration *: add support for pinned_images in crio configuration May 3, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 3, 2023
@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch 3 times, most recently from 5812428 to b914864 Compare May 4, 2023 17:44
@haircommander
Copy link
Member

couple more nits, and it would be really cool to unit test CompileRegexpsForPinnedImages to have some examples of what we expect to work, otherwise LGTM

@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch 2 times, most recently from fda22ec to 3c7079d Compare May 4, 2023 19:20
@haircommander
Copy link
Member

/approve

LGTM, nicely done

@cri-o/cri-o-maintainers PTAL

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2023
@sohankunkerkar
Copy link
Member Author

/test e2e-gcp-ovn

regexps := make([]*regexp.Regexp, 0, len(patterns))
for _, pattern := range patterns {
var re *regexp.Regexp
switch {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I’ll not block on this but I’d prefer having plain globs or regular expressions without any further checks.

@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch from 3c7079d to a9d8648 Compare May 5, 2023 16:19
@sohankunkerkar
Copy link
Member Author

/test ci-fedora-integration

@sohankunkerkar
Copy link
Member Author

/test e2e-gcp-ovn

@sohankunkerkar
Copy link
Member Author

/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 9, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, saschagrunert, sohankunkerkar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [haircommander,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sohankunkerkar sohankunkerkar force-pushed the support-pinned-images branch from a9d8648 to f9abf50 Compare May 9, 2023 13:31
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 9, 2023
@sohankunkerkar
Copy link
Member Author

@sohankunkerkar
Copy link
Member Author

/retest

@haircommander
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 9, 2023
@openshift-merge-robot openshift-merge-robot merged commit 35875ba into cri-o:main May 9, 2023
}
}

name, _, _ := sortNamesByType(image.Names)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this supposed to work with images that have multiple names?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you asking how sortNamesByType will behave with multiple names?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I did read that code. I don’t see that the current implementation provides a predictable behavior for users (the order of image.Names, in the current implementation, seems to depend on the order in which image names were pulled, and that’s not at all promised by the API).

My first guess is that all names in image.Names should be processed by the filter, but I didn’t look into the use cases of pinned images.

Copy link
Member

Choose a reason for hiding this comment

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

My first guess is that all names in image.Names should be processed by the filter, but I didn’t look into the use cases of pinned images.

the idea is to disqualify an image for kubelet garbage collection. Since the order of the names isn't guaranteed, it does sound like each should be considered to see if the image should be disqualified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Pinned Images

5 participants