kube

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateWait

func EvaluateWait(waitPayload Wait) error

This is specific to Lula - Check if we need to execute any wait operations.

func GetResourcesDynamically

func GetResourcesDynamically(ctx context.Context,
	resource ResourceRule) (
	[]map[string]interface{}, error)

GetResourcesDynamically() requires a dynamic interface and processes GVR to return []map[string]interface{} This function is used to query the cluster for specific subset of resources required for processing

func QueryCluster

func QueryCluster(ctx context.Context, resources []Resource) (map[string]interface{}, error)

QueryCluster() requires context and a Payload as input and returns []unstructured.Unstructured This function is used to query the cluster for all resources required for processing

func WaitForCondition

func WaitForCondition(condition string, namespace string, timeout string, args ...string) (err error)

This is required bootstrapping for use of RunWait()

func WaitForExistence

func WaitForExistence(kind string, namespace string, timeout time.Duration) (err error)

Types

type Field

type Field struct {
	Jsonpath string    `json:"jsonpath" yaml:"jsonpath"`
	Type     FieldType `json:"type" yaml:"type"`
	Base64   bool      `json:"base64" yaml:"base64"`
}

func (Field) Validate

func (f Field) Validate() error

Validate the Field type if valid

type FieldType

type FieldType string
const (
	FieldTypeJSON    FieldType = "json"
	FieldTypeYAML    FieldType = "yaml"
	DefaultFieldType FieldType = FieldTypeJSON
)

type KubernetesDomain

type KubernetesDomain struct {
	// Context is the context that Kubernetes resources are being evaluated in
	Context context.Context `json:"context" yaml:"context"`

	// Spec is the specification of the Kubernetes resources
	Spec KubernetesSpec `json:"spec" yaml:"spec"`
}

func (KubernetesDomain) GetResources

func (k KubernetesDomain) GetResources() (types.DomainResources, error)

type KubernetesSpec

type KubernetesSpec struct {
	Resources []Resource `json:"resources" yaml:"resources"`
	Wait      Wait       `json:"wait" yaml:"wait"`
}

type Resource

type Resource struct {
	Name         string       `json:"name" yaml:"name"`
	Description  string       `json:"description" yaml:"description"`
	ResourceRule ResourceRule `json:"resource-rule" yaml:"resource-rule"`
}

type ResourceRule

type ResourceRule struct {
	Name       string   `json:"name" yaml:"name"`
	Group      string   `json:"group" yaml:"group"`
	Version    string   `json:"version" yaml:"version"`
	Resource   string   `json:"resource" yaml:"resource"`
	Namespaces []string `json:"namespaces" yaml:"namespaces"`
	Field      Field    `json:"field" yaml:"field"`
}

type Wait

type Wait struct {
	Condition string `json:"condition" yaml:"condition"`
	Jsonpath  string `json:"jsonpath" yaml:"jsonpath"`
	Kind      string `json:"kind" yaml:"kind"`
	Namespace string `json:"namespace" yaml:"namespace"`
	Timeout   string `json:"timeout" yaml:"timeout"`
}

Jump to

Keyboard shortcuts

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