1
0
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:
galal-hussein
2018-11-07 02:08:38 +02:00
committed by Alena Prokharchyk
parent deb3518d78
commit f0572f48b4
2 changed files with 6 additions and 3 deletions

View File

@@ -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,

View File

@@ -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
}