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

only employ healthcheck for zones when not a freshsetup #330

Merged
merged 1 commit into from
Oct 10, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pkg/apis/minio.min.io/v1/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func ExtractTar(filesToExtract []string, basePath, tarFileName string) error {
var success = len(filesToExtract)
for {
header, err := tr.Next()
if err == io.EOF {
if errors.Is(err, io.EOF) {
// only success if we have found all files
if success == 0 {
break
Expand Down
14 changes: 11 additions & 3 deletions pkg/controller/cluster/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ func (c *Controller) syncHandler(key string) error {
// For each zone check if there is a stateful set
var totalReplicas int32
var images []string
var freshSetup bool
for i, 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 All @@ -951,10 +952,17 @@ func (c *Controller) syncHandler(key string) error {
return err
}

klog.V(2).Infof("Deploying zone %s", zone.Name)
klog.Infof("Deploying zone %s", zone.Name)

// Check healthcheck for previous zone, if they are online before adding this zone.
if i > 0 && !tenant.MinIOHealthCheck() {
if i == 0 {
// Fresh setup only if zone1 is not yet deployed.
freshSetup = true
}

// Check healthcheck for previous zone only if its not a fresh setup,
// if they are online before adding this zone.
if !freshSetup && !tenant.MinIOHealthCheck() {
klog.Infof("Deploying zone failed %s", zone.Name)
return ErrMinIONotReady
}

Expand Down