util

package
v0.0.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountToSelectableFields

func AccountToSelectableFields(account *config.Account) fields.Set

AccountToSelectableFields returns a field set that represents the object

func CreateRoleBinding

func CreateRoleBinding(ctx context.Context, client client.Client, namespace string, owner *configv1alpha1.Account, scheme *runtime.Scheme) error

CreateRoleBinding creates a new role binding for the target account with the given name and namespace

func FilterList

FilterList filters any list object that conforms to the api conventions, provided that 'm' works with the concrete type of list. d is an optional decorator for the returned functions. Only matching items are decorated.

func GetAccountAttrs

func GetAccountAttrs(obj runtime.Object) (labels.Set, fields.Set, error)

GetAccountAttrs returns labels and fields of a given object for filtering purposes.

func GetClusterRoleFor

func GetClusterRoleFor(account *configv1alpha1.Account) string

GetClusterRoleFor returns the cluster role for the given account if there is any

func GetNamespaceAttrs

func GetNamespaceAttrs(obj runtime.Object) (labels.Set, fields.Set, error)

GetNamespaceAttrs returns labels and fields of a given object for filtering purposes.

func ListOptionsToSelectors

func ListOptionsToSelectors(options *metainternalversion.ListOptions) (labels.Selector, fields.Selector)

ListOptionsToSelectors converts the given list options to selectors

func MatchAccount

func MatchAccount(label labels.Selector, field fields.Selector) storage.SelectionPredicate

MatchAccount returns a generic matcher for a given label and field selector.

func MatchNamespace

func MatchNamespace(label labels.Selector, field fields.Selector) storage.SelectionPredicate

MatchNamespace returns a generic matcher for a given label and field selector.

func NamespaceToSelectableFields

func NamespaceToSelectableFields(namespace *corev1.Namespace) fields.Set

NamespaceToSelectableFields returns a field set that represents the object

Types

type DecoratorFunc

type DecoratorFunc func(obj runtime.Object) error

DecoratorFunc can mutate the provided object prior to being returned.

Jump to

Keyboard shortcuts

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