Documentation
¶
Index ¶
- func EnsureConfiguration[ObjectType configurationObjectType](ctx context.Context, ops ObjectOps[ObjectType], bootstrap ObjectType, ...) error
- func EnsureConfigurations[ObjectType configurationObjectType](ctx context.Context, ops ObjectOps[ObjectType], boots []ObjectType, ...) error
- func RemoveUnwantedObjects[ObjectType configurationObjectType](ctx context.Context, objectOps ObjectOps[ObjectType], boots []ObjectType) error
- type EnsureStrategy
- type ObjectOps
- func NewFlowSchemaOps(client flowcontrolclient.FlowSchemaInterface, ...) ObjectOps[*flowcontrolv1beta3.FlowSchema]
- func NewObjectOps[ObjectType configurationObjectType](client client[ObjectType], cache cache[ObjectType], ...) ObjectOps[ObjectType]
- func NewPriorityLevelConfigurationOps(client flowcontrolclient.PriorityLevelConfigurationInterface, ...) ObjectOps[*flowcontrolv1beta3.PriorityLevelConfiguration]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureConfiguration ¶
func EnsureConfiguration[ObjectType configurationObjectType](ctx context.Context, ops ObjectOps[ObjectType], bootstrap ObjectType, strategy EnsureStrategy[ObjectType]) error
EnsureConfiguration applies the given maintenance strategy to the given object.
func EnsureConfigurations ¶
func EnsureConfigurations[ObjectType configurationObjectType](ctx context.Context, ops ObjectOps[ObjectType], boots []ObjectType, strategy EnsureStrategy[ObjectType]) error
EnsureConfigurations applies the given maintenance strategy to the given objects. At the first error, if any, it stops and returns that error.
func RemoveUnwantedObjects ¶
func RemoveUnwantedObjects[ObjectType configurationObjectType](ctx context.Context, objectOps ObjectOps[ObjectType], boots []ObjectType) error
RemoveUnwantedObjects attempts to delete the configuration objects that exist, are annotated `apf.kubernetes.io/autoupdate-spec=true`, and do not have a name in the given set. A refusal due to concurrent update is logged and not considered an error; the object will be reconsidered later.
Types ¶
type EnsureStrategy ¶
type EnsureStrategy[ObjectType configurationObjectType] interface { // Name of the strategy, for now we have two: 'mandatory' and 'suggested'. // This comes handy in logging. Name() string // ReviseIfNeeded accepts a pair of the current and the bootstrap configuration, determines // whether an update is necessary, and returns a (revised if appropriate) copy of the object. // current is the existing in-cluster configuration object. // bootstrap is the configuration the kube-apiserver maintains in-memory. // // revised: the new object represents the new configuration to be stored in-cluster. // ok: true if auto update is required, otherwise false // err: err is set when the function runs into an error and can not // determine if auto update is needed. ReviseIfNeeded(objectOps objectLocalOps[ObjectType], current, bootstrap ObjectType) (revised ObjectType, ok bool, err error) }
EnsureStrategy provides a maintenance strategy for APF configuration objects. We have two types of strategy, corresponding to the two types of config objetcs:
mandatory: the mandatory configurationWrapper objects are about ensuring that the P&F system itself won't crash; we have to be sure there's 'catch-all' place for everything to go. Any changes made by the cluster operators to these configurationWrapper objects will be stomped by the apiserver.
suggested: additional configurationWrapper objects for initial behavior. the cluster operators have an option to edit or delete these configurationWrapper objects.
func NewMandatoryEnsureStrategy ¶
func NewMandatoryEnsureStrategy[ObjectType configurationObjectType]() EnsureStrategy[ObjectType]
NewMandatoryEnsureStrategy returns an EnsureStrategy for mandatory config objects
func NewSuggestedEnsureStrategy ¶
func NewSuggestedEnsureStrategy[ObjectType configurationObjectType]() EnsureStrategy[ObjectType]
NewSuggestedEnsureStrategy returns an EnsureStrategy for suggested config objects
type ObjectOps ¶
type ObjectOps[ObjectType configurationObject] interface {
// contains filtered or unexported methods
}
ObjectOps is the needed operations, both as a receiver from a server and server-independent, on configurationObjects
func NewFlowSchemaOps ¶
func NewFlowSchemaOps(client flowcontrolclient.FlowSchemaInterface, cache flowcontrollisters.FlowSchemaLister) ObjectOps[*flowcontrolv1beta3.FlowSchema]
func NewObjectOps ¶
func NewPriorityLevelConfigurationOps ¶
func NewPriorityLevelConfigurationOps(client flowcontrolclient.PriorityLevelConfigurationInterface, lister flowcontrollisters.PriorityLevelConfigurationLister) ObjectOps[*flowcontrolv1beta3.PriorityLevelConfiguration]