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
3cebde92
Commit
3cebde92
authored
Mar 17, 2022
by
Brad Davidson
Committed by
Brad Davidson
Mar 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle empty entries in bootstrap path map
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
a93b9b6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
bootstrap.go
pkg/cluster/bootstrap.go
+6
-4
No files found.
pkg/cluster/bootstrap.go
View file @
3cebde92
...
...
@@ -325,9 +325,11 @@ func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker,
results
:=
make
(
map
[
string
]
update
)
for
pathKey
,
fileData
:=
range
files
{
path
,
ok
:=
paths
[
pathKey
]
if
!
ok
{
if
!
ok
||
path
==
""
{
logrus
.
Warnf
(
"Unable to lookup path to reconcile %s"
,
pathKey
)
continue
}
logrus
.
Debugf
(
"Reconciling %s at '%s'"
,
pathKey
,
path
)
f
,
err
:=
os
.
Open
(
path
)
if
err
!=
nil
{
...
...
@@ -439,7 +441,7 @@ func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker,
switch
{
case
res
.
disk
:
updateDisk
=
true
logrus
.
Warn
(
"
d
atastore newer than "
+
path
)
logrus
.
Warn
(
"
D
atastore newer than "
+
path
)
case
res
.
db
:
if
c
.
config
.
ClusterReset
{
logrus
.
Infof
(
"Cluster reset: replacing file on disk: "
+
path
)
...
...
@@ -448,7 +450,7 @@ func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker,
}
newerOnDisk
=
append
(
newerOnDisk
,
path
)
case
res
.
conflict
:
logrus
.
Warnf
(
"
d
atastore / disk conflict: %s newer than in the datastore"
,
path
)
logrus
.
Warnf
(
"
D
atastore / disk conflict: %s newer than in the datastore"
,
path
)
}
}
...
...
@@ -457,7 +459,7 @@ func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker,
}
if
updateDisk
{
logrus
.
Warn
(
"
u
pdating bootstrap data on disk from datastore"
)
logrus
.
Warn
(
"
U
pdating bootstrap data on disk from datastore"
)
return
bootstrap
.
WriteToDiskFromStorage
(
files
,
crb
)
}
...
...
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