Adding Bootstrap Event
In preparation to the support of Bootstrap Container/Ephemeral Cluster feature, the following updates have been added: - Added Bootstrap event type, structure and method in event.go - added processing of Bootstrap event in processor.go Change-Id: Ic054f6b198648a4e1edcef71d8cfc0907bb775bc
This commit is contained in:
parent
81efbceea6
commit
ad0e87ea88
@ -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
|
||||
}
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user