Skip to content

Commit

Permalink
Log statement at start of tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
seans3 committed Jun 25, 2021
1 parent 9b30e8b commit afa0ba9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apply/task/delete_inv_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (i *DeleteInvTask) Identifiers() []object.ObjMetadata {
// Start deletes the inventory object from the cluster.
func (i *DeleteInvTask) Start(taskContext *taskrunner.TaskContext) {
go func() {
klog.V(4).Infof("delete inventory object (%s/%s)", i.InvInfo.Namespace(), i.InvInfo.Name())
klog.V(2).Infoln("starting delete inventory task")
err := i.InvClient.DeleteInventoryObj(i.InvInfo)
taskContext.TaskChannel() <- taskrunner.TaskResult{Err: err}
}()
Expand Down
1 change: 1 addition & 0 deletions pkg/apply/task/inv_add_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (i *InvAddTask) Identifiers() []object.ObjMetadata {
// into the current inventory.
func (i *InvAddTask) Start(taskContext *taskrunner.TaskContext) {
go func() {
klog.V(2).Infoln("starting inventory add task")
if err := inventory.ValidateNoInventory(i.Objects); err != nil {
taskContext.TaskChannel() <- taskrunner.TaskResult{Err: err}
return
Expand Down
1 change: 1 addition & 0 deletions pkg/apply/task/inv_set_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (i *InvSetTask) Identifiers() []object.ObjMetadata {
// and prune tasks have completed.
func (i *InvSetTask) Start(taskContext *taskrunner.TaskContext) {
go func() {
klog.V(2).Infoln("starting inventory replace task")
appliedObjs := taskContext.AppliedResources()
klog.V(4).Infof("set inventory %d applied objects", len(appliedObjs))
pruneFailures := taskContext.PruneFailures()
Expand Down
2 changes: 2 additions & 0 deletions pkg/apply/taskrunner/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/restmapper"
"k8s.io/klog/v2"
"sigs.k8s.io/cli-utils/pkg/apply/event"
"sigs.k8s.io/cli-utils/pkg/kstatus/status"
"sigs.k8s.io/cli-utils/pkg/object"
Expand Down Expand Up @@ -93,6 +94,7 @@ func (w *WaitTask) Identifiers() []object.ObjMetadata {
// Start kicks off the task. For the wait task, this just means
// setting up the timeout timer.
func (w *WaitTask) Start(taskContext *TaskContext) {
klog.V(2).Infof("starting wait task (%d objects)", len(w.Ids))
w.setTimer(taskContext)
}

Expand Down

0 comments on commit afa0ba9

Please sign in to comment.