apply

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type APIStatus

type APIStatus interface {
	Status() metav1.Status
}

type Apply

type Apply interface {
	Apply(content io.Reader) error
}

func NewApplier

func NewApplier(ctx context.Context, namespace string, kubeConfig *rest.Config) (Apply, error)

type BuilderOptions

type BuilderOptions struct {
	//Unstructured  bool
	Validate      string
	Namespace     string
	LabelSelector string
	FieldSelector string
	All           bool
	AllNamespaces bool
}

func NewBuilderOptions

func NewBuilderOptions() *BuilderOptions

type GetterFactory

type GetterFactory struct {
	// contains filtered or unexported fields
}

func NewGetterFactory

func NewGetterFactory(ctx context.Context, config *rest.Config) *GetterFactory

func (*GetterFactory) ClientForMapping

func (f *GetterFactory) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)

func (*GetterFactory) DynamicClient

func (f *GetterFactory) DynamicClient() (dynamic.Interface, error)

func (*GetterFactory) KubernetesClientSet

func (f *GetterFactory) KubernetesClientSet() (*kubernetes.Clientset, error)

func (*GetterFactory) NewBuilder

func (f *GetterFactory) NewBuilder() *resource.Builder

func (*GetterFactory) OpenAPISchema

func (f *GetterFactory) OpenAPISchema() (openapi.Resources, error)

OpenAPISchema 实现一次性初始化并缓存 openapi.Resources。

func (*GetterFactory) OpenAPIV3Client

func (f *GetterFactory) OpenAPIV3Client() (openapi2.Client, error)

func (*GetterFactory) RESTClient

func (f *GetterFactory) RESTClient() (*rest.RESTClient, error)

func (*GetterFactory) ToDiscoveryClient

func (f *GetterFactory) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

func (*GetterFactory) ToRESTConfig

func (f *GetterFactory) ToRESTConfig() (*rest.Config, error)

func (*GetterFactory) ToRESTMapper

func (f *GetterFactory) ToRESTMapper() (meta.RESTMapper, error)

func (*GetterFactory) ToRawKubeConfigLoader

func (f *GetterFactory) ToRawKubeConfigLoader() clientcmd.ClientConfig

func (*GetterFactory) UnstructuredClientForMapping

func (f *GetterFactory) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)

func (*GetterFactory) Validator

func (f *GetterFactory) Validator(validationDirective string) (validation.Schema, error)

Validator validationDirective "strict"/"warn"/"ignore"

type Patcher

type Patcher struct {
	Mapping *meta.RESTMapping
	Helper  *resource.Helper

	Overwrite bool
	BackOff   clockwork.Clock

	Force             bool
	CascadingStrategy metav1.DeletionPropagation
	Timeout           time.Duration
	GracePeriod       int

	// If set, forces the patch against a specific resourceVersion
	ResourceVersion *string

	// Number of retries to make if the patch fails with conflict
	Retries int

	OpenAPIGetter openapi.OpenAPIResourcesGetter
	OpenAPIV3Root openapi3.Root
}

Patcher defines options to patch OpenAPI objects.

func (*Patcher) Patch

func (p *Patcher) Patch(current runtime.Object, modified []byte, source, namespace, name string, errOut io.Writer) ([]byte, runtime.Object, error)

Patch tries to patch an OpenAPI resource. On success, returns the merge patch as well the final patched object. On failure, returns an error.

Jump to

Keyboard shortcuts

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