diff --git a/pkg/events/events.go b/pkg/events/events.go index 4268fcff0..d0a0e5dbf 100644 --- a/pkg/events/events.go +++ b/pkg/events/events.go @@ -37,6 +37,8 @@ const ( ClusterctlType // IsogenType event emitted by Isogen executor IsogenType + // BootstrapType event emitted by Bootstrap executor + BootstrapType ) // Event holds all possible events that can be produced by airship @@ -48,6 +50,7 @@ type Event struct { StatusPollerEvent statuspollerevent.Event ClusterctlEvent ClusterctlEvent IsogenEvent IsogenEvent + BootstrapEvent BootstrapEvent } // NewEvent create new event with timestamp @@ -120,3 +123,32 @@ func (e Event) WithIsogenEvent(concreteEvent IsogenEvent) Event { e.IsogenEvent = concreteEvent return e } + +// BootstrapOperation type +type BootstrapOperation int + +const ( + // BootstrapStart operation + BootstrapStart BootstrapOperation = iota + // BootstrapDryRun operation + BootstrapDryRun + // BootstrapValidation operation + BootstrapValidation + // BootstrapRun operation + BootstrapRun + // BootstrapEnd operation + BootstrapEnd +) + +// BootstrapEvent needs to to track events in bootstrap executor +type BootstrapEvent struct { + Operation BootstrapOperation + Message string +} + +// WithBootstrapEvent sets type and actual bootstrap event +func (e Event) WithBootstrapEvent(concreteEvent BootstrapEvent) Event { + e.Type = BootstrapType + e.BootstrapEvent = concreteEvent + return e +} diff --git a/pkg/events/processor.go b/pkg/events/processor.go index 4f1056143..04890e5c5 100644 --- a/pkg/events/processor.go +++ b/pkg/events/processor.go @@ -59,6 +59,8 @@ func (p *DefaultProcessor) Process(ch <-chan Event) error { // Stringer interface or AsYAML for further processing. // For now we print the event object as is log.Printf("Received event: %v", e) + case BootstrapType: + log.Printf("%s", e.BootstrapEvent.Message) case StatusPollerType: log.Fatalf("Processing for status poller events are not yet implemented") case WaitType: