status

package
v0.0.0-...-7332544 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthStatusHandler

type AuthStatusHandler struct {
	// contains filtered or unexported fields
}

func NewAuthStatusHandler

func NewAuthStatusHandler(authnClient configv1client.AuthenticationInterface, componentName, componentNamespace, fieldManager string) *AuthStatusHandler

NewAuthStatusHandler creates a handler for updating the Authentication.config.openshift.io status with information about the expected and currently used OIDC client. Not thread safe, only use in controllers with a single worker!

func (*AuthStatusHandler) Apply

func (c *AuthStatusHandler) Apply(ctx context.Context, authnConfig *configv1.Authentication) error

func (*AuthStatusHandler) Available

func (c *AuthStatusHandler) Available(reason, message string)

Available sets the Available condition to True, and Progressing and Degraded to False

func (*AuthStatusHandler) Degraded

func (c *AuthStatusHandler) Degraded(reason, message string)

Degraded sets the Degraded condition to True and Progressing to False

func (*AuthStatusHandler) Progressing

func (c *AuthStatusHandler) Progressing(reason, message string)

Progressing sets the Progressing condition to True and Degraded to False

func (*AuthStatusHandler) Unavailable

func (c *AuthStatusHandler) Unavailable(reason, message string)

Unavailable sets all conditions to False

func (*AuthStatusHandler) WithCurrentOIDCClient

func (c *AuthStatusHandler) WithCurrentOIDCClient(currentClientID string)

type ConditionUpdate

type ConditionUpdate struct {
	ConditionType  string
	StatusUpdateFn v1helpers.UpdateStatusFunc
}

func HandleAvailable

func HandleAvailable(typePrefix string, reason string, err error) ConditionUpdate

func HandleDegraded

func HandleDegraded(typePrefix string, reason string, err error) ConditionUpdate

handleDegraded(), handleProgressing(), handleAvailable() each take a typePrefix string representing "category" and a reason string, representing the actual problem. the provided err will be used as the detailed message body if it is not nil note that available status is desired to be true, where degraded & progressing are desired to be false example:

c.handleDegraded(operatorConfig, "RouteStatus", "FailedHost", error.New("route is not available at canonical host..."))

generates:

  • Type RouteStatusDegraded Status: true Reason: Failedhost Message: error string value is used as message

all degraded suffix conditions will be aggregated into a final "Degraded" status that will be set on the console ClusterOperator

func HandleProgressing

func HandleProgressing(typePrefix string, reason string, err error) ConditionUpdate

func HandleProgressingOrDegraded

func HandleProgressingOrDegraded(typePrefix string, reason string, err error) []ConditionUpdate

HandleProgressingOrDegraded exists until we remove type SyncError If isSyncError - Type suffix will be set to Progressing if it is any other kind of error - Type suffix will be set to Degraded TODO: when we eliminate the special case SyncError, this helper can go away. When we do that, however, we must make sure to register deprecated conditions with NewRemoveStaleConditions()

func HandleUpgradable

func HandleUpgradable(typePrefix string, reason string, err error) ConditionUpdate

type StatusHandler

type StatusHandler struct {
	// contains filtered or unexported fields
}

func NewStatusHandler

func NewStatusHandler(client v1helpers.OperatorClient) StatusHandler

func (*StatusHandler) AddCondition

func (c *StatusHandler) AddCondition(conditionUpdate ConditionUpdate)

func (*StatusHandler) AddConditions

func (c *StatusHandler) AddConditions(conditionUpdates []ConditionUpdate)

func (*StatusHandler) FlushAndReturn

func (c *StatusHandler) FlushAndReturn(returnErr error) error

func (*StatusHandler) ResetConditions

func (c *StatusHandler) ResetConditions(conditions []operatorsv1.OperatorCondition) []ConditionUpdate

func (*StatusHandler) UpdateDeploymentGeneration

func (c *StatusHandler) UpdateDeploymentGeneration(actualDeployment *appsv1.Deployment)

func (*StatusHandler) UpdateObservedGeneration

func (c *StatusHandler) UpdateObservedGeneration(newObservedGeneration int64)

func (*StatusHandler) UpdateReadyReplicas

func (c *StatusHandler) UpdateReadyReplicas(newReadyReplicas int32)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL