k8s

package
v0.20.21 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const NoTimeout = -1

NoTimeout as a timeout values will cause Wait for ready to never timeout. Any negative number will do. This constant is added for semantic clarity.

Variables

View Source
var (
	PatchOpAdd     = "add"
	PatchOpRemove  = "remove"
	PatchOpReplace = "replace"
	PatchOpMove    = "move"
	PatchOpCopy    = "copy"
)
View Source
var ErrLockTaken = errors.New("lock is already taken")

Functions

func FlightIsReady added in v0.13.0

func FlightIsReady(resource *unstructured.Unstructured) bool

func PatchEscape added in v0.18.0

func PatchEscape(value string) string

Types

type ApplyOpts

type ApplyOpts struct {
	DryRun         bool
	ForceConflicts bool
	ForceOwnership bool
}

type ApplyResourcesOpts

type ApplyResourcesOpts struct {
	SkipDryRun bool
	ApplyOpts
}

type Client

type Client struct {
	Dynamic          *dynamic.DynamicClient
	Clientset        *kubernetes.Clientset
	Meta             metadata.Interface
	Mapper           *restmapper.DeferredDiscoveryRESTMapper
	DefaultNamespace string
}

func NewClient

func NewClient(cfg *rest.Config, ns string) (*Client, error)

func NewClientFromConfigFlags added in v0.10.10

func NewClientFromConfigFlags(cfgFlags *genericclioptions.ConfigFlags) (*Client, error)

func NewClientFromKubeConfig

func NewClientFromKubeConfig(path string) (*Client, error)

func (*Client) AirwayIntf added in v0.16.7

func (client *Client) AirwayIntf() TypedIntf[v1alpha1.Airway]

func (Client) ApplyResource

func (client Client) ApplyResource(ctx context.Context, resource *unstructured.Unstructured, opts ApplyOpts) error

func (Client) ApplyResources

func (client Client) ApplyResources(ctx context.Context, resources []*unstructured.Unstructured, opts ApplyResourcesOpts) error

func (Client) CapReleaseHistory added in v0.12.2

func (client Client) CapReleaseHistory(ctx context.Context, name, ns string, size int) error

func (Client) CreateRevision

func (client Client) CreateRevision(ctx context.Context, release, ns string, revision internal.Revision, stages internal.Stages) error

func (Client) DeleteRevisions

func (client Client) DeleteRevisions(ctx context.Context, revisions internal.Release) error

func (Client) EnsureNamespace

func (client Client) EnsureNamespace(ctx context.Context, namespace string) error

func (Client) GetDynamicResourceInterface

func (client Client) GetDynamicResourceInterface(resource *unstructured.Unstructured) (dynamic.ResourceInterface, error)

func (Client) GetInClusterState

func (client Client) GetInClusterState(ctx context.Context, resource *unstructured.Unstructured) (*unstructured.Unstructured, error)

func (Client) GetRelease added in v0.6.0

func (client Client) GetRelease(ctx context.Context, name, ns string) (*internal.Release, error)

func (Client) GetReleases added in v0.6.0

func (client Client) GetReleases(ctx context.Context) ([]internal.Release, error)

func (Client) GetReleasesByNS added in v0.6.0

func (client Client) GetReleasesByNS(ctx context.Context, ns string) ([]internal.Release, error)

func (Client) GetRevisionResources

func (client Client) GetRevisionResources(ctx context.Context, revision internal.Revision) (internal.Stages, error)

func (Client) IsReady added in v0.3.0

func (client Client) IsReady(ctx context.Context, resource *unstructured.Unstructured) (bool, error)

func (Client) IsRemovedFromCluster added in v0.19.2

func (client Client) IsRemovedFromCluster(ctx context.Context, resource *unstructured.Unstructured) (bool, error)

func (Client) LockRelease added in v0.14.3

func (client Client) LockRelease(ctx context.Context, release internal.Release) error

func (*Client) LookupResourceMapping

func (client *Client) LookupResourceMapping(resource *unstructured.Unstructured) (*meta.RESTMapping, error)

func (Client) OrhpanResource added in v0.14.0

func (client Client) OrhpanResource(ctx context.Context, resource *unstructured.Unstructured) error

func (Client) Patch added in v0.14.0

func (client Client) Patch(ctx context.Context, resource *unstructured.Unstructured, patch []PatchAction) error

func (Client) PatchMany added in v0.14.0

func (client Client) PatchMany(ctx context.Context, resources []*unstructured.Unstructured, patch []PatchAction) error

func (Client) PruneReleaseDiff added in v0.14.0

func (client Client) PruneReleaseDiff(ctx context.Context, previous, next internal.Stages, opts PruneOpts) (removed, orphaned []*unstructured.Unstructured, err error)

func (Client) UnlockRelease added in v0.14.3

func (client Client) UnlockRelease(ctx context.Context, release internal.Release) error

func (Client) UpdateRevisionActiveState

func (client Client) UpdateRevisionActiveState(ctx context.Context, revision internal.Revision) error

func (Client) WaitForReady

func (client Client) WaitForReady(ctx context.Context, resource *unstructured.Unstructured, opts WaitOptions) error

func (Client) WaitForReadyMany

func (client Client) WaitForReadyMany(ctx context.Context, resources []*unstructured.Unstructured, opts WaitOptions) error

func (Client) WaitIsRemoveFromClusterMany added in v0.19.2

func (client Client) WaitIsRemoveFromClusterMany(ctx context.Context, resources []*unstructured.Unstructured, opts WaitOptions) error

func (Client) WaitIsRemovedFromCluster added in v0.19.2

func (client Client) WaitIsRemovedFromCluster(ctx context.Context, resource *unstructured.Unstructured, opts WaitOptions) error

type MetaObject added in v0.16.7

type MetaObject[T any] interface {
	*T
	metav1.Object
}

type PatchAction added in v0.18.0

type PatchAction struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value,omitempty"`
	From  string `json:"from,omitempty"`
}

type PatchOp added in v0.18.0

type PatchOp string

type PruneOpts added in v0.14.0

type PruneOpts struct {
	RemoveCRDs       bool
	RemoveNamespaces bool
}

type TypedIntf added in v0.16.7

type TypedIntf[T any] struct {
	// contains filtered or unexported fields
}

func TypedInterface added in v0.16.7

func TypedInterface[T any, obj MetaObject[T]](client *Client, resource schema.GroupVersionResource) TypedIntf[T]

func (TypedIntf[T]) Apply added in v0.20.13

func (c TypedIntf[T]) Apply(ctx context.Context, api *T, options metav1.ApplyOptions) (*T, error)

func (TypedIntf[T]) Create added in v0.16.7

func (c TypedIntf[T]) Create(ctx context.Context, api *T, options metav1.CreateOptions) (*T, error)

func (TypedIntf[T]) Delete added in v0.16.7

func (c TypedIntf[T]) Delete(ctx context.Context, name string, options metav1.DeleteOptions) error

func (TypedIntf[T]) Get added in v0.16.7

func (c TypedIntf[T]) Get(ctx context.Context, name string, options metav1.GetOptions) (*T, error)

func (TypedIntf[T]) List added in v0.16.7

func (c TypedIntf[T]) List(ctx context.Context, options metav1.ListOptions) ([]*T, error)

func (TypedIntf[T]) Namespace added in v0.16.7

func (c TypedIntf[T]) Namespace(ns string) TypedIntf[T]

func (TypedIntf[T]) Update added in v0.16.7

func (c TypedIntf[T]) Update(ctx context.Context, api *T, options metav1.UpdateOptions) (*T, error)

func (TypedIntf[T]) UpdateStatus added in v0.16.7

func (c TypedIntf[T]) UpdateStatus(ctx context.Context, api *T, options metav1.UpdateOptions) (*T, error)

type WaitOptions

type WaitOptions struct {
	Timeout  time.Duration
	Interval time.Duration
}

Jump to

Keyboard shortcuts

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