Skip to content

Commit

Permalink
Merge pull request #11080 from rifelpet/logging-cleanup
Browse files Browse the repository at this point in the history
Logging cleanup
  • Loading branch information
k8s-ci-robot authored Apr 15, 2021
2 parents 857cb64 + 7f32b2a commit 465a02f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions protokube/pkg/protokube/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func applyChannel(channel string) error {
}

func execChannels(args ...string) (string, error) {
kubectlPath := "/opt/kops/bin/channels"
cmd := exec.Command(kubectlPath, args...)
channelsPath := "/opt/kops/bin/channels"
cmd := exec.Command(channelsPath, args...)
env := os.Environ()
cmd.Env = env

Expand Down
2 changes: 1 addition & 1 deletion upup/pkg/fi/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (e *executor) RunTasks(taskMap map[string]Task) error {

remaining := time.Second * time.Duration(int(time.Until(ts.deadline).Seconds()))
if _, ok := err.(*TryAgainLaterError); ok {
klog.Infof("Task %q not ready: %v", ts.key, err)
klog.V(2).Infof("Task %q not ready: %v", ts.key, err)
} else {
klog.Warningf("error running task %q (%v remaining to succeed): %v", ts.key, remaining, err)
}
Expand Down
12 changes: 6 additions & 6 deletions upup/pkg/fi/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ func (c *ModelBuilderContext) setLifecycleOverride(task Task) Task {
// TODO(@chrislovecnm) - wonder if we should update the nodeup tasks to have lifecycle
// TODO - so that we can return an error here, rather than just returning.
// certain tasks have not implemented HasLifecycle interface
hl, ok := task.(HasLifecycle)
if !ok {
klog.V(8).Infof("task %T does not implement HasLifecycle", task)
return task
}

typeName := TypeNameForTask(task)
klog.V(8).Infof("testing task %q", typeName)

// typeName can be values like "InternetGateway"
value, ok := c.LifecycleOverrides[typeName]
if ok {
hl, okHL := task.(HasLifecycle)
if !okHL {
klog.Warningf("task %T does not implement HasLifecycle", task)
return task
}

klog.Warningf("overriding task %s, lifecycle %s", task, value)
hl.SetLifecycle(value)
}
Expand Down

0 comments on commit 465a02f

Please sign in to comment.