
This adds the StatusMap type, which can be used to gather the Status of a given kubernetes resource. A StatusMap can be created from a document.Bundle and represents all possible Statuses for all CustomResources, and the conditions that must be met for those statuses to be valid. Relates-To: #73 Change-Id: If2cba0bb9890fe28feff0c890bb8036489196fc4
24 lines
594 B
Go
24 lines
594 B
Go
package cluster
|
|
|
|
import "fmt"
|
|
|
|
// ErrInvalidStatusCheck denotes that something went wrong while handling a
|
|
// status-check annotation.
|
|
type ErrInvalidStatusCheck struct {
|
|
What string
|
|
}
|
|
|
|
func (err ErrInvalidStatusCheck) Error() string {
|
|
return fmt.Sprintf("invalid status-check: %s", err.What)
|
|
}
|
|
|
|
// ErrResourceNotFound is used when a resource is requrested from a StatusMap,
|
|
// but that resource can't be found
|
|
type ErrResourceNotFound struct {
|
|
Resource string
|
|
}
|
|
|
|
func (err ErrResourceNotFound) Error() string {
|
|
return fmt.Sprintf("could not find a status for resource %q", err.Resource)
|
|
}
|