dynamic

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIHelper

type APIHelper struct {
	Client          dynamic.Interface
	DiscoveryClient discovery.DiscoveryInterface

	Mapper   mapper
	Accessor MetadataAccessor
}

APIHelper wraps the client-go dynamic client and exposes a simple interface.

func NewAPIHelper

func NewAPIHelper(dyn dynamic.Interface, mapper mapper, accessor MetadataAccessor) (*APIHelper, error)

NewAPIHelper returns an APIHelper with the internals instantiated.

func NewAPIHelperFromRESTConfig

func NewAPIHelperFromRESTConfig(cfg *rest.Config) (*APIHelper, error)

NewAPIHelperFromRESTConfig creates a new APIHelper with default objects from client-go.

func (*APIHelper) CreateObject

CreateObject attempts to create any kubernetes object.

func (*APIHelper) Name

func (a *APIHelper) Name(obj *unstructured.Unstructured) (string, error)

Name returns the name of the kubernetes object.

func (*APIHelper) Namespace

func (a *APIHelper) Namespace(obj *unstructured.Unstructured) (string, error)

Namespace returns the namespace of the kubernetes object.

func (*APIHelper) ResourceVersion

func (a *APIHelper) ResourceVersion(obj *unstructured.Unstructured) (string, error)

ResourceVersion returns the resource version of a kubernetes object.

type MetadataAccessor

type MetadataAccessor interface {
	Namespace(runtime.Object) (string, error)
	Name(runtime.Object) (string, error)
	ResourceVersion(runtime.Object) (string, error)
}

A scoped down meta.MetadataAccessor

Jump to

Keyboard shortcuts

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