From 14bbcece1553b765ec888bda7a149c3296797b06 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Fri, 19 Mar 2021 23:20:15 -0500 Subject: [PATCH 1/2] Fix copy/paste typo --- protokube/pkg/protokube/channels.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protokube/pkg/protokube/channels.go b/protokube/pkg/protokube/channels.go index 7ee58c6315..478d6e795b 100644 --- a/protokube/pkg/protokube/channels.go +++ b/protokube/pkg/protokube/channels.go @@ -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 From 7f32b2a211e5c43bfee732ffa6f7cb23e42fbbd8 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Fri, 19 Mar 2021 23:22:19 -0500 Subject: [PATCH 2/2] Only log HasLifecycle details if it is worthy of a warning --- upup/pkg/fi/executor.go | 2 +- upup/pkg/fi/task.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/upup/pkg/fi/executor.go b/upup/pkg/fi/executor.go index db1d6321aa..16c2d5a286 100644 --- a/upup/pkg/fi/executor.go +++ b/upup/pkg/fi/executor.go @@ -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) } diff --git a/upup/pkg/fi/task.go b/upup/pkg/fi/task.go index 6d561a6619..aaa3863c6c 100644 --- a/upup/pkg/fi/task.go +++ b/upup/pkg/fi/task.go @@ -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) }