Skip to content

Commit

Permalink
Merge pull request #2035 from cgwalters/spec-partial
Browse files Browse the repository at this point in the history
Bug 1873288: server: Target the spec configuration if we have at least one node
  • Loading branch information
openshift-merge-robot committed Nov 6, 2020
2 parents 44727c9 + 4bd204d commit ba0a056
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/server/cluster_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ func (cs *clusterServer) GetConfig(cr poolRequest) (*runtime.RawExtension, error
return nil, fmt.Errorf("could not fetch pool. err: %v", err)
}

currConf := mp.Status.Configuration.Name
// For new nodes, we roll out the latest if at least one node has successfully updated.
// This avoids deadlocks in situations where the old configuration broke somehow
// (e.g. pull secret expired)
// and also avoids provisioning a new node, only to update it not long thereafter.
var currConf string
if mp.Status.UpdatedMachineCount > 0 {
currConf = mp.Spec.Configuration.Name
} else {
currConf = mp.Status.Configuration.Name
}

mc, err := cs.machineClient.MachineConfigs().Get(context.TODO(), currConf, metav1.GetOptions{})
if err != nil {
Expand Down

0 comments on commit ba0a056

Please sign in to comment.