mirror of https://github.com/k3s-io/k3s
Signed-off-by: Brian Downs <brian.downs@gmail.com>pull/4825/head
parent
bcd63e54dd
commit
5b0c1661f1
|
@ -555,6 +555,7 @@ func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker,
|
|||
}
|
||||
}
|
||||
|
||||
var newerOnDisk []string
|
||||
for path, res := range results {
|
||||
switch {
|
||||
case res.disk:
|
||||
|
@ -566,12 +567,16 @@ func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker,
|
|||
updateDisk = true
|
||||
continue
|
||||
}
|
||||
logrus.Fatal(path + " newer than datastore and could cause cluster outage. Remove the file from disk and restart to be recreated from datastore.")
|
||||
newerOnDisk = append(newerOnDisk, path)
|
||||
case res.conflict:
|
||||
logrus.Warnf("datastore / disk conflict: %s newer than in the datastore", path)
|
||||
}
|
||||
}
|
||||
|
||||
if len(newerOnDisk) > 0 {
|
||||
logrus.Fatal(strings.Join(newerOnDisk, ", ") + " newer than datastore and could cause a cluster outage. Remove the file(s) from disk and restart to be recreated from datastore.")
|
||||
}
|
||||
|
||||
if updateDisk {
|
||||
logrus.Warn("updating bootstrap data on disk from datastore")
|
||||
return bootstrap.WriteToDiskFromStorage(files, crb)
|
||||
|
|
Loading…
Reference in New Issue