utils

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGVKFromURL added in v0.7.0

func GetGVKFromURL(url string) *schema.GroupVersionKind

Since the URL is in the format /apis/{group}/{version}/{kind} or /api/{version}/{kind}, we can extract the GVK from the URL. However the kind will be the plural form.

func GetNodeSelector

func GetNodeSelector(nl *corev1.NodeList, selectors []map[string]string) (*labels.Requirement, error)

func GetNodeSelectors

func GetNodeSelectors(request *http.Request, proxyTenants []*tenant.ProxyTenant) (selectors []map[string]string)

func HandleGetSelector

func HandleGetSelector(ctx context.Context, obj client.Object, client client.Reader, requirements []labels.Requirement, name string, gv schema.GroupKind) (labels.Selector, error)

func HandleListSelector

func HandleListSelector(requirements []labels.Requirement) (selector labels.Selector, err error)

func ReplacePluralWithKind added in v0.7.0

func ReplacePluralWithKind(discoveryClient *discovery.DiscoveryClient, gvk *schema.GroupVersionKind) error

GetGVKByPlural returns the GroupVersionKind for a given plural name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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