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.
Index ¶
- Constants
- func NewClusterOperatorStatusCondition(conditionType configv1.ClusterStatusConditionType, ...) configv1.ClusterOperatorStatusCondition
- type ClusterOperatorStatusClient
- func (r *ClusterOperatorStatusClient) GetOrCreateClusterOperator(ctx context.Context) (*configv1.ClusterOperator, error)
- func (r *ClusterOperatorStatusClient) SetStatusAvailable(ctx context.Context, availableConditionMsg string) error
- func (r *ClusterOperatorStatusClient) SetStatusDegraded(ctx context.Context, reconcileErr error) error
- func (r *ClusterOperatorStatusClient) SyncStatus(ctx context.Context, co *configv1.ClusterOperator, ...) error
Constants ¶
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 NewClusterOperatorStatusCondition ¶
func NewClusterOperatorStatusCondition(conditionType configv1.ClusterStatusConditionType, conditionStatus configv1.ConditionStatus, reason string, message string) configv1.ClusterOperatorStatusCondition
NewClusterOperatorStatusCondition creates a new ClusterOperatorStatusCondition.
Types ¶
type ClusterOperatorStatusClient ¶
type ClusterOperatorStatusClient struct { client.Client Recorder record.EventRecorder ManagedNamespace string ReleaseVersion string }
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) SetStatusAvailable ¶
func (r *ClusterOperatorStatusClient) SetStatusAvailable(ctx context.Context, availableConditionMsg string) 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) 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 ¶
func (r *ClusterOperatorStatusClient) SyncStatus(ctx context.Context, co *configv1.ClusterOperator, conds []configv1.ClusterOperatorStatusCondition) error
SyncStatus applies the new condition to the ClusterOperator object.