Documentation
¶
Overview ¶
The status package provides implementations for discovering and updating the CommonStatus on an Addon.
Index ¶
- Constants
- func GetConditions(instance runtime.Object) ([]metav1.Condition, error)
- func NewAggregator(_ client.Client) *aggregator
- func NewBasic(client client.Client) declarative.Statusdeprecated
- func NewBasicVersionChecks(client client.Client, version string) (declarative.Status, error)
- func NewKstatusAgregator(_ client.Client, _ *declarative.Reconciler) *kstatusAggregator
- func NewKstatusCheck(client client.Client, d *declarative.Reconciler) declarative.Status
- func NewOpenKstatusAgregator(gvkCMs map[string]status.GetConditionsFn, ...) *kstatusAggregator
- func NewVersionCheck(client client.Client, operatorVersionString string) (*versionCheck, error)
- func SetConditions(instance runtime.Object, newConditions []metav1.Condition) error
- type AbnormalConditionsMethod
Constants ¶
const ( AbnormalReason = "ManifestsNotReady" NormalReason = "Normal" ReadyType = "Ready" )
Variables ¶
This section is empty.
Functions ¶
func GetConditions ¶
GetConditions pulls out the `status.conditions` field from runtime.Object
func NewAggregator ¶
NewAggregator provides an implementation of declarative.Reconciled that aggregates the status of deployed objects to configure the 'Healthy' field on an addon that derives from CommonStatus
TODO: Create a version that doesn't require the unused client arg
func NewBasic
deprecated
func NewBasic(client client.Client) declarative.Status
NewBasic provides an implementation of declarative.Status that performs no preflight checks.
Deprecated: This function exists for backward compatibility, please use NewKstatusCheck
func NewBasicVersionChecks ¶
NewBasicVersionCheck provides an implementation of declarative.Status that performs version checks for the version of the operator that the manifest requires.
func NewKstatusAgregator ¶
func NewKstatusAgregator(_ client.Client, _ *declarative.Reconciler) *kstatusAggregator
TODO: Create a version that doesn't need reconciler or client?
func NewKstatusCheck ¶
func NewKstatusCheck(client client.Client, d *declarative.Reconciler) declarative.Status
TODO: Create a version that doesn't take (unusued) client & reconciler args
func NewOpenKstatusAgregator ¶
func NewOpenKstatusAgregator(gvkCMs map[string]status.GetConditionsFn, gvkACMs map[string]AbnormalConditionsMethod) *kstatusAggregator
NewOpenKstatusAgregator creates a kstatusAggregator with support for supplied gvk string specific 'Compute' and 'AbnormalConditions' methods Compute and Abnormal conditions methods should be supplied in assocation with a string of an explicit k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind (GVK) string
e.g. computMethods := make(map[string]GetConditionsFn) abnormalConditionsMethods := make(map[string]AbnormalConditionsMethod)
resourceGVK := schema.GroupVersionKind{...} computMethods[resourceGVK.String()] = <user supplied gvk specific 'Compute' method> abnormalConditionsMethods[resourceGVK.String()] = <user supplied gvk specific Abnormal Conditions method>
statusBuilder := &declarative.StatusBuilder {
BuildStatusImpl: status.NewOpenKStatusAggregator(computeMethods, abnormalConditionsMethods),
}
...
return r.Reconciler.Init(
WithStatus(statusBuilder),
)
func NewVersionCheck ¶
NewVersionCheck provides an implementation of declarative.Reconciled that checks the version of the operator if it is up to the version required by the manifest
Types ¶
type AbnormalConditionsMethod ¶
type AbnormalConditionsMethod func(ctx context.Context, unstruct *unstructured.Unstructured) []status.Condition
Returns the set of abnormal conditions for a given resource. abnormal conditions reflect any condition indicating an other than nominal state