Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdPreview ¶
func Preview ¶ added in v0.6.2
func Preview( o *PreviewOptions, runtime runtime.Runtime, storage states.StateStorage, planResources *models.Spec, project *projectstack.Project, stack *projectstack.Stack, ) (*opsmodels.Changes, error)
The Preview function calculates the upcoming actions of each resource through the execution Kusion Engine, and you can customize the runtime of engine and the state storage through `runtime` and `storage` parameters.
Example:
o := NewPreviewOptions() stateStorage := &states.FileSystemState{ Path: filepath.Join(o.WorkDir, states.KusionState) } kubernetesRuntime, err := runtime.NewKubernetesRuntime() if err != nil { return err } changes, err := Preview(o, kubernetesRuntime, stateStorage, planResources, project, stack, os.Stdout) if err != nil { return err }
Types ¶
type PreviewFlags ¶ added in v0.6.2
type PreviewOptions ¶
type PreviewOptions struct { compilecmd.CompileOptions PreviewFlags backend.BackendOps }
func NewPreviewOptions ¶
func NewPreviewOptions() *PreviewOptions
func (*PreviewOptions) AddPreviewFlags ¶ added in v0.6.2
func (o *PreviewOptions) AddPreviewFlags(cmd *cobra.Command)
func (*PreviewOptions) Complete ¶
func (o *PreviewOptions) Complete(args []string)
func (*PreviewOptions) Run ¶
func (o *PreviewOptions) Run() error
func (*PreviewOptions) Validate ¶
func (o *PreviewOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.