Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b74c4997
Unverified
Commit
b74c4997
authored
Jun 15, 2021
by
Derek Nola
Committed by
GitHub
Jun 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Change containerd image leases from 24h to permanent (#3452)" (#3461)
This reverts commit
86b3ba8d
.
parent
86b3ba8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
+2
-16
containerd.go
pkg/agent/containerd/containerd.go
+2
-16
No files found.
pkg/agent/containerd/containerd.go
View file @
b74c4997
...
@@ -17,7 +17,6 @@ import (
...
@@ -17,7 +17,6 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/reference/docker"
"github.com/containerd/containerd/reference/docker"
"github.com/klauspost/compress/zstd"
"github.com/klauspost/compress/zstd"
...
@@ -176,24 +175,11 @@ func preloadImages(ctx context.Context, cfg *config.Node) error {
...
@@ -176,24 +175,11 @@ func preloadImages(ctx context.Context, cfg *config.Node) error {
// Ensure that nothing else can modify the image store while we're importing,
// Ensure that nothing else can modify the image store while we're importing,
// and that our images are imported into the k8s.io namespace
// and that our images are imported into the k8s.io namespace
ctx
=
namespaces
.
WithNamespace
(
ctx
,
"k8s.io"
)
ctx
,
done
,
err
:=
client
.
WithLease
(
namespaces
.
WithNamespace
(
ctx
,
"k8s.io"
))
// At startup all images in the store with a lease are cleared
ls
:=
client
.
LeasesService
()
existingLeases
,
err
:=
ls
.
List
(
ctx
)
if
err
!=
nil
{
return
err
}
for
_
,
lease
:=
range
existingLeases
{
logrus
.
Debugf
(
"Deleting existing lease: %v"
,
lease
)
ls
.
Delete
(
ctx
,
lease
)
}
// Any images found on import are given a lease that never expires
_
,
err
=
ls
.
Create
(
ctx
,
leases
.
WithRandomID
())
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
defer
done
(
ctx
)
for
_
,
fileInfo
:=
range
fileInfos
{
for
_
,
fileInfo
:=
range
fileInfos
{
if
fileInfo
.
IsDir
()
{
if
fileInfo
.
IsDir
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment