Documentation ¶
Overview ¶
Package v1beta2 implements utils for metav1.Conditions that will be used starting with the v1beta2 API.
Please note that in order to make this change while respecting API deprecation rules, it is required to go through a phased approach: - Phase 1. metav1.Conditions will be added into v1beta1 API types under the Status.V1Beta2.Conditions struct (clusterv1.Conditions will remain in Status.Conditions) - Phase 2. when introducing v1beta2 API types:
- clusterv1.Conditions will be moved from Status.Conditions to Status.Deprecated.V1Beta1.Conditions
- metav1.Conditions will be moved from Status.V1Beta2.Conditions to Status.Conditions
- Phase 3. when removing v1beta1 API types, Status.Deprecated will be dropped.
Please see the proposal https://github.com/kubernetes-sigs/cluster-api/tree/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
In order to make this transition easier both for CAPI and other projects using this package, utils automatically adapt to handle objects at different stage of the transition.
Index ¶
- Constants
- func BoolToStatus(status bool) metav1.ConditionStatus
- func Delete(to Setter, conditionType string)
- func Get(sourceObj Getter, sourceConditionType string) *metav1.Condition
- func GetDefaultComputeMergeReasonFunc(issueReason, unknownReason, infoReason string) func(issueConditions []ConditionWithOwnerInfo, ...) string
- func GetDefaultMergePriorityFunc(negativePolarityConditionTypes ...string) func(condition metav1.Condition) MergePriority
- func Has(from Getter, conditionType string) bool
- func HasSameState(i, j *metav1.Condition) bool
- func IsFalse(from Getter, conditionType string) bool
- func IsTrue(from Getter, conditionType string) bool
- func IsUnknown(from Getter, conditionType string) bool
- func MatchCondition(expected metav1.Condition, opts ...MatchOption) types.GomegaMatcher
- func MatchConditions(expected []metav1.Condition, opts ...MatchOption) types.GomegaMatcher
- func NewAggregateCondition[T Getter](sourceObjs []T, sourceConditionType string, opts ...AggregateOption) (*metav1.Condition, error)
- func NewMirrorCondition(sourceObj Getter, sourceConditionType string, opts ...MirrorOption) *metav1.Condition
- func NewMirrorConditionFromUnstructured(sourceObj runtime.Unstructured, sourceConditionType string, ...) (*metav1.Condition, error)
- func NewSummaryCondition(sourceObj Getter, targetConditionType string, opts ...SummaryOption) (*metav1.Condition, error)
- func Set(targetObj Setter, condition metav1.Condition, opts ...SetOption)
- func SetAggregateCondition[T Getter](sourceObjs []T, targetObj Setter, conditionType string, ...) error
- func SetMirrorCondition(sourceObj Getter, targetObj Setter, sourceConditionType string, ...)
- func SetMirrorConditionFromUnstructured(sourceObj runtime.Unstructured, targetObj Setter, sourceConditionType string, ...) error
- func SetSummaryCondition(sourceObj Getter, targetObj Setter, targetConditionType string, ...) error
- func UnstructuredGet(sourceObj runtime.Unstructured, sourceConditionType string) (*metav1.Condition, error)
- func UnstructuredGetAll(sourceObj runtime.Unstructured) ([]metav1.Condition, error)
- type AggregateOption
- type AggregateOptions
- type ComputeReasonFunc
- type ConditionOwnerInfo
- type ConditionSortFunc
- type ConditionWithOwnerInfo
- type CustomMergeStrategy
- type DefaultMergeStrategyOption
- type DefaultMergeStrategyOptions
- type FallbackCondition
- type ForConditionTypes
- type ForceOverwrite
- type GetPriorityFunc
- type Getter
- type IgnoreLastTransitionTime
- type IgnoreTypesIfMissing
- type MatchOption
- type MatchOptions
- type MergePriority
- type MergeStrategy
- type MirrorOption
- type MirrorOptions
- type NegativePolarityConditionTypes
- type OverrideConditions
- type OwnedConditionTypes
- type Patch
- type PatchApplyOption
- type PatchApplyOptions
- type PatchOperation
- type PatchOperationType
- type SetOption
- type SetOptions
- type Setter
- type SummaryMessageTransformFunc
- type SummaryOption
- type SummaryOptions
- type TargetConditionHasPositivePolarity
- type TargetConditionType
Constants ¶
const (
// NoReasonReported identifies a clusterv1.Condition that reports no reason.
NoReasonReported = "NoReasonReported"
)
TODO: Move to the API package.
const NotYetReportedReason = "NotYetReported"
NotYetReportedReason is set on missing conditions generated during mirror, aggregate or summary operations. Missing conditions are generated during the above operations when an expected condition does not exist on a object. TODO: Move to the API package.
Variables ¶
This section is empty.
Functions ¶
func BoolToStatus ¶
func BoolToStatus(status bool) metav1.ConditionStatus
BoolToStatus converts a bool to either metav1.ConditionTrue or metav1.ConditionFalse.
func Get ¶
Get returns a condition from the object implementing the Getter interface.
Please note that Get does not support reading conditions from unstructured objects nor from API types not implementing the Getter interface. Eventually, users can implement wrappers on those types implementing this interface and taking care of aligning the condition format if necessary.
func GetDefaultComputeMergeReasonFunc ¶
func GetDefaultComputeMergeReasonFunc(issueReason, unknownReason, infoReason string) func(issueConditions []ConditionWithOwnerInfo, unknownConditions []ConditionWithOwnerInfo, infoConditions []ConditionWithOwnerInfo) string
GetDefaultComputeMergeReasonFunc return a function picking one of the three reasons in input depending on the status of the conditions being merged.
func GetDefaultMergePriorityFunc ¶
func GetDefaultMergePriorityFunc(negativePolarityConditionTypes ...string) func(condition metav1.Condition) MergePriority
GetDefaultMergePriorityFunc returns the merge priority for each condition. It assigns following priority values to conditions: - issues: conditions with positive polarity (normal True) and status False or conditions with negative polarity (normal False) and status True. - unknown: conditions with status unknown. - info: conditions with positive polarity (normal True) and status True or conditions with negative polarity (normal False) and status False.
func HasSameState ¶
HasSameState returns true if a condition has the same state of another; state is defined by the union of following fields: Type, Status, Reason, ObservedGeneration and Message (it excludes LastTransitionTime).
func IsFalse ¶
IsFalse is true if the condition with the given type is False, otherwise it returns false if the condition is not False or if the condition does not exist (is nil).
func IsTrue ¶
IsTrue is true if the condition with the given type is True, otherwise it returns false if the condition is not True or if the condition does not exist (is nil).
func IsUnknown ¶
IsUnknown is true if the condition with the given type is Unknown or if the condition does not exist (is nil).
func MatchCondition ¶
func MatchCondition(expected metav1.Condition, opts ...MatchOption) types.GomegaMatcher
MatchCondition returns a custom matcher to check equality of metav1.Condition.
func MatchConditions ¶
func MatchConditions(expected []metav1.Condition, opts ...MatchOption) types.GomegaMatcher
MatchConditions returns a custom matcher to check equality of []metav1.Condition.
func NewAggregateCondition ¶
func NewAggregateCondition[T Getter](sourceObjs []T, sourceConditionType string, opts ...AggregateOption) (*metav1.Condition, error)
NewAggregateCondition aggregates a condition from a list of objects; the given condition must have positive polarity; if the given condition does not exist in one of the source objects, missing conditions are considered Unknown, reason NotYetReported.
If the source conditions type has negative polarity, it should be indicated with the NegativePolarityConditionTypes option; in this case NegativePolarityConditionTypes must match the sourceConditionType, and by default also the resulting condition will have negative polarity.
By default, the Aggregate condition has the same type of the source condition, but this can be changed by using the TargetConditionType option.
Additionally, it is possible to inject custom merge strategies using the CustomMergeStrategy option.
func NewMirrorCondition ¶
func NewMirrorCondition(sourceObj Getter, sourceConditionType string, opts ...MirrorOption) *metav1.Condition
NewMirrorCondition create a mirror of the given condition from obj; if the given condition does not exist in the source obj, the condition specified in the FallbackCondition is used; if this option is not set, a new condition with status Unknown and reason NotYetReported is created.
By default, the Mirror condition has the same type as the source condition, but this can be changed by using the TargetConditionType option.
func NewMirrorConditionFromUnstructured ¶
func NewMirrorConditionFromUnstructured(sourceObj runtime.Unstructured, sourceConditionType string, opts ...MirrorOption) (*metav1.Condition, error)
NewMirrorConditionFromUnstructured is a convenience method create a mirror of the given condition from the unstructured source obj. It combines, UnstructuredGet, NewMirrorCondition (most specifically it uses only the logic to create a mirror condition).
func NewSummaryCondition ¶
func NewSummaryCondition(sourceObj Getter, targetConditionType string, opts ...SummaryOption) (*metav1.Condition, error)
NewSummaryCondition creates a new condition by summarizing a set of conditions from an object; the list of types of the conditions to be summarized must be provided with the ForConditionTypes option; conditions types with negative polarity, should be indicated with the NegativePolarityConditionTypes option.
If any of the condition in scope does not exist in the source object, missing conditions are considered Unknown, reason NotYetReported. Use the IgnoreTypesIfMissing to exclude types from this option.
Additionally, it is possible to inject custom merge strategies using the CustomMergeStrategy option or to add a step counter to the generated message by using the StepCounter option.
func Set ¶
Set a condition on the given object implementing the Setter interface; if the object is nil, the operation is a no-op.
When setting a condition: - condition.ObservedGeneration will be set to object.Metadata.Generation if targetObj is a metav1.Object. - If the condition does not exist and condition.LastTransitionTime is not set, time.Now is used. - If the condition already exists, condition.Status is changing and condition.LastTransitionTime is not set, time.Now is used. - If the condition already exists, condition.Status is NOT changing, all the fields can be changed except for condition.LastTransitionTime.
Additionally, Set enforces a default condition order (Available and Ready fist, everything else in alphabetical order), but this can be changed by using the ConditionSortFunc option.
Please note that Set does not support setting conditions to an unstructured object nor to API types not implementing the Setter interface. Eventually, users can implement wrappers on those types implementing this interface and taking care of aligning the condition format if necessary.
func SetAggregateCondition ¶
func SetAggregateCondition[T Getter](sourceObjs []T, targetObj Setter, conditionType string, opts ...AggregateOption) error
SetAggregateCondition is a convenience method that calls NewAggregateCondition to create an aggregate condition from the source objects, and then calls Set to add the new condition to the target object.
func SetMirrorCondition ¶
func SetMirrorCondition(sourceObj Getter, targetObj Setter, sourceConditionType string, opts ...MirrorOption)
SetMirrorCondition is a convenience method that calls NewMirrorCondition to create a mirror condition from the source object, and then calls Set to add the new condition to the target object.
func SetMirrorConditionFromUnstructured ¶
func SetMirrorConditionFromUnstructured(sourceObj runtime.Unstructured, targetObj Setter, sourceConditionType string, opts ...MirrorOption) error
SetMirrorConditionFromUnstructured is a convenience method that mirror of the given condition from the unstructured source obj into the target object. It combines, NewMirrorConditionFromUnstructured, and Set.
func SetSummaryCondition ¶
func SetSummaryCondition(sourceObj Getter, targetObj Setter, targetConditionType string, opts ...SummaryOption) error
SetSummaryCondition is a convenience method that calls NewSummaryCondition to create a summary condition from the source object, and then calls Set to add the new condition to the target object.
func UnstructuredGet ¶
func UnstructuredGet(sourceObj runtime.Unstructured, sourceConditionType string) (*metav1.Condition, error)
UnstructuredGet returns a condition from an Unstructured object.
UnstructuredGet supports retrieving conditions from objects at different stages of the transition from clusterv1.conditions to the metav1.Condition type:
- Objects with clusterv1.Conditions in status.conditions; in this case a best effort conversion to metav1.Condition is performed, just enough to allow surfacing a condition from a provider object with Mirror
- Objects with metav1.Condition in status.v1beta2.conditions
- Objects with metav1.Condition in status.conditions
func UnstructuredGetAll ¶
func UnstructuredGetAll(sourceObj runtime.Unstructured) ([]metav1.Condition, error)
UnstructuredGetAll returns conditions from an Unstructured object.
UnstructuredGetAll supports retrieving conditions from objects at different stages of the transition from clusterv1.conditions to the metav1.Condition type:
- Objects with clusterv1.Conditions in status.conditions; in this case a best effort conversion to metav1.Condition is performed, just enough to allow surfacing a condition from a provider object with Mirror
- Objects with metav1.Condition in status.v1beta2.conditions
- Objects with metav1.Condition in status.conditions
Types ¶
type AggregateOption ¶
type AggregateOption interface { // ApplyToAggregate applies this configuration to the given aggregate options. ApplyToAggregate(option *AggregateOptions) }
AggregateOption is some configuration that modifies options for a aggregate call.
type AggregateOptions ¶
type AggregateOptions struct {
// contains filtered or unexported fields
}
AggregateOptions allows to set options for the aggregate operation.
func (*AggregateOptions) ApplyOptions ¶
func (o *AggregateOptions) ApplyOptions(opts []AggregateOption) *AggregateOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type ComputeReasonFunc ¶
type ComputeReasonFunc func(issueConditions []ConditionWithOwnerInfo, unknownConditions []ConditionWithOwnerInfo, infoConditions []ConditionWithOwnerInfo) string
ComputeReasonFunc defines a function to be used when computing the reason of the condition returned by the DefaultMergeStrategy.
func (ComputeReasonFunc) ApplyToDefaultMergeStrategy ¶
func (f ComputeReasonFunc) ApplyToDefaultMergeStrategy(opts *DefaultMergeStrategyOptions)
ApplyToDefaultMergeStrategy applies this configuration to the given DefaultMergeStrategy options.
type ConditionOwnerInfo ¶
ConditionOwnerInfo contains infos about the object that owns the condition.
func (ConditionOwnerInfo) String ¶
func (o ConditionOwnerInfo) String() string
String returns a string representation of the ConditionOwnerInfo.
type ConditionSortFunc ¶
ConditionSortFunc defines the sort order when conditions are assigned to an object.
func (ConditionSortFunc) ApplyToPatchApply ¶
func (f ConditionSortFunc) ApplyToPatchApply(opts *PatchApplyOptions)
ApplyToPatchApply applies this configuration to the given patch apply options.
func (ConditionSortFunc) ApplyToSet ¶
func (f ConditionSortFunc) ApplyToSet(opts *SetOptions)
ApplyToSet applies this configuration to the given Set options.
type ConditionWithOwnerInfo ¶
type ConditionWithOwnerInfo struct { OwnerResource ConditionOwnerInfo metav1.Condition }
ConditionWithOwnerInfo is a wrapper around metav1.Condition with additional ConditionOwnerInfo. These infos can be used when generating the message resulting from the merge operation.
type CustomMergeStrategy ¶
type CustomMergeStrategy struct {
MergeStrategy
}
CustomMergeStrategy allows to define a custom merge strategy when creating new summary or aggregate conditions.
func (CustomMergeStrategy) ApplyToAggregate ¶
func (t CustomMergeStrategy) ApplyToAggregate(opts *AggregateOptions)
ApplyToAggregate applies this configuration to the given aggregate options.
func (CustomMergeStrategy) ApplyToSummary ¶
func (t CustomMergeStrategy) ApplyToSummary(opts *SummaryOptions)
ApplyToSummary applies this configuration to the given summary options.
type DefaultMergeStrategyOption ¶
type DefaultMergeStrategyOption interface { // ApplyToDefaultMergeStrategy applies this configuration to the given DefaultMergeStrategy options. ApplyToDefaultMergeStrategy(option *DefaultMergeStrategyOptions) }
DefaultMergeStrategyOption is some configuration that modifies the DefaultMergeStrategy behaviour.
type DefaultMergeStrategyOptions ¶
type DefaultMergeStrategyOptions struct {
// contains filtered or unexported fields
}
DefaultMergeStrategyOptions allows to set options for the DefaultMergeStrategy behaviour.
func (*DefaultMergeStrategyOptions) ApplyOptions ¶
func (o *DefaultMergeStrategyOptions) ApplyOptions(opts []DefaultMergeStrategyOption) *DefaultMergeStrategyOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type FallbackCondition ¶
type FallbackCondition struct { Status metav1.ConditionStatus Reason string Message string }
FallbackCondition defines the condition that should be returned by mirror if the source condition does not exist.
func (FallbackCondition) ApplyToMirror ¶
func (f FallbackCondition) ApplyToMirror(opts *MirrorOptions)
ApplyToMirror applies this configuration to the given mirror options.
type ForConditionTypes ¶
type ForConditionTypes []string
ForConditionTypes allows to define the set of conditions in scope for a summary operation. Please note that condition types have an implicit order that can be used by the summary operation to determine relevance of the different conditions.
func (ForConditionTypes) ApplyToSummary ¶
func (t ForConditionTypes) ApplyToSummary(opts *SummaryOptions)
ApplyToSummary applies this configuration to the given summary options.
type ForceOverwrite ¶
type ForceOverwrite bool
ForceOverwrite instructs patch apply to always use the value provided by the controller (no matter of what value exists currently).
func (ForceOverwrite) ApplyToPatchApply ¶
func (f ForceOverwrite) ApplyToPatchApply(opts *PatchApplyOptions)
ApplyToPatchApply applies this configuration to the given patch apply options.
type GetPriorityFunc ¶
type GetPriorityFunc func(condition metav1.Condition) MergePriority
GetPriorityFunc defines priority of a given condition when processed by the DefaultMergeStrategy. Note: The return value must be one of IssueMergePriority, UnknownMergePriority, InfoMergePriority.
func (GetPriorityFunc) ApplyToDefaultMergeStrategy ¶
func (f GetPriorityFunc) ApplyToDefaultMergeStrategy(opts *DefaultMergeStrategyOptions)
ApplyToDefaultMergeStrategy applies this configuration to the given DefaultMergeStrategy options.
type Getter ¶
type Getter interface { // GetV1Beta2Conditions returns the list of conditions for a cluster API object. // Note: GetV1Beta2Conditions will be renamed to GetConditions in a later stage of the transition to V1Beta2. GetV1Beta2Conditions() []metav1.Condition }
Getter interface defines methods that an API object should implement in order to use the conditions package for getting conditions.
type IgnoreLastTransitionTime ¶
type IgnoreLastTransitionTime bool
IgnoreLastTransitionTime instructs MatchConditions and MatchCondition to ignore the LastTransitionTime field.
func (IgnoreLastTransitionTime) ApplyMatch ¶
func (f IgnoreLastTransitionTime) ApplyMatch(opts *MatchOptions)
ApplyMatch applies this configuration to the given Match options.
type IgnoreTypesIfMissing ¶
type IgnoreTypesIfMissing []string
IgnoreTypesIfMissing allows to define conditions types that should be ignored (not defaulted to unknown) when performing a summary operation.
func (IgnoreTypesIfMissing) ApplyToSummary ¶
func (t IgnoreTypesIfMissing) ApplyToSummary(opts *SummaryOptions)
ApplyToSummary applies this configuration to the given summary options.
type MatchOption ¶
type MatchOption interface { // ApplyMatch applies this configuration to the given match options. ApplyMatch(option *MatchOptions) }
MatchOption is some configuration that modifies options for a match call.
type MatchOptions ¶
type MatchOptions struct {
// contains filtered or unexported fields
}
MatchOptions allows to set options for the match operation.
func (*MatchOptions) ApplyOptions ¶
func (o *MatchOptions) ApplyOptions(opts []MatchOption) *MatchOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type MergePriority ¶
type MergePriority uint8
MergePriority defines the priority for a condition during a merge operation.
const ( // IssueMergePriority is the merge priority used by GetDefaultMergePriority in case the condition state is considered an issue. IssueMergePriority MergePriority = iota // UnknownMergePriority is the merge priority used by GetDefaultMergePriority in case of unknown conditions. UnknownMergePriority // InfoMergePriority is the merge priority used by GetDefaultMergePriority in case the condition state is not considered an issue. InfoMergePriority )
type MergeStrategy ¶
type MergeStrategy interface { // Merge passed in conditions. // // It is up to the caller to ensure that all the expected conditions exist (e.g. by adding new conditions with status Unknown). // Conditions passed in must be of the given conditionTypes (other condition types must be discarded). // // The list of conditionTypes has an implicit order; it is up to the implementation of merge to use this info or not. Merge(conditions []ConditionWithOwnerInfo, conditionTypes []string) (status metav1.ConditionStatus, reason, message string, err error) }
MergeStrategy defines a strategy used to merge conditions during the aggregate or summary operation.
func DefaultMergeStrategy ¶
func DefaultMergeStrategy(opts ...DefaultMergeStrategyOption) MergeStrategy
DefaultMergeStrategy returns the default merge strategy.
Use the GetPriorityFunc option to customize how the MergePriority for a given condition is computed. If not specified, conditions are considered issues or not if not to their normal state given the polarity (e.g. a positive polarity condition is considered to be reporting an issue when status is false, otherwise the condition is considered to be reporting an info unless status is unknown).
Use the TargetConditionHasPositivePolarity to define the polarity of the condition returned by the DefaultMergeStrategy. If not specified, the generate condition will have positive polarity (status true = good).
Use the ComputeReasonFunc to customize how the reason for the resulting condition will be computed. If not specified, generic reasons will be used.
type MirrorOption ¶
type MirrorOption interface { // ApplyToMirror applies this configuration to the given mirror options. ApplyToMirror(*MirrorOptions) }
MirrorOption is some configuration that modifies options for a mirror call.
type MirrorOptions ¶
type MirrorOptions struct {
// contains filtered or unexported fields
}
MirrorOptions allows to set options for the mirror operation.
func (*MirrorOptions) ApplyOptions ¶
func (o *MirrorOptions) ApplyOptions(opts []MirrorOption) *MirrorOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type NegativePolarityConditionTypes ¶
type NegativePolarityConditionTypes []string
NegativePolarityConditionTypes allows to define polarity for some of the conditions in scope for a summary or an aggregate operation.
func (NegativePolarityConditionTypes) ApplyToAggregate ¶
func (t NegativePolarityConditionTypes) ApplyToAggregate(opts *AggregateOptions)
ApplyToAggregate applies this configuration to the given aggregate options.
func (NegativePolarityConditionTypes) ApplyToSummary ¶
func (t NegativePolarityConditionTypes) ApplyToSummary(opts *SummaryOptions)
ApplyToSummary applies this configuration to the given summary options.
type OverrideConditions ¶
type OverrideConditions []ConditionWithOwnerInfo
OverrideConditions allows to override conditions read from the source object only for the scope of a summary operation. The condition on the source object will preserve the original value.
func (OverrideConditions) ApplyToSummary ¶
func (t OverrideConditions) ApplyToSummary(opts *SummaryOptions)
ApplyToSummary applies this configuration to the given summary options.
type OwnedConditionTypes ¶
type OwnedConditionTypes []string
OwnedConditionTypes allows to define condition types owned by the controller when performing patch apply. In case of conflicts for the owned conditions, the patch helper will always use the value provided by the controller.
func (OwnedConditionTypes) ApplyToPatchApply ¶
func (o OwnedConditionTypes) ApplyToPatchApply(opts *PatchApplyOptions)
ApplyToPatchApply applies this configuration to the given patch apply options.
type Patch ¶
type Patch []PatchOperation
Patch defines a list of operations to change a list of conditions into another.
type PatchApplyOption ¶
type PatchApplyOption interface { // ApplyToPatchApply applies this configuration to the given patch apply options. ApplyToPatchApply(option *PatchApplyOptions) }
PatchApplyOption is some configuration that modifies options for a patch apply call.
type PatchApplyOptions ¶
type PatchApplyOptions struct {
// contains filtered or unexported fields
}
PatchApplyOptions allows to set strategies for patch apply.
func (*PatchApplyOptions) ApplyOptions ¶
func (o *PatchApplyOptions) ApplyOptions(opts []PatchApplyOption) *PatchApplyOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type PatchOperation ¶
type PatchOperation struct { Before *metav1.Condition After *metav1.Condition Op PatchOperationType }
PatchOperation defines an operation that changes a single condition.
type PatchOperationType ¶
type PatchOperationType string
PatchOperationType defines a condition patch operation type.
const ( // AddConditionPatch defines an add condition patch operation. AddConditionPatch PatchOperationType = "Add" // ChangeConditionPatch defines an change condition patch operation. ChangeConditionPatch PatchOperationType = "Change" // RemoveConditionPatch defines a remove condition patch operation. RemoveConditionPatch PatchOperationType = "Remove" )
type SetOption ¶
type SetOption interface { // ApplyToSet applies this configuration to the given Set options. ApplyToSet(option *SetOptions) }
SetOption is some configuration that modifies options for a Set request.
type SetOptions ¶
type SetOptions struct {
// contains filtered or unexported fields
}
SetOptions allows to define options for the set operation.
func (*SetOptions) ApplyOptions ¶
func (o *SetOptions) ApplyOptions(opts []SetOption) *SetOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type Setter ¶
type Setter interface { Getter // SetV1Beta2Conditions sets conditions for an API object. // Note: SetV1Beta2Conditions will be renamed to SetConditions in a later stage of the transition to V1Beta2. SetV1Beta2Conditions([]metav1.Condition) }
Setter interface defines methods that a Cluster API object should implement in order to use the conditions package for setting conditions.
type SummaryMessageTransformFunc ¶
SummaryMessageTransformFunc defines a function to be used when computing the message for a summary condition returned by the DefaultMergeStrategy.
func (SummaryMessageTransformFunc) ApplyToDefaultMergeStrategy ¶
func (f SummaryMessageTransformFunc) ApplyToDefaultMergeStrategy(opts *DefaultMergeStrategyOptions)
ApplyToDefaultMergeStrategy applies this configuration to the given DefaultMergeStrategy options.
type SummaryOption ¶
type SummaryOption interface { // ApplyToSummary applies this configuration to the given summary options. ApplyToSummary(*SummaryOptions) }
SummaryOption is some configuration that modifies options for a summary call.
type SummaryOptions ¶
type SummaryOptions struct {
// contains filtered or unexported fields
}
SummaryOptions allows to set options for the summary operation.
func (*SummaryOptions) ApplyOptions ¶
func (o *SummaryOptions) ApplyOptions(opts []SummaryOption) *SummaryOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type TargetConditionHasPositivePolarity ¶
type TargetConditionHasPositivePolarity bool
TargetConditionHasPositivePolarity defines the polarity of the condition returned by the DefaultMergeStrategy.
func (TargetConditionHasPositivePolarity) ApplyToDefaultMergeStrategy ¶
func (t TargetConditionHasPositivePolarity) ApplyToDefaultMergeStrategy(opts *DefaultMergeStrategyOptions)
ApplyToDefaultMergeStrategy applies this configuration to the given DefaultMergeStrategy options.
type TargetConditionType ¶
type TargetConditionType string
TargetConditionType allows to specify the type of new mirror or aggregate conditions.
func (TargetConditionType) ApplyToAggregate ¶
func (t TargetConditionType) ApplyToAggregate(opts *AggregateOptions)
ApplyToAggregate applies this configuration to the given aggregate options.
func (TargetConditionType) ApplyToMirror ¶
func (t TargetConditionType) ApplyToMirror(opts *MirrorOptions)
ApplyToMirror applies this configuration to the given mirror options.