preview

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdPreview

func NewCmdPreview() *cobra.Command

func Preview

func Preview(
	o *Options,
	storage state.Storage,
	planResources *apiv1.Intent,
	proj *apiv1.Project,
	stack *apiv1.Stack,
) (*models.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 Flags added in v0.9.0

type Flags struct {
	Operator     string
	Detail       bool
	All          bool
	NoStyle      bool
	Output       string
	IntentFile   string
	IgnoreFields []string
}

type Options added in v0.9.0

type Options struct {
	build.Options
	Flags
}

func NewPreviewOptions

func NewPreviewOptions() *Options

func (*Options) AddPreviewFlags added in v0.9.0

func (o *Options) AddPreviewFlags(cmd *cobra.Command)

func (*Options) Complete added in v0.9.0

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

func (*Options) Run added in v0.9.0

func (o *Options) Run() error

func (*Options) Validate added in v0.9.0

func (o *Options) Validate() error

func (*Options) ValidateIntentFile added in v0.9.1

func (o *Options) ValidateIntentFile() error

Jump to

Keyboard shortcuts

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