Documentation
¶
Index ¶
- func ClientForResource(pool dynamic.ClientPool, disco discovery.DiscoveryInterface, ...) (dynamic.ResourceInterface, error)
- func FlattenToV1(objs []runtime.Object) []*unstructured.Unstructured
- func FqName(o metav1.Object) string
- func GroupVersionKindFor(o runtime.Object) string
- func NewMemcachedDiscoveryClient(cl discovery.DiscoveryInterface) discovery.CachedDiscoveryInterface
- func Read(fs afero.Fs, vm *jsonnet.VM, path string) ([]runtime.Object, error)
- func ResourceNameFor(disco discovery.ServerResourcesInterface, o runtime.Object) string
- type AlphabeticalOrder
- type DependencyOrder
- type ServerVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientForResource ¶
func ClientForResource(pool dynamic.ClientPool, disco discovery.DiscoveryInterface, obj runtime.Object, defNs string) (dynamic.ResourceInterface, error)
ClientForResource returns the ResourceClient for a given object
func FlattenToV1 ¶
func FlattenToV1(objs []runtime.Object) []*unstructured.Unstructured
FlattenToV1 expands any List-type objects into their members, and cooerces everything to v1.Unstructured. Panics if coercion encounters an unexpected object type.
func GroupVersionKindFor ¶
GroupVersionKindFor returns a lowercased kind for an Kubernete's object
func NewMemcachedDiscoveryClient ¶
func NewMemcachedDiscoveryClient(cl discovery.DiscoveryInterface) discovery.CachedDiscoveryInterface
NewMemcachedDiscoveryClient creates a new DiscoveryClient that caches results in memory
func Read ¶
Read fetches and decodes K8s objects by path. TODO: Replace this with something supporting more sophisticated content negotiation.
func ResourceNameFor ¶
func ResourceNameFor(disco discovery.ServerResourcesInterface, o runtime.Object) string
ResourceNameFor returns a lowercase plural form of a type, for human messages. Returns lowercased kind if discovery lookup fails.
Types ¶
type AlphabeticalOrder ¶
type AlphabeticalOrder []*unstructured.Unstructured
AlphabeticalOrder is a `sort.Interface` that sorts the objects by namespace/name/kind alphabetical order
func (AlphabeticalOrder) Len ¶
func (l AlphabeticalOrder) Len() int
func (AlphabeticalOrder) Less ¶
func (l AlphabeticalOrder) Less(i, j int) bool
func (AlphabeticalOrder) Swap ¶
func (l AlphabeticalOrder) Swap(i, j int)
type DependencyOrder ¶
type DependencyOrder []*unstructured.Unstructured
DependencyOrder is a `sort.Interface` that *best-effort* sorts the objects so that known dependencies appear earlier in the list. The idea is to prevent *some* of the "crash-restart" loops when creating inter-dependent resources.
func (DependencyOrder) Len ¶
func (l DependencyOrder) Len() int
func (DependencyOrder) Less ¶
func (l DependencyOrder) Less(i, j int) bool
func (DependencyOrder) Swap ¶
func (l DependencyOrder) Swap(i, j int)
type ServerVersion ¶
ServerVersion captures k8s major.minor version in a parsed form
func FetchVersion ¶
func FetchVersion(v discovery.ServerVersionInterface) (ret ServerVersion, err error)
FetchVersion fetches version information from discovery client, and parses
func ParseVersion ¶
func ParseVersion(v *version.Info) (ret ServerVersion, err error)
ParseVersion parses version.Info into a ServerVersion struct
func (ServerVersion) Compare ¶
func (v ServerVersion) Compare(major, minor int) int
Compare returns -1/0/+1 iff v is less than / equal / greater than major.minor
func (ServerVersion) String ¶
func (v ServerVersion) String() string