autocrud

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

metadata.go contains code that ports and shims backwards compatibility for the metadata of api responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, clientGetter KubernetesClientGetter, apiVersion, kind string, model any) error

func Delete

func Delete(ctx context.Context, clientGetter KubernetesClientGetter, kind, apiVersion string, req resource.DeleteRequest, wait bool) error

func ExpandModel

func ExpandModel(model any) map[string]any

ExpandModel takes a framework Model struct and converts it to a map compatible with kubernetes unstructured.Object

func FlattenManifest

func FlattenManifest(manifest map[string]any, model any) error

FlattenModel takes a Kubernetes unstructured object and flattens it into a Terraform Model

func Read

func Read(ctx context.Context, clientGetter KubernetesClientGetter, kind, apiVersion string, req resource.ReadRequest, model any) error

func Update

func Update(ctx context.Context, clientGetter KubernetesClientGetter, kind, apiVersion string, model any) error

Types

type KubernetesClientGetter

type KubernetesClientGetter interface {
	DynamicClient() (dynamic.Interface, error)
	DiscoveryClient() (discovery.DiscoveryInterface, error)

	IgnoreLabels() []string
	IgnoreAnnotations() []string
}

Jump to

Keyboard shortcuts

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