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 NewAuthTransport(inner http.RoundTripper) http.RoundTripper
- func NewMemcachedDiscoveryClient(cl discovery.DiscoveryInterface) discovery.CachedDiscoveryInterface
- func Read(fs afero.Fs, vm *jsonnet.VM, path string) ([]runtime.Object, error)
- func RegisterNativeFuncs(vm *jsonnet.VM, resolver Resolver)
- func ResourceNameFor(disco discovery.ServerResourcesInterface, o runtime.Object) string
- type AlphabeticalOrder
- type DependencyOrder
- type ImageName
- type Registry
- type Resolver
- 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 NewAuthTransport ¶
func NewAuthTransport(inner http.RoundTripper) http.RoundTripper
NewAuthTransport returns a roundtripper that does bearer/etc authentication
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 RegisterNativeFuncs ¶
RegisterNativeFuncs adds kubecfg's native jsonnet functions to provided VM
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 ImageName ¶
type ImageName struct { // eg: "myregistryhost:5000/fedora/httpd:version1.0" Registry string // "myregistryhost:5000" Repository string // "fedora" Name string // "httpd" Tag string // "version1.0" Digest string }
ImageName represents the parts of a docker image name
func ParseImageName ¶
ParseImageName parses a docker image into an ImageName struct
func (ImageName) RegistryRepoName ¶
RegistryRepoName returns the "repository" as used in the registry URL
func (ImageName) RegistryURL ¶
RegistryURL returns the deduced base URL of the registry for this image
type Registry ¶
Registry is a *crazy limited* Docker registry client.
func NewRegistryClient ¶
NewRegistryClient creates a new Registry client using the given http client and base URL.
type Resolver ¶
Resolver is able to resolve docker image names into more specific forms
func NewIdentityResolver ¶
func NewIdentityResolver() Resolver
NewIdentityResolver returns a resolver that does only trivial :latest canonicalisation
func NewRegistryResolver ¶
NewRegistryResolver returns a resolver that looks up a docker registry to resolve digests
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