Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger restart for new zone args when setup is not fresh #319

Merged
merged 1 commit into from
Oct 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/controller/cluster/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ func (c *Controller) syncHandler(key string) error {
// For each zone check if it's a stateful set
var totalReplicas int32
var images []string
freshSetup := true
for _, zone := range tenant.Spec.Zones {
// Get the StatefulSet with the name specified in Tenant.spec
ss, err := c.statefulSetLister.StatefulSets(tenant.Namespace).Get(tenant.ZoneStatefulsetName(&zone))
Expand Down Expand Up @@ -960,12 +961,17 @@ func (c *Controller) syncHandler(key string) error {
return err
}

// Restart the services to fetch the new args, ignore any error.
_ = adminClnt.ServiceRestart(ctx)
if !freshSetup {
// Restart the services to fetch the new args, ignore any error.
// only perform `restart()` of server deployment when we are truly
// expanding an existing deployment.
_ = adminClnt.ServiceRestart(ctx)
}
} else {
return err
}
} else {
freshSetup = false
if zone.Servers != *ss.Spec.Replicas {
// warn the user that replica count of an existing zone can't be changed
if tenant, err = c.updateTenantStatus(ctx, tenant, fmt.Sprintf("Can't modify server count for zone %s", zone.Name), 0); err != nil {
Expand Down