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
bc7635f0
Commit
bc7635f0
authored
Jan 25, 2022
by
Brad Davidson
Committed by
Brad Davidson
Jan 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move containerd wait into exported function
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
fc8309a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
containerd.go
pkg/agent/containerd/containerd.go
+13
-3
No files found.
pkg/agent/containerd/containerd.go
View file @
bc7635f0
...
@@ -94,9 +94,20 @@ func Run(ctx context.Context, cfg *config.Node) error {
...
@@ -94,9 +94,20 @@ func Run(ctx context.Context, cfg *config.Node) error {
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}()
}()
if
err
:=
WaitForContainerd
(
ctx
,
cfg
.
Containerd
.
Address
);
err
!=
nil
{
return
err
}
return
preloadImages
(
ctx
,
cfg
)
}
// WaitForContainerd blocks in a retry loop until the Containerd CRI service
// is functional at the provided socket address. It will return only on success,
// or when the context is cancelled.
func
WaitForContainerd
(
ctx
context
.
Context
,
address
string
)
error
{
first
:=
true
first
:=
true
for
{
for
{
conn
,
err
:=
CriConnection
(
ctx
,
cfg
.
Containerd
.
A
ddress
)
conn
,
err
:=
CriConnection
(
ctx
,
a
ddress
)
if
err
==
nil
{
if
err
==
nil
{
conn
.
Close
()
conn
.
Close
()
break
break
...
@@ -113,8 +124,7 @@ func Run(ctx context.Context, cfg *config.Node) error {
...
@@ -113,8 +124,7 @@ func Run(ctx context.Context, cfg *config.Node) error {
}
}
}
}
logrus
.
Info
(
"Containerd is now running"
)
logrus
.
Info
(
"Containerd is now running"
)
return
nil
return
preloadImages
(
ctx
,
cfg
)
}
}
// preloadImages reads the contents of the agent images directory, and attempts to
// preloadImages reads the contents of the agent images directory, and attempts to
...
...
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