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
4 changes: 1 addition & 3 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func NewClusterDrivenDaemon(
func (dn *Daemon) Run(stop <-chan struct{}) error {
// Catch quickly if we've been asked to run once.
if dn.onceFrom != "" {
glog.V(2).Info("Running once per request")
glog.V(2).Info("Daemon running once per request")
return dn.runOnce()
}

Expand Down Expand Up @@ -236,7 +236,6 @@ func (dn *Daemon) runOnce() error {
glog.V(2).Infof("Unable to prep update: %s", err)
return err
} else if needUpdate == false {
glog.V(2).Infof("No update needed")
return nil
}
// At this point we have verified we need to update
Expand Down Expand Up @@ -287,7 +286,6 @@ func (dn *Daemon) handleNodeUpdate(old, cur interface{}) {
// Note that if executeUpdateFromCluster errors it will mark the node
// degraded and reboot.
if err = dn.executeUpdateFromCluster(); err != nil {
glog.V(2).Infof("Unable to execute update: %s", err)
return
}
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/daemon/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,18 @@ func getNodeAnnotation(client corev1.NodeInterface, node string, k string) (stri
}

// getNodeAnnotationExt is like getNodeAnnotation, but allows one to customize ENOENT handling
func getNodeAnnotationExt(client corev1.NodeInterface, node string, k string, allow_noent bool) (string, error) {
func getNodeAnnotationExt(client corev1.NodeInterface, node string, k string, allowNoent bool) (string, error) {
n, err := client.Get(node, metav1.GetOptions{})
if err != nil {
return "", err
}

v, ok := n.Annotations[k]
if !ok {
if !allow_noent {
if !allowNoent {
return "", fmt.Errorf("%s annotation not found in %s", k, node)
} else {
return "", nil
}
return "", nil
}

return v, nil
Expand Down
6 changes: 4 additions & 2 deletions pkg/daemon/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import (
)

const (
// DefaultDirectoryPermissions houses the default mode to use when no directory permissions are provided
DefaultDirectoryPermissions os.FileMode = 0755
DefaultFilePermissions os.FileMode = 0644
// DefaultFilePermissions houses the default mode to use when no file permissions are provided
DefaultFilePermissions os.FileMode = 0644
)

// update the node to the provided node configuration.
Expand Down Expand Up @@ -87,7 +89,7 @@ func (dn *Daemon) reconcilable(oldConfig, newConfig *mcfgv1.MachineConfig) (bool
// We skip out of reconcilable if there is no Kind and we are in runOnce mode. The
// reason is that there is a good chance a previous state is not available to match against.
if oldConfig.Kind == "" && dn.onceFrom != "" {
glog.Infof("Missing kind in old config. Assuming reconcilable with new.")
glog.Infof("Missing kind in old config. Assuming no prior state.")
return true, nil
}
oldIgn := oldConfig.Spec.Config
Expand Down