sdk

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
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 ContainsStringValue(values []string, value string) bool

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 IsMutable

func IsMutable(obj runtime.Object) bool

func IsUpgrading

func IsUpgrading(crStatus *api.Status) bool

IsUpgrading checks whether cr status represents upgrade in progress

func LogJSONDiff

func LogJSONDiff(logger logr.Logger, objA, objB interface{})

func MarkCrDeploying

func MarkCrDeploying(crStatus *api.Status, reason, message string)

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(crStatus *api.Status, reason, message string)

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(crStatus *api.Status, reason, message string)

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(crStatus *api.Status, reason, message string)

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(crStatus *api.Status, reason, message string)

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 MergeLabelsAndAnnotations

func MergeLabelsAndAnnotations(src, dest metav1.Object)

func MergeObject

func MergeObject(desiredObj, currentObj runtime.Object, lastAppliedConfigAnnotation string) (runtime.Object, error)

func NewDefaultInstance

func NewDefaultInstance(obj runtime.Object) runtime.Object

func NewIgnoreLeaderElectionPredicate

func NewIgnoreLeaderElectionPredicate() predicate.Predicate

NewIgnoreLeaderElectionPredicate returns a predicate used for ignoring leader election resources

func SameResource

func SameResource(obj1, obj2 runtime.Object) bool

func SetLabel

func SetLabel(key, value string, obj metav1.Object)

func SetLastAppliedConfiguration added in v0.0.3

func SetLastAppliedConfiguration(obj metav1.Object, lastAppliedConfigAnnotation string) error

SetLastAppliedConfiguration writes last applied configuration to given annotation

func StripStatusByte

func StripStatusByte(in []byte) ([]byte, error)

func StripStatusFromObject

func StripStatusFromObject(obj runtime.Object) (runtime.Object, error)

Types

type IgnoreWithMeta

type IgnoreWithMeta struct {
	LabelKeys      []string
	AnnotationKeys []string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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