Skip to content
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
9 changes: 8 additions & 1 deletion pkg/controller/node/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,13 @@ func (ctrl *Controller) syncMachineConfigPool(key string) error {
}

if machineconfigpool.Status.Configuration.Name == "" {
return fmt.Errorf("Empty Current MachineConfig")
delay := 5 * time.Second
// Previously we spammed the logs about empty pools.
// Let's just pause for a bit here to let the renderer
// initialize them.
glog.Infof("Pool %s is unconfigured, pausing %v for renderer to initialize", name, delay)
time.Sleep(delay)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# github.com/openshift/machine-config-operator/pkg/controller/node
pkg/controller/node/node_controller.go:383: Infof format %v reads arg #2, but call has 1 arg
pkg/controller/node/status.go:32: Infof format %s has arg newPool.Status of wrong type github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1.MachineConfigPoolStatus

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I dropped the status patch, did that at the last second and hadn't tested it. Doing that "right" is probably changing the operator to do the logging, as it already has the code to render things to a string.

return nil
}

// Deep-copy otherwise we are mutating our cache.
Expand Down Expand Up @@ -423,6 +429,7 @@ func (ctrl *Controller) syncMachineConfigPool(key string) error {
}

func (ctrl *Controller) setDesiredMachineConfigAnnotation(nodeName, currentConfig string) error {
glog.Infof("Setting node %s to desired config %s", nodeName, currentConfig)
return clientretry.RetryOnConflict(nodeUpdateBackoff, func() error {
oldNode, err := ctrl.kubeClient.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/node/node_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ func TestEmptyCurrentMachineConfig(t *testing.T) {
mcp := newMachineConfigPool("test-cluster-master", metav1.AddLabelToSelector(&metav1.LabelSelector{}, "node-role", "master"), intStrPtr(intstr.FromInt(1)), "")
f.mcpLister = append(f.mcpLister, mcp)
f.objects = append(f.objects, mcp)
f.runExpectError(getKey(mcp, t))
f.run(getKey(mcp, t))
}

func TestPaused(t *testing.T) {
Expand Down