Documentation ¶
Index ¶
- Constants
- func DiffPods(lister v1lister.PodLister, ns string, oldSelector, newSelector labels.Selector) (onlyInOld, both, onlyInNew sets.String, err error)
- func LabelSelectorEqual(oldSelector, newSelector labels.Selector) bool
- func LabelsEqual(oldLabels, newLabels map[string]string) bool
- func PluginsConfigEqual(oldPlugins, newPlugins []ameshv1alpha1.AmeshPluginConfigPlugin) bool
- func VerifyGeneration(conditions *[]metav1.Condition, newCondition metav1.Condition) bool
- type SelectorCache
- func (sc *SelectorCache) Delete(key string)
- func (sc *SelectorCache) Get(key string) (labels.Selector, bool)
- func (sc *SelectorCache) GetPodPluginConfigs(pod *v1.Pod) (sets.String, error)
- func (sc *SelectorCache) Update(key string, metaSelector *metav1.LabelSelector) (selector labels.Selector, err error)
Constants ¶
View Source
const ( ConditionSync = "Sync" ConditionSyncSuccess = "Sync Success" ResourceReconciled = "Reconciled" )
Variables ¶
This section is empty.
Functions ¶
func LabelSelectorEqual ¶
func LabelsEqual ¶
func PluginsConfigEqual ¶
func PluginsConfigEqual(oldPlugins, newPlugins []ameshv1alpha1.AmeshPluginConfigPlugin) bool
Types ¶
type SelectorCache ¶
type SelectorCache struct {
// contains filtered or unexported fields
}
SelectorCache is a cache of selectors to avoid high CPU consumption caused by frequent calls
func NewSelectorCache ¶
func NewSelectorCache(lister ameshv1alpha1lister.AmeshPluginConfigLister) *SelectorCache
NewSelectorCache init SelectorCache for controller.
func (*SelectorCache) Delete ¶
func (sc *SelectorCache) Delete(key string)
Delete can delete selector which exist in SelectorCache.
func (*SelectorCache) Get ¶
func (sc *SelectorCache) Get(key string) (labels.Selector, bool)
Get return selector and existence in SelectorCache by key.
func (*SelectorCache) GetPodPluginConfigs ¶
func (*SelectorCache) Update ¶
func (sc *SelectorCache) Update(key string, metaSelector *metav1.LabelSelector) (selector labels.Selector, err error)
Update can update or add a selector in SelectorCache while plugin config's selector changed.
Click to show internal directories.
Click to hide internal directories.