preview

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdPreview

func NewCmdPreview() *cobra.Command

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 PreviewFlags struct {
	Operator     string
	Detail       bool
	All          bool
	NoStyle      bool
	IgnoreFields []string
}

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

Jump to

Keyboard shortcuts

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