Documentation ¶
Index ¶
- Constants
- func CheckDeploymentReady(deployment *appsv1.Deployment) bool
- func ConditionsChanged(originalValues, newValues map[v1.ConditionType]v12.ConditionStatus) bool
- func ContainsStringValue(values []string, value string) bool
- func DeployClusterResources() bool
- func GetConditionValues(conditionList []v1.Condition) map[v1.ConditionType]v12.ConditionStatus
- func IsMutable(obj runtime.Object) bool
- func IsUpgrading(crStatus *api.Status) bool
- func LogJSONDiff(logger logr.Logger, objA, objB interface{})
- func MarkCrDeploying(crStatus *api.Status, reason, message string)
- func MarkCrFailed(crStatus *api.Status, reason, message string)
- func MarkCrFailedHealing(crStatus *api.Status, reason, message string)
- func MarkCrHealthyMessage(crStatus *api.Status, reason, message string)
- func MarkCrUpgradeHealingDegraded(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]v12.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]v12.ConditionStatus
GetConditionValues gets the conditions and put them into a map for easy comparison
func IsUpgrading ¶
IsUpgrading checks whether cr status represents upgrade in progress
func LogJSONDiff ¶
func MarkCrDeploying ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶ added in v0.0.3
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