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 Watch ¶ added in v0.7.0
func Watch(o *ApplyOptions, r runtime.Runtime, planResources *models.Spec, changes *opsmodels.Changes, 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, os.Stdout) if err != nil { return err }
Types ¶
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
Click to show internal directories.
Click to hide internal directories.