kube

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnoLastAppliedConfigSuffix is the suffix for last applied config
	AnnoLastAppliedConfigSuffix = "oam.dev/last-applied-configuration"
	// AnnoLastAppliedTimeSuffix is suffix for last applied time
	AnnoLastAppliedTimeSuffix = "oam.dev/last-applied-time"
)
View Source
const ProviderName = "kube"

ProviderName .

Variables

Package .

Functions

This section is empty.

Types

type ApplyOptions

type ApplyOptions struct {
	ThreeWayMergePatch ThreeWayMergePatchOptions `json:"threeWayMergePatch"`
}

ApplyOptions .

type ListFilter

type ListFilter struct {
	Namespace      string            `json:"namespace,omitempty"`
	MatchingLabels map[string]string `json:"matchingLabels,omitempty"`
}

ListFilter filter for list resources

type ListParams

type ListParams providers.Params[ListVars]

ListParams is the params for list

type ListReturns

ListReturns is the returns for list

func List

func List(ctx context.Context, listParams *ListParams) (*ListReturns, error)

List .

type ListVars

type ListVars struct {
	Cluster  string                     `json:"cluster"`
	Filter   *ListFilter                `json:"filter,omitempty"`
	Resource *unstructured.Unstructured `json:"resource"`
}

ListVars is the vars for list

type PatchParams

type PatchParams providers.Params[PatchVars]

PatchParams is the params for patch

type PatchVars

type PatchVars struct {
	Cluster  string                     `json:"cluster"`
	Resource *unstructured.Unstructured `json:"resource"`
	Patch    Patcher                    `json:"patch"`
}

PatchVars is the vars for patch

type Patcher

type Patcher struct {
	Type string `json:"type"`
	Data any    `json:"data"`
}

Patcher is the patcher

type ResourceParams

type ResourceParams providers.Params[ResourceVars]

ResourceParams is the params for resource

type ResourceReturns

type ResourceReturns providers.Returns[*unstructured.Unstructured]

ResourceReturns is the returns for resource

func Apply

func Apply(ctx context.Context, getParams *ResourceParams) (*ResourceReturns, error)

Apply .

func Get

func Get(ctx context.Context, getParams *ResourceParams) (*ResourceReturns, error)

Get .

func Patch

func Patch(ctx context.Context, patchParams *PatchParams) (*ResourceReturns, error)

Patch patches a kubernetes resource with patch strategy

type ResourceVars

type ResourceVars struct {
	Cluster  string                     `json:"cluster"`
	Resource *unstructured.Unstructured `json:"resource"`
	Options  ApplyOptions               `json:"options"`
}

ResourceVars .

type ThreeWayMergePatchOptions

type ThreeWayMergePatchOptions struct {
	Enabled          bool   `json:"enabled"`
	AnnotationPrefix string `json:"annotationPrefix"`
}

ThreeWayMergePatchOptions .

Jump to

Keyboard shortcuts

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