Documentation ¶
Overview ¶
Package client has been copied from kubectl code almost verbatim Some methods have been moved from k/k into the utils.go file to remove the dependency on K/K https://github.com/kubernetes/kubernetes/blob/v1.13.1/pkg/kubectl/cmd/apply/apply.go
Index ¶
Constants ¶
const LastAppliedAnnotation = "faros.pusher.com/last-applied-configuration"
LastAppliedAnnotation is the annotation name used by faros for the last applied config
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Applier ¶
type Applier struct {
// contains filtered or unexported fields
}
Applier is a client that can perform a three-way-merge Based on the `kubectl apply` command
func NewApplier ¶
NewApplier constucts a new Applier client
type ApplyOptions ¶
type ApplyOptions struct { Overwrite *bool // Automatically resolve conflicts between the modified and live configuration by using values from the modified configuration ForceDeletion *bool CascadeDeletion *bool DeletionTimeout *time.Duration DeletionGracePeriod *int ServerDryRun *bool }
ApplyOptions defines the possible options for the Apply command
func (*ApplyOptions) Complete ¶
func (a *ApplyOptions) Complete()
Complete defaults valus within the ApplyOptions struct
type Options ¶
type Options struct { // Scheme, if provided, will be used to map go structs to GroupVersionKinds Scheme *runtime.Scheme // Mapper, if provided, will be used to map GroupVersionKinds to Resources Mapper meta.RESTMapper }
Options are creation options for a Applier
type Patcher ¶
type Patcher struct { Mapping *meta.RESTMapping Helper *resource.Helper DynamicClient dynamic.Interface Overwrite bool BackOff clockwork.Clock Force bool Cascade bool Timeout time.Duration GracePeriod int ServerDryRun bool // If set, forces the patch against a specific resourceVersion ResourceVersion *string // Number of retries to make if the patch fails with conflict Retries int OpenapiSchema openapi.Resources }
Patcher is used to perform a three-way-merge on runtime.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 performs a strategic three way merge patch on the given object.
Current should be the runtime.Object as fetched from the API Modified is the current desired state as raw JSON source is the filename of the original resource