Documentation ¶
Index ¶
- Constants
- func CheckDeploymentReady(deployment *appsv1.Deployment) bool
- func ConditionsChanged(originalValues, newValues map[v1.ConditionType]corev1.ConditionStatus) bool
- func ContainsStringValue(values []string, value string) bool
- func DeployClusterResources() bool
- func GetConditionValues(conditionList []v1.Condition) map[v1.ConditionType]corev1.ConditionStatus
- func GetOperatorToplevel() string
- func IsMutable(obj runtime.Object) bool
- func IsUpgrading(crStatus *api.Status) bool
- func LogJSONDiff(logger logr.Logger, objA, objB interface{})
- func MarkCrDeploying(cr runtime.Object, crStatus *api.Status, reason, message string, ...)
- func MarkCrFailed(cr runtime.Object, crStatus *api.Status, reason, message string, ...)
- func MarkCrFailedHealing(cr runtime.Object, crStatus *api.Status, reason, message string, ...)
- func MarkCrHealthyMessage(cr runtime.Object, crStatus *api.Status, reason, message string, ...)
- func MarkCrUpgradeHealingDegraded(cr runtime.Object, crStatus *api.Status, reason, message string, ...)
- func MergeLabelsAndAnnotations(src, dest metav1.Object)
- func MergeObject(desiredObj, currentObj runtime.Object, lastAppliedConfigAnnotation string) (runtime.Object, error)
- func NewDefaultInstance(obj runtime.Object) runtime.Object
- func NewIgnoreLeaderElectionPredicate() predicate.Predicate
- func SameResource(obj1, obj2 runtime.Object) bool
- func SetLabel(key, value string, obj metav1.Object)
- func SetLastAppliedConfiguration(obj metav1.Object, lastAppliedConfigAnnotation string) error
- func StripStatusByte(in []byte) ([]byte, error)
- func StripStatusFromObject(obj runtime.Object) (runtime.Object, error)
- type IgnoreWithMeta
Constants ¶
const LeaderElectionAnnotation = "control-plane.alpha.kubernetes.io/leader"
LeaderElectionAnnotation is the annotatation used on resources for leader election
Variables ¶
This section is empty.
Functions ¶
func CheckDeploymentReady ¶
func CheckDeploymentReady(deployment *appsv1.Deployment) bool
func ConditionsChanged ¶
func ConditionsChanged(originalValues, newValues map[v1.ConditionType]corev1.ConditionStatus) bool
ConditionsChanged compares condition maps and return true if any of the conditions changed, false otherwise.
func ContainsStringValue ¶
func DeployClusterResources ¶
func DeployClusterResources() bool
func GetConditionValues ¶
func GetConditionValues(conditionList []v1.Condition) map[v1.ConditionType]corev1.ConditionStatus
GetConditionValues gets the conditions and put them into a map for easy comparison
func GetOperatorToplevel ¶
func GetOperatorToplevel() string
GetOperatorToplevel returns the top level source directory of the operator. Can be overridden using the environment variable "OPERATOR_DIR".
func IsUpgrading ¶
IsUpgrading checks whether cr status represents upgrade in progress
func LogJSONDiff ¶
func MarkCrDeploying ¶
func MarkCrDeploying(cr runtime.Object, crStatus *api.Status, reason, message string, recorder record.EventRecorder)
MarkCrDeploying marks the passed CR as currently deploying. The CR object needs to be updated by the caller afterwards. Deploying means the following status conditions are set: ApplicationAvailable: false Progressing: true Degraded: false
func MarkCrFailed ¶
func MarkCrFailed(cr runtime.Object, crStatus *api.Status, reason, message string, recorder record.EventRecorder)
MarkCrFailed marks the passed CR as failed and requiring human intervention. The CR object needs to be updated by the caller afterwards. Failed means the following status conditions are set: ApplicationAvailable: false Progressing: false Degraded: true
func MarkCrFailedHealing ¶
func MarkCrFailedHealing(cr runtime.Object, crStatus *api.Status, reason, message string, recorder record.EventRecorder)
MarkCrFailedHealing marks the passed CR as failed and healing. The CR object needs to be updated by the caller afterwards. FailedAndHealing means the following status conditions are set: ApplicationAvailable: false Progressing: true Degraded: true
func MarkCrHealthyMessage ¶
func MarkCrHealthyMessage(cr runtime.Object, crStatus *api.Status, reason, message string, recorder record.EventRecorder)
MarkCrHealthyMessage marks the passed in CR as healthy. The CR object needs to be updated by the caller afterwards. Healthy means the following status conditions are set: ApplicationAvailable: true Progressing: false Degraded: false
func MarkCrUpgradeHealingDegraded ¶
func MarkCrUpgradeHealingDegraded(cr runtime.Object, crStatus *api.Status, reason, message string, recorder record.EventRecorder)
MarkCrUpgradeHealingDegraded marks the passed CR as upgrading and degraded. The CR object needs to be updated by the caller afterwards. Failed means the following status conditions are set: ApplicationAvailable: true Progressing: true Degraded: true
func MergeObject ¶
func NewIgnoreLeaderElectionPredicate ¶
NewIgnoreLeaderElectionPredicate returns a predicate used for ignoring leader election resources
func SameResource ¶
func SetLastAppliedConfiguration ¶
SetLastAppliedConfiguration writes last applied configuration to given annotation
func StripStatusByte ¶
Types ¶
type IgnoreWithMeta ¶
IgnoreWithMeta ignores resources with specified labels/annotations
func (*IgnoreWithMeta) Create ¶
func (p *IgnoreWithMeta) Create(e event.CreateEvent) bool
Create implements Predicate
func (*IgnoreWithMeta) Delete ¶
func (p *IgnoreWithMeta) Delete(e event.DeleteEvent) bool
Delete implements Predicate
func (*IgnoreWithMeta) Generic ¶
func (p *IgnoreWithMeta) Generic(e event.GenericEvent) bool
Generic implements Predicate
func (*IgnoreWithMeta) Update ¶
func (p *IgnoreWithMeta) Update(e event.UpdateEvent) bool
Update implements Predicate