Skip to content

Commit

Permalink
fix: verify image versions instead of repository (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored Feb 13, 2023
1 parent e1da24b commit 265eaa7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/controller/cluster/main-controller.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020, MinIO, Inc.
// Copyright (C) 2020-2023 MinIO, Inc.
//
// This code is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License, version 3,
Expand Down Expand Up @@ -1029,7 +1029,17 @@ func (c *Controller) syncHandler(key string) error {

// In loop above we compared all the versions in all pools.
// So comparing tenant.Spec.Image (version to update to) against one value from images slice is fine.
if tenant.Spec.Image != images[0] && tenant.Status.CurrentState != StatusUpdatingMinIOVersion {
ssImages := strings.Split(images[0], ":")
specImages := strings.Split(tenant.Spec.Image, ":")
var ssImage string
var specImage string
if len(specImages) > 1 {
specImage = specImages[1]
}
if len(ssImages) > 1 {
ssImage = ssImages[1]
}
if specImage != ssImage && tenant.Status.CurrentState != StatusUpdatingMinIOVersion {
if !tenant.MinIOHealthCheck(c.getTransport()) {
klog.Infof("%s is not running can't update image online", key)
return ErrMinIONotReady
Expand Down

0 comments on commit 265eaa7

Please sign in to comment.