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 ¶
- func Encode(obj interface{}) []byte
- func EncodeAndFixDaemonset(ds *v1.DaemonSet) ([]byte, error)
- func EncodeMutatingAndFixCA(vw admissionregv1.MutatingWebhookConfiguration) ([]byte, error)
- func EncodeValidatingAndFixCA(vw admissionregv1.ValidatingWebhookConfiguration) ([]byte, error)
- type SyncSetResourcesByLabelSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeAndFixDaemonset ¶
This is needed to override the omitempty on serviceAccount and serviceAccountName which otherwise means we can't nullify them in the SelectorSyncSet
func EncodeMutatingAndFixCA ¶
func EncodeMutatingAndFixCA(vw admissionregv1.MutatingWebhookConfiguration) ([]byte, error)
func EncodeValidatingAndFixCA ¶
func EncodeValidatingAndFixCA(vw admissionregv1.ValidatingWebhookConfiguration) ([]byte, error)
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 ¶
func (s *SyncSetResourcesByLabelSelector) Add(key metav1.LabelSelector, object runtime.RawExtension)
Add adds a resources to a SyncSetResourcesByLabelSelector object
func (*SyncSetResourcesByLabelSelector) Get ¶
func (s *SyncSetResourcesByLabelSelector) Get(key metav1.LabelSelector) *mapEntry
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