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 ¶
View Source
var Package = runtime.Must(cuexruntime.NewInternalPackage(ProviderName, template, map[string]cuexruntime.ProviderFn{ "apply": cuexruntime.GenericProviderFn[ResourceParams, ResourceReturns](Apply), "get": cuexruntime.GenericProviderFn[ResourceParams, ResourceReturns](Get), "list": cuexruntime.GenericProviderFn[ListParams, ListReturns](List), "patch": cuexruntime.GenericProviderFn[PatchParams, ResourceReturns](Patch), }))
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 ListReturns ¶
type ListReturns providers.Returns[*unstructured.UnstructuredList]
ListReturns is the returns for 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 PatchVars ¶
type PatchVars struct { Cluster string `json:"cluster"` Resource *unstructured.Unstructured `json:"resource"` Patch Patcher `json:"patch"` }
PatchVars is the vars for patch
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 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 .
Click to show internal directories.
Click to hide internal directories.