Documentation ¶
Index ¶
- Constants
- func CompactBuckets(config defaultconfig.Computed, ...)
- func GetAggregationSelector(ppr *podseidonv1a1.PodProtector) metav1.LabelSelector
- func NewIndexedInformer(args IndexedInformerArgs) component.Declared[IndexedInformer]
- func SetupPprInformer(ctx context.Context, pprInformer podseidonv1a1informers.PodProtectorInformer, ...) error
- func Summarize(config defaultconfig.Computed, ppr *podseidonv1a1.PodProtector)
- type DisruptionQuota
- type DisruptionResult
- type IndexedInformer
- func (ii IndexedInformer) AddPostHandler(handler func(types.NamespacedName))
- func (ii IndexedInformer) Get(nsName types.NamespacedName) (optional.Optional[*podseidonv1a1.PodProtector], error)
- func (ii IndexedInformer) HasSynced() bool
- func (ii IndexedInformer) Query(namespace string, labels map[string]string) []types.NamespacedName
- type IndexedInformerArgs
- type IndexedInformerDeps
- type IndexedInformerOptions
- type IndexedInformerState
- type SelectorIndex
Constants ¶
View Source
const ( DisruptionResultOk = DisruptionResult(iota) DisruptionResultRetry DisruptionResultDenied )
Variables ¶
This section is empty.
Functions ¶
func CompactBuckets ¶
func CompactBuckets( config defaultconfig.Computed, buckets *[]podseidonv1a1.PodProtectorAdmissionBucket, )
func GetAggregationSelector ¶
func GetAggregationSelector(ppr *podseidonv1a1.PodProtector) metav1.LabelSelector
func NewIndexedInformer ¶
func NewIndexedInformer( args IndexedInformerArgs, ) component.Declared[IndexedInformer]
func SetupPprInformer ¶
func SetupPprInformer( ctx context.Context, pprInformer podseidonv1a1informers.PodProtectorInformer, postHandler func(types.NamespacedName), selectorIndex SelectorIndex, observeStartEnqueue o11y.ObserveScopeFunc[types.NamespacedName], observeEndEnqueue func(context.Context), observeEnqueueError func(context.Context, types.NamespacedName, error), ) error
func Summarize ¶
func Summarize(config defaultconfig.Computed, ppr *podseidonv1a1.PodProtector)
Reconcile the .status field of a PodProtector.
This function should not be called unless the PodProtector status is otherwise updated locally.
The caller is responsible for cleaning up obsolete buckets. This function assumes that all remaining buckets are lagging buckets. Failure to do so would result in incorrect EstimatedAvailable computation.
Types ¶
type DisruptionQuota ¶
type DisruptionQuota struct { // Number of replicas that can be disrupted without any risk. Cleared int32 // Number of replicas that cannot be disrupted due to admission history, // but can be disrupted if admission history is emptied. Transitional int32 }
func ComputeDisruptionQuota ¶
func ComputeDisruptionQuota( minAvailable int32, config defaultconfig.Computed, summary podseidonv1a1.PodProtectorStatusSummary, ) DisruptionQuota
func (*DisruptionQuota) Disrupt ¶
func (quota *DisruptionQuota) Disrupt() DisruptionResult
type DisruptionResult ¶
type DisruptionResult uint8
func (DisruptionResult) String ¶
func (result DisruptionResult) String() string
type IndexedInformer ¶
type IndexedInformer struct {
// contains filtered or unexported fields
}
func (IndexedInformer) AddPostHandler ¶
func (ii IndexedInformer) AddPostHandler(handler func(types.NamespacedName))
func (IndexedInformer) Get ¶
func (ii IndexedInformer) Get( nsName types.NamespacedName, ) (optional.Optional[*podseidonv1a1.PodProtector], error)
func (IndexedInformer) HasSynced ¶
func (ii IndexedInformer) HasSynced() bool
func (IndexedInformer) Query ¶
func (ii IndexedInformer) Query(namespace string, labels map[string]string) []types.NamespacedName
type IndexedInformerArgs ¶
type IndexedInformerArgs struct { ClusterName kube.ClusterName InformerPhase kube.InformerPhase Elector optional.Optional[kube.ElectorArgs] }
type IndexedInformerDeps ¶
type IndexedInformerDeps struct {
// contains filtered or unexported fields
}
type IndexedInformerOptions ¶
type IndexedInformerOptions struct{}
type IndexedInformerState ¶
type IndexedInformerState struct {
// contains filtered or unexported fields
}
type SelectorIndex ¶
type SelectorIndex = *labelindex.Locked[ types.NamespacedName, metav1.LabelSelector, labelindex.NamespacedQuery[map[string]string], error, util.Empty, *labelindex.Namespaced[ metav1.LabelSelector, map[string]string, error, util.Empty, *labelindex.Selectors[string], ], ]
func NewSelectorIndex ¶
func NewSelectorIndex() SelectorIndex
Click to show internal directories.
Click to hide internal directories.