k8s

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 38 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conditionals added in v0.1.11

type Conditionals struct {
	When string `json:"when"`
}

type ForEach added in v0.1.9

type ForEach struct {
	IsArray bool
	IsMap   bool
	Array   []interface{}
	Map     map[string]interface{}
}

type ForEachResource added in v0.1.9

type ForEachResource struct {
	ForEach string `json:"forEach"`
}

type MapInterface added in v0.1.2

type MapInterface map[string]interface{}

type PatchApplier

type PatchApplier struct {
	Clientset     *kubernetes.Clientset
	Log           logr.Logger
	FuncMap       template.FuncMap
	SchemaManager *SchemaManager
}

func NewPatchApplier

func NewPatchApplier(clientset *kubernetes.Clientset, schemaManager *SchemaManager, log logr.Logger) (*PatchApplier, error)

func (*PatchApplier) Apply

func (p *PatchApplier) Apply(resource *unstructured.Unstructured, patchStr string, patchType PatchType) (*unstructured.Unstructured, error)

type PatchType

type PatchType string
var (
	PatchTypeYaml PatchType = "yaml"
	PatchTypeJSON PatchType = "json"
)

type ResourcePatch

type ResourcePatch struct {
	Resource   *unstructured.Unstructured
	Patch      string
	Kind       string
	APIVersion string
	PatchType  PatchType
}

type SchemaCache added in v0.1.7

type SchemaCache struct {
	// contains filtered or unexported fields
}

func NewSchemaCache added in v0.1.7

func NewSchemaCache(clientset *kubernetes.Clientset, expire time.Duration, log logr.Logger) *SchemaCache

func (*SchemaCache) FetchResources added in v0.1.7

func (sc *SchemaCache) FetchResources() ([]*metav1.APIResourceList, error)

func (*SchemaCache) FetchSchema added in v0.1.7

func (sc *SchemaCache) FetchSchema() (*spec.Swagger, error)

type SchemaManager added in v0.1.2

type SchemaManager struct {
	// contains filtered or unexported fields
}

func NewSchemaManager added in v0.1.2

func NewSchemaManager(clientset *kubernetes.Clientset, crdClient extapi.ApiextensionsV1beta1Interface, log logr.Logger) (*SchemaManager, error)

func NewSchemaManagerWithCache added in v0.1.7

func NewSchemaManagerWithCache(clientset *kubernetes.Clientset, crdClient extapi.ApiextensionsV1beta1Interface, cache *SchemaCache, log logr.Logger) (*SchemaManager, error)

func (*SchemaManager) DuckType added in v0.1.2

func (*SchemaManager) FindSchemaForKind added in v0.1.2

func (m *SchemaManager) FindSchemaForKind(gvk schema.GroupVersionKind) (*spec.Schema, bool, error)

func (*SchemaManager) FindTypeForKey added in v0.1.2

func (m *SchemaManager) FindTypeForKey(gvk schema.GroupVersionKind, key string) (*TypedField, error)

func (*SchemaManager) FindTypeForKeyFromSchema added in v0.1.2

func (m *SchemaManager) FindTypeForKeyFromSchema(schema *spec.Schema, key string) (*TypedField, error)

type TemplateManager

type TemplateManager struct {
	Client *kommons.Client
	kubernetes.Interface
	Log           logr.Logger
	PatchApplier  *PatchApplier
	SchemaManager *SchemaManager
	FuncMap       template.FuncMap
	Events        record.EventRecorder
}

func NewTemplateManager

func NewTemplateManager(c *kommons.Client, log logr.Logger, cache *SchemaCache, events record.EventRecorder) (*TemplateManager, error)

func (*TemplateManager) GetBool added in v0.1.11

func (tm *TemplateManager) GetBool(object interface{}, jsonpath string) (bool, error)

func (*TemplateManager) JSONPath added in v0.1.9

func (tm *TemplateManager) JSONPath(object interface{}, jsonpath string) (*ForEach, error)

func (*TemplateManager) Run

func (tm *TemplateManager) Run(ctx context.Context, template *templatev1.Template) error

func (*TemplateManager) Template added in v0.1.0

func (tm *TemplateManager) Template(data []byte, vars interface{}) ([]byte, error)

type TypedField added in v0.1.2

type TypedField struct {
	Types  []string
	Format string
}

Jump to

Keyboard shortcuts

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