...

Source file src/github.com/openshift/custom-resource-status/conditions/v1/types.go

Documentation: github.com/openshift/custom-resource-status/conditions/v1

     1  package v1
     2  
     3  import (
     4  	corev1 "k8s.io/api/core/v1"
     5  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     6  )
     7  
     8  // Condition represents the state of the operator's
     9  // reconciliation functionality.
    10  // +k8s:deepcopy-gen=true
    11  type Condition struct {
    12  	Type ConditionType `json:"type" description:"type of condition ie. Available|Progressing|Degraded."`
    13  
    14  	Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"`
    15  
    16  	// +optional
    17  	Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`
    18  
    19  	// +optional
    20  	Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"`
    21  
    22  	// +optional
    23  	LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime" description:"last time we got an update on a given condition"`
    24  
    25  	// +optional
    26  	LastTransitionTime metav1.Time `json:"lastTransitionTime" description:"last time the condition transit from one status to another"`
    27  }
    28  
    29  // ConditionType is the state of the operator's reconciliation functionality.
    30  type ConditionType string
    31  
    32  const (
    33  	// ConditionAvailable indicates that the resources maintained by the operator,
    34  	// is functional and available in the cluster.
    35  	ConditionAvailable ConditionType = "Available"
    36  
    37  	// ConditionProgressing indicates that the operator is actively making changes to the resources maintained by the
    38  	// operator
    39  	ConditionProgressing ConditionType = "Progressing"
    40  
    41  	// ConditionDegraded indicates that the resources maintained by the operator are not functioning completely.
    42  	// An example of a degraded state would be if not all pods in a deployment were running.
    43  	// It may still be available, but it is degraded
    44  	ConditionDegraded ConditionType = "Degraded"
    45  
    46  	// ConditionUpgradeable indicates whether the resources maintained by the operator are in a state that is safe to upgrade.
    47  	// When `False`, the resources maintained by the operator should not be upgraded and the
    48  	// message field should contain a human readable description of what the administrator should do to
    49  	// allow the operator to successfully update the resources maintained by the operator.
    50  	ConditionUpgradeable ConditionType = "Upgradeable"
    51  )
    52  

View as plain text