apply

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply added in v0.4.4

func Apply(
	o *ApplyOptions,
	runtime runtime.Runtime,
	storage states.StateStorage,
	planResources *models.Spec,
	changes *opsmodels.Changes,
	out io.Writer,
) error

The Apply function will apply the resources changes through the execution Kusion Engine, and will save the state to specified storage.

You can customize the runtime of engine and the state storage through `runtime` and `storage` parameters.

Example:

o := NewApplyOptions()
stateStorage := &states.FileSystemState{
    Path: filepath.Join(o.WorkDir, states.KusionState)
}
kubernetesRuntime, err := runtime.NewKubernetesRuntime()
if err != nil {
    return err
}

err = Apply(o, kubernetesRuntime, stateStorage, planResources, changes, os.Stdout)
if err != nil {
    return err
}

func NewCmdApply

func NewCmdApply() *cobra.Command

func Watch added in v0.7.0

func Watch(o *ApplyOptions,
	r runtime.Runtime,
	planResources *models.Spec,
	project *projectstack.Project,
	stack *projectstack.Stack,
	out io.Writer,
) error

Watch function will observe the changes of each resource by the execution engine.

Example:

o := NewApplyOptions()
kubernetesRuntime, err := runtime.NewKubernetesRuntime()
if err != nil {
    return err
}

Watch(o, kubernetesRuntime, planResources, changes)
if err != nil {
    return err
}

Types

type ApplyFlag added in v0.6.2

type ApplyFlag struct {
	Yes         bool
	NoStyle     bool
	DryRun      bool
	OnlyPreview bool
	Watch       bool
}

type ApplyOptions

type ApplyOptions struct {
	previewcmd.PreviewOptions
	ApplyFlag
}

ApplyOptions defines flags for the `apply` command

func NewApplyOptions

func NewApplyOptions() *ApplyOptions

NewApplyOptions returns a new ApplyOptions instance

func (*ApplyOptions) Complete

func (o *ApplyOptions) Complete(args []string)

func (*ApplyOptions) Run

func (o *ApplyOptions) Run() error

func (*ApplyOptions) Validate

func (o *ApplyOptions) Validate() error

Jump to

Keyboard shortcuts

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