Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.0:Update
kubectl.9375
do-not-gc-sle-kubic-images.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File do-not-gc-sle-kubic-images.patch of Package kubectl.9375
From 980df8bb8044ff3214d9515084f2370b7c797a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= <ereslibre@ereslibre.es> Date: Thu, 1 Mar 2018 16:25:50 +0100 Subject: [PATCH 1/2] Avoid the kubelet image GC to remove internal images Some images are loaded by the `container-feeder`, those images won't be available until we reboot again if they get cleaned by the image GC. Avoid to clean those. --- pkg/kubelet/images/image_gc_manager.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/kubelet/images/image_gc_manager.go b/pkg/kubelet/images/image_gc_manager.go index 83f6e97956..19bc1f2261 100644 --- a/pkg/kubelet/images/image_gc_manager.go +++ b/pkg/kubelet/images/image_gc_manager.go @@ -20,7 +20,9 @@ import ( goerrors "errors" "fmt" "math" + "regexp" "sort" + "strings" "sync" "time" @@ -223,6 +225,19 @@ func (im *realImageGCManager) detectImages(detectTime time.Time) (sets.String, e } } + // Mark all "kubic/" and "slesXY/" prefixed images as in use. + for _, image := range images { + for _, repo_tag := range image.RepoTags { + is_kubic := strings.HasPrefix(repo_tag, "kubic/") + is_sles, _ := regexp.MatchString("^sles\\d{2}/", repo_tag) + if is_kubic || is_sles { + glog.V(5).Infof("Marking image %s (%s) as in use, as it is an internal image", repo_tag, image.ID) + imagesInUse.Insert(image.ID) + break + } + } + } + // Add new images and record those being used. now := time.Now() currentImages := sets.NewString() -- 2.12.0 From 6b429cb53132b644cc5339de75be1634921a27b1 Mon Sep 17 00:00:00 2001 From: Michal Jura <mjura@suse.com> Date: Tue, 30 Oct 2018 14:17:32 +0100 Subject: [PATCH 2/2] Avoid the kubelet image GC to remove SUSE images (bsc#1111341) Update regexp for SUSE images and mark all "docker.io/kubic/|kubic/" and "docker.io/slesXY/|slesXY/" prefixed images as in use. --- pkg/kubelet/images/image_gc_manager.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/kubelet/images/image_gc_manager.go b/pkg/kubelet/images/image_gc_manager.go index 19bc1f2261..512473d644 100644 --- a/pkg/kubelet/images/image_gc_manager.go +++ b/pkg/kubelet/images/image_gc_manager.go @@ -22,7 +22,6 @@ import ( "math" "regexp" "sort" - "strings" "sync" "time" @@ -225,11 +224,11 @@ func (im *realImageGCManager) detectImages(detectTime time.Time) (sets.String, e } } - // Mark all "kubic/" and "slesXY/" prefixed images as in use. + // Mark all "docker.io/kubic/|kubic/" and "docker.io/slesXY/|slesXY/" prefixed images as in use. for _, image := range images { for _, repo_tag := range image.RepoTags { - is_kubic := strings.HasPrefix(repo_tag, "kubic/") - is_sles, _ := regexp.MatchString("^sles\\d{2}/", repo_tag) + is_kubic, _ := regexp.MatchString("^kubic/|^docker.io/kubic/", repo_tag) + is_sles, _ := regexp.MatchString("^sles\\d{2}/|^docker.io/sles\\d{2}/", repo_tag) if is_kubic || is_sles { glog.V(5).Infof("Marking image %s (%s) as in use, as it is an internal image", repo_tag, image.ID) imagesInUse.Insert(image.ID) -- 2.12.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor