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
82e3c32c
Commit
82e3c32c
authored
Jan 30, 2024
by
Brad Davidson
Committed by
Brad Davidson
Feb 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retry startup snapshot reconcile
The reconcile may run before the kubelet has created the node object; retry until it succeeds Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
4005600d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
cluster.go
pkg/cluster/cluster.go
+9
-4
No files found.
pkg/cluster/cluster.go
View file @
82e3c32c
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"net/url"
"net/url"
"runtime"
"runtime"
"strings"
"strings"
"time"
"github.com/k3s-io/k3s/pkg/clientaccess"
"github.com/k3s-io/k3s/pkg/clientaccess"
"github.com/k3s-io/k3s/pkg/cluster/managed"
"github.com/k3s-io/k3s/pkg/cluster/managed"
...
@@ -13,6 +14,7 @@ import (
...
@@ -13,6 +14,7 @@ import (
"github.com/k3s-io/kine/pkg/endpoint"
"github.com/k3s-io/kine/pkg/endpoint"
"github.com/pkg/errors"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/wait"
utilsnet
"k8s.io/utils/net"
utilsnet
"k8s.io/utils/net"
)
)
...
@@ -107,11 +109,14 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
...
@@ -107,11 +109,14 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
}
}
if
!
c
.
config
.
EtcdDisableSnapshots
{
if
!
c
.
config
.
EtcdDisableSnapshots
{
if
err
:=
c
.
managedDB
.
ReconcileSnapshotData
(
ctx
);
err
!=
nil
{
wait
.
PollImmediateUntilWithContext
(
ctx
,
time
.
Second
,
func
(
ctx
context
.
Context
)
(
bool
,
error
)
{
logrus
.
Errorf
(
"Failed to record snapshots for cluster: %v"
,
err
)
err
:=
c
.
managedDB
.
ReconcileSnapshotData
(
ctx
)
}
if
err
!=
nil
{
logrus
.
Errorf
(
"Failed to record snapshots for cluster: %v"
,
err
)
}
return
err
==
nil
,
nil
})
}
}
return
return
default
:
default
:
runtime
.
Gosched
()
runtime
.
Gosched
()
...
...
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