Skip to content

Commit

Permalink
cluster: check config before reload
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa committed Mar 4, 2021
1 parent d02d837 commit 1771ea9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/manager/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func buildRefreshMonitoredConfigTasks(
return tasks
}

func buildRegenConfigTasks(m *Manager, name string, topo spec.Topology, base *spec.BaseMeta, nodes []string) ([]*task.StepDisplay, bool) {
func buildRegenConfigTasks(m *Manager, name string, topo spec.Topology, base *spec.BaseMeta, nodes []string, ignoreCheck bool) ([]*task.StepDisplay, bool) {
var tasks []*task.StepDisplay
hasImported := false
deletedNodes := set.NewStringSet(nodes...)
Expand Down Expand Up @@ -500,7 +500,7 @@ func buildRegenConfigTasks(m *Manager, name string, topo spec.Topology, base *sp
m.specManager,
instance,
base.User,
true, // always ignore config check result in scale in
ignoreCheck,
meta.DirPaths{
Deploy: deployDir,
Data: dataDirs,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/manager/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (m *Manager) DestroyTombstone(
UpdateMeta(name, clusterMeta, nodes).
UpdateTopology(name, m.specManager.Path(name), clusterMeta, nodes)

regenConfigTasks, _ := buildRegenConfigTasks(m, name, topo, base, nodes)
regenConfigTasks, _ := buildRegenConfigTasks(m, name, topo, base, nodes, true)
t := b.
ParallelStep("+ Refresh instance configs", true, regenConfigTasks...).
Parallel(true, buildReloadPromTasks(metadata.GetTopology())...).
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/manager/reload.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (m *Manager) Reload(name string, opt operator.Options, skipRestart bool) er
}
})

refreshConfigTasks, hasImported := buildRegenConfigTasks(m, name, topo, base, nil)
refreshConfigTasks, hasImported := buildRegenConfigTasks(m, name, topo, base, nil, false)
monitorConfigTasks := buildRefreshMonitoredConfigTasks(
m.specManager,
name,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/manager/scale_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (m *Manager) ScaleIn(
base := metadata.GetBaseMeta()

// Regenerate configuration
regenConfigTasks, hasImported := buildRegenConfigTasks(m, name, topo, base, nodes)
regenConfigTasks, hasImported := buildRegenConfigTasks(m, name, topo, base, nodes, true)

// handle dir scheme changes
if hasImported {
Expand Down

0 comments on commit 1771ea9

Please sign in to comment.