resources: Check that resource kind is set.
This could be a Fatal instead, but might as well fail gracefully.
This commit is contained in:
@@ -175,6 +175,9 @@ func (obj *BaseUUID) Reversed() bool {
|
|||||||
|
|
||||||
// Init initializes structures like channels if created without New constructor.
|
// Init initializes structures like channels if created without New constructor.
|
||||||
func (obj *BaseRes) Init() error {
|
func (obj *BaseRes) Init() error {
|
||||||
|
if obj.kind == "" {
|
||||||
|
return fmt.Errorf("Resource did not set kind!")
|
||||||
|
}
|
||||||
obj.events = make(chan event.Event) // unbuffered chan size to avoid stale events
|
obj.events = make(chan event.Event) // unbuffered chan size to avoid stale events
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user