syncset

package
v0.0.0-...-d20acdf Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package syncset provides a type to map LabelSelectors to arbitrary objects and render the minimal set of SelectorSyncSets based on the LabelSelectors. The idea is to use it as a replacement for map[metav1.LabelSelector]runtime.RawExtension. A map cannot be used because metav1.LabelSelector cannot be used as a key in a map. This implementation uses reflect.DeepEqual to compare map keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(obj interface{}) []byte

Types

type SyncSetResourcesByLabelSelector

type SyncSetResourcesByLabelSelector struct {
	// contains filtered or unexported fields
}

SyncSetResourcesByLabelSelector is a mapping data structure. It uses metav1.LabelSelector as key and runtime.RawExtension as value. The builtin map type cannot be used because metav1.LabelSelector cannot be used as key.

func (*SyncSetResourcesByLabelSelector) Add

Add adds a resources to a SyncSetResourcesByLabelSelector object

func (*SyncSetResourcesByLabelSelector) Get

Get returns a single entry based on the passed key. If none exists, it returns nil

func (*SyncSetResourcesByLabelSelector) RenderSelectorSyncSets

func (s *SyncSetResourcesByLabelSelector) RenderSelectorSyncSets(labels map[string]string) []runtime.RawExtension

RenderSelectorSyncSets renders a minimal set of SelectorSyncSets based on the LabelSelectors existing in the SyncSetResourcesByLabelSelector object

Jump to

Keyboard shortcuts

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