mirror of
https://github.com/rancher/rke.git
synced 2025-09-02 15:34:36 +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
|
c.Services.Etcd.Image = c.SystemImages.Etcd
|
||||||
|
|
||||||
// enable etcd snapshots by default
|
// 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{
|
serviceConfigDefaultsMap := map[*string]string{
|
||||||
&c.Services.KubeAPI.ServiceClusterIPRange: DefaultServiceClusterIPRange,
|
&c.Services.KubeAPI.ServiceClusterIPRange: DefaultServiceClusterIPRange,
|
||||||
|
@@ -30,7 +30,7 @@ const (
|
|||||||
|
|
||||||
type EtcdSnapshot struct {
|
type EtcdSnapshot struct {
|
||||||
// Enable or disable snapshot creation
|
// Enable or disable snapshot creation
|
||||||
Snapshot bool
|
Snapshot *bool
|
||||||
// Creation period of the etcd snapshots
|
// Creation period of the etcd snapshots
|
||||||
Creation string
|
Creation string
|
||||||
// Retention period of the etcd snapshots
|
// 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 {
|
if err := docker.DoRunContainer(ctx, host.DClient, imageCfg, hostCfg, EtcdContainerName, host.Address, ETCDRole, prsMap); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if etcdSnapshot.Snapshot {
|
if *etcdSnapshot.Snapshot == true {
|
||||||
if err := RunEtcdSnapshotSave(ctx, host, prsMap, alpineImage, etcdSnapshot.Creation, etcdSnapshot.Retention, EtcdSnapshotContainerName, false); err != nil {
|
if err := RunEtcdSnapshotSave(ctx, host, prsMap, alpineImage, etcdSnapshot.Creation, etcdSnapshot.Retention, EtcdSnapshotContainerName, false); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user