mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 15:06:23 +00:00
Fix etcd snapshot
This commit is contained in:
committed by
Alena Prokharchyk
parent
deb3518d78
commit
f0572f48b4
@@ -129,7 +129,10 @@ func (c *Cluster) setClusterServicesDefaults() {
|
||||
c.Services.Etcd.Image = c.SystemImages.Etcd
|
||||
|
||||
// enable etcd snapshots by default
|
||||
c.Services.Etcd.Snapshot = DefaultEtcdSnapshot
|
||||
if c.Services.Etcd.Snapshot == nil {
|
||||
defaultSnapshot := DefaultEtcdSnapshot
|
||||
c.Services.Etcd.Snapshot = &defaultSnapshot
|
||||
}
|
||||
|
||||
serviceConfigDefaultsMap := map[*string]string{
|
||||
&c.Services.KubeAPI.ServiceClusterIPRange: DefaultServiceClusterIPRange,
|
||||
|
@@ -30,7 +30,7 @@ const (
|
||||
|
||||
type EtcdSnapshot struct {
|
||||
// Enable or disable snapshot creation
|
||||
Snapshot bool
|
||||
Snapshot *bool
|
||||
// Creation period of the etcd snapshots
|
||||
Creation string
|
||||
// Retention period of the etcd snapshots
|
||||
@@ -56,7 +56,7 @@ func RunEtcdPlane(
|
||||
if err := docker.DoRunContainer(ctx, host.DClient, imageCfg, hostCfg, EtcdContainerName, host.Address, ETCDRole, prsMap); err != nil {
|
||||
return err
|
||||
}
|
||||
if etcdSnapshot.Snapshot {
|
||||
if *etcdSnapshot.Snapshot == true {
|
||||
if err := RunEtcdSnapshotSave(ctx, host, prsMap, alpineImage, etcdSnapshot.Creation, etcdSnapshot.Retention, EtcdSnapshotContainerName, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user