Skip to content

Commit

Permalink
Only return false from isUpgradeStillRunning when ALL node groups hav…
Browse files Browse the repository at this point in the history
…e same config, not just one of them
  • Loading branch information
fherbert authored and dougsland committed Mar 30, 2023
1 parent 9eb7a5c commit b90fab1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/config/node.go
Expand Up @@ -271,7 +271,7 @@ func IsTheSameConfig(nodes []v1.Node) bool {
// - kubeconfigPath as string
//
// Returns:
// - true (same config), false or error
// - true (different config - upgrade still running), false (upgrade complete) or error
func IsUpgradeStillRunning(kubeconfigPath string) (bool, error) {
nodes, err := GetNodes(kubeconfigPath)
if err != nil {
Expand All @@ -281,12 +281,13 @@ func IsUpgradeStillRunning(kubeconfigPath string) (bool, error) {
// Go to all node types identified in GetNodes()
for nodeRole := range nodes {
nodesConfigs := IsTheSameConfig(nodes[nodeRole])
if nodesConfigs {
// The configs are the same, NO RUNNING upgrade
return false, nil

if !nodesConfigs {
// at least one node group config is different
return true, nil
}
}
return true, nil
return false, nil
}

func GetIngressConfig(kubeconfigPath string, vips []string) (IngressConfig, error) {
Expand Down

0 comments on commit b90fab1

Please sign in to comment.