operatorstatus

package
v0.0.0-...-41e59f4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2024 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2026 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// ReasonAsExpected is the reason for the condition when the operator is in a normal state.
	ReasonAsExpected = "AsExpected"

	// ReasonInitializing is the reason for the condition when the operator is initializing.
	ReasonInitializing = "Initializing"

	// ReasonSyncing is the reason for the condition when the operator is syncing resources.
	ReasonSyncing = "SyncingResources"

	// ReasonSyncFailed is the reason for the condition when the operator failed to sync resources.
	ReasonSyncFailed = "SyncingFailed"
)

Variables

This section is empty.

Functions

func ClusterOperatorOnceOnly

func ClusterOperatorOnceOnly() predicate.Funcs

ClusterOperatorOnceOnly returns a predicate function for the cluster-api ClusterOperator that only matches create events. This predicate will always match once when the manager starts, but will not trigger on subsequent updates to the ClusterOperator object. Controllers should use this predicate when their reconcile logic does not depend on the current state of the ClusterOperator object, and they just need to be triggered initially when the manager starts.

func NewClusterOperatorStatusCondition

func NewClusterOperatorStatusCondition(conditionType configv1.ClusterStatusConditionType,
	conditionStatus configv1.ConditionStatus, reason string,
	message string) configv1.ClusterOperatorStatusCondition

NewClusterOperatorStatusCondition creates a new ClusterOperatorStatusCondition.

func ToClusterOperator

func ToClusterOperator(_ context.Context, _ client.Object) []reconcile.Request

ToClusterOperator unconditionally returns a reconcile request for the cluster-api ClusterOperator.

Types

type ClusterOperatorStatusClient

type ClusterOperatorStatusClient struct {
	client.Client
	Recorder          record.EventRecorder
	ManagedNamespace  string
	OperatorNamespace string
	ReleaseVersion    string
	Platform          configv1.PlatformType
}

ClusterOperatorStatusClient is a client for managing the status of the ClusterOperator object.

func (*ClusterOperatorStatusClient) GetOrCreateClusterOperator

func (r *ClusterOperatorStatusClient) GetOrCreateClusterOperator(ctx context.Context) (*configv1.ClusterOperator, error)

GetOrCreateClusterOperator is responsible for fetching the cluster operator should it exist, or creating a new cluster operator if it does not already exist.

func (*ClusterOperatorStatusClient) OperandVersions

func (r *ClusterOperatorStatusClient) OperandVersions() []configv1.OperandVersion

OperandVersions returns the operand versions for the ClusterOperator.

func (*ClusterOperatorStatusClient) RelatedObjects

RelatedObjects returns the related objects for the ClusterOperator. This data is currently arbitrarily written by the corecluster controller.

func (*ClusterOperatorStatusClient) SetStatusAvailable

func (r *ClusterOperatorStatusClient) SetStatusAvailable(ctx context.Context, availableConditionMsg string, opts ...SyncStatusOption) error

SetStatusAvailable sets the Available condition to True, with the given reason and message, and sets both the Progressing and Degraded conditions to False.

func (*ClusterOperatorStatusClient) SetStatusDegraded

func (r *ClusterOperatorStatusClient) SetStatusDegraded(ctx context.Context, reconcileErr error, opts ...SyncStatusOption) error

SetStatusDegraded sets the Degraded condition to True, with the given reason and message, and sets the upgradeable condition. It does not modify any existing Available or Progressing conditions.

func (*ClusterOperatorStatusClient) SyncStatus

SyncStatus performs a full sync of the ClusterOperator object if any of the conditions, versions, or related objects have changed.

type SyncStatusOption

type SyncStatusOption func(*syncStatusOptions)

SyncStatusOption sets an option for the SyncStatus operation.

func WithConditions

func WithConditions(conditions []configv1.ClusterOperatorStatusCondition) SyncStatusOption

WithConditions sets conditions for a SyncStatus operation.

func WithRelatedObjects

func WithRelatedObjects(relatedObjects []configv1.ObjectReference) SyncStatusOption

WithRelatedObjects sets related objects for a SyncStatus operation.

func WithVersions

func WithVersions(versions []configv1.OperandVersion) SyncStatusOption

WithVersions sets versions for a SyncStatus operation.

Jump to

Keyboard shortcuts

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