resources

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package resources contains various utilities for dealing with Kubernetes resources.

Package resources contains various utilities for dealing with Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap

func CopyMap(a map[string]string) map[string]string

CopyMap makes a copy of the map.

func FetchReadyAddressCount

func FetchReadyAddressCount(lister corev1listers.EndpointsLister, ns, name string) (int, error)

FetchReadyAddressCount fetches endpoints and returns the total number of addresses ready for them.

func FilterMap

func FilterMap(in map[string]string, filter func(string) bool) map[string]string

FilterMap creates a copy of the provided map, filtering out the elements that match `filter`. nil `filter` is accepted.

func ParentResourceFromService

func ParentResourceFromService(name string) string

ParentResourceFromService returns the parent resource name from endpoints or k8s service resource. The function is based upon knowledge that all knative built services have `parent-resource-<svc-unique-suffix` format.

func ReadyAddressCount

func ReadyAddressCount(endpoints *corev1.Endpoints) int

ReadyAddressCount returns the total number of addresses ready for the given endpoint.

func UnionMaps

func UnionMaps(a, b map[string]string) map[string]string

UnionMaps returns a map constructed from the union of `a` and `b`, where value from `b` wins.

Types

This section is empty.

Jump to

Keyboard shortcuts

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