diff --git a/events/interfaces.go b/events/interfaces.go index 6e49d5ac..d4276312 100644 --- a/events/interfaces.go +++ b/events/interfaces.go @@ -1,6 +1,8 @@ package events import ( + "time" + logger "github.com/sirupsen/logrus" "k8s.io/cli-runtime/pkg/resource" ) @@ -12,14 +14,17 @@ type Helper interface { // that already contains default fields for the current action. Log() *logger.Entry + // Sleep pauses the current goroutine for at least the given duration and logs that. + Sleep(time.Duration) + // Cleanup registers a function to be called when the action complete or later. // Cleanup functions registered from within the same action will be called in last added, // first called order. Cleanup(f func(), args ...interface{}) // SpawnAs respawns the process as name and run another action. - // An action cannot spawn itself to avoid an infinite loop. - SpawnAs(name string, action string) error + // An action must not spawn itself to avoid an infinite loop. + SpawnAs(name string, action string, args ...string) error // ResourceBuilder returns a k8s' resource.Builder. ResourceBuilder() *resource.Builder