Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply( o *Options, 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 ¶
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 Options ¶ added in v0.9.0
type Options struct { previewcmd.Options Flag }
Options defines flags for the `apply` command
func NewApplyOptions ¶
func NewApplyOptions() *Options
NewApplyOptions returns a new ApplyOptions instance
Click to show internal directories.
Click to hide internal directories.