Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support spec as input #400

Merged
merged 10 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/cmd/en_US/kusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kusion [flags]
### SEE ALSO

* [kusion apply](kusion_apply.md) - Apply the operation intents of various resources to multiple runtimes
* [kusion check](kusion_check.md) - Check if KCL configurations in current directory ok to compile
* [kusion compile](kusion_compile.md) - Compile KCL into YAML
* [kusion deps](kusion_deps.md) - Show KCL file dependency information
* [kusion destroy](kusion_destroy.md) - Delete the specified resources in runtime
Expand All @@ -28,4 +29,4 @@ kusion [flags]
* [kusion preview](kusion_preview.md) - Preview a series of resource changes within the stack
* [kusion version](kusion_version.md) - Print the Kusion version information for the current context

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
10 changes: 7 additions & 3 deletions docs/cmd/en_US/kusion_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Apply the operation intents of various resources to multiple runtimes

Apply a series of resource changes within the stack.

Create or update or delete resources according to the KCL files within a stack. By default, Kusion will generate an execution plan and present it for your approval before taking any action.
Create or update or delete resources according to the KCL files within a stack. By default, Kusion will generate an execution plan and present it for your approval before taking any action.

You can check the plan details and then decide if the actions should be taken or aborted.
You can check the plan details and then decide if the actions should be taken or aborted.

```
kusion apply [flags]
Expand All @@ -26,6 +26,9 @@ kusion apply [flags]
# Apply with specifying setting file
kusion apply -Y settings.yaml

# Apply with specifying spec file
kusion apply --spec-file ci-test/stdout.golden.yaml

# Skip interactive approval of plan details before applying
kusion apply --yes

Expand All @@ -49,6 +52,7 @@ kusion apply [flags]
-o, --output string Specify the output format
-O, --overrides strings Specify the configuration override path and value
-Y, --setting strings Specify the command line setting files
--spec-file string Specify the spec file path as input, and the spec file must be located in the working directory or its subdirectories
--watch After creating/updating/deleting the requested object, watch for changes
-w, --workdir string Specify the work directory
-y, --yes Automatically approve and perform the update after previewing it
Expand All @@ -58,4 +62,4 @@ kusion apply [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
4 changes: 2 additions & 2 deletions docs/cmd/en_US/kusion_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Check if KCL configurations in current directory ok to compile

### Synopsis

Check if KCL configurations in current directory ok to compile.
Check if KCL configurations in current directory ok to compile

```
kusion check [flags]
Expand Down Expand Up @@ -42,4 +42,4 @@ kusion check [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
4 changes: 2 additions & 2 deletions docs/cmd/en_US/kusion_compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Compile KCL into YAML

Compile one or more KCL files.

The KCL filename must be specified. You can specify a list of arguments to replace the placeholders defined in KCL, and output the compiled results to a file when using --output flag.
The KCL filename must be specified. You can specify a list of arguments to replace the placeholders defined in KCL, and output the compiled results to a file when using --output flag.

```
kusion compile [flags]
Expand Down Expand Up @@ -55,4 +55,4 @@ kusion compile [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/en_US/kusion_deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ kusion deps [WORKDIR] [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
6 changes: 3 additions & 3 deletions docs/cmd/en_US/kusion_destroy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Delete the specified resources in runtime

Delete resources by resource spec.

Only KCL files are accepted. Only one type of arguments may be specified: filenames, resources and names, or resources and label selector.
Only KCL files are accepted. Only one type of arguments may be specified: filenames, resources and names, or resources and label selector.

Note that the destroy command does NOT do resource version checks, so if someone submits an update to a resource right when you submit a destroy, their update will be lost along with the rest of the resource.
Note that the destroy command does NOT do resource version checks, so if someone submits an update to a resource right when you submit a destroy, their update will be lost along with the rest of the resource.

```
kusion destroy [flags]
Expand Down Expand Up @@ -40,4 +40,4 @@ kusion destroy [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/en_US/kusion_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ kusion env [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
4 changes: 2 additions & 2 deletions docs/cmd/en_US/kusion_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Initialize the scaffolding for a project

This command initializes the scaffolding for a project, generating a project from an appointed template with correct structure.

The scaffold templates can be retrieved from local or online. The built-in templates are used by default, self-defined templates are also supported by assigning the template repository path.
The scaffold templates can be retrieved from local or online. The built-in templates are used by default, self-defined templates are also supported by assigning the template repository path.

```
kusion init
Expand Down Expand Up @@ -45,4 +45,4 @@ kusion init
* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack
* [kusion init templates](kusion_init_templates.md) - List templates used to initialize a project

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/en_US/kusion_init_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ kusion init templates

* [kusion init](kusion_init.md) - Initialize the scaffolding for a project

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/en_US/kusion_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ kusion ls [WORKDIR] [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
8 changes: 6 additions & 2 deletions docs/cmd/en_US/kusion_preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Preview a series of resource changes within the stack

Preview a series of resource changes within the stack.

Create or update or delete resources according to the KCL files within a stack. By default, Kusion will generate an execution plan and present it for your approval before taking any action.
Create or update or delete resources according to the KCL files within a stack. By default, Kusion will generate an execution plan and present it for your approval before taking any action.

```
kusion preview [flags]
Expand All @@ -24,6 +24,9 @@ kusion preview [flags]
# Preview with specifying setting file
kusion preview -Y settings.yaml

# Preview with specifying spec file
kuions preview --spec-file ci-test/stdout.golden.yaml

# Preview with ignored fields
kusion preview --ignore-fields="metadata.generation,metadata.managedFields

Expand All @@ -49,11 +52,12 @@ kusion preview [flags]
-o, --output string Specify the output format
-O, --overrides strings Specify the configuration override path and value
-Y, --setting strings Specify the command line setting files
--spec-file string Specify the spec file path as input, and the spec file must be located in the working directory or its subdirectories
-w, --workdir string Specify the work directory
```

### SEE ALSO

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/en_US/kusion_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ kusion version [flags]

* [kusion](kusion.md) - Kusion is the platform engineering engine of KusionStack

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
3 changes: 2 additions & 1 deletion docs/cmd/zh_CN/kusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kusion [flags]
### SEE ALSO

* [kusion apply](kusion_apply.md) - 将各类资源的运维意图 apply 至多种运行时里 (Kubernetes、AWS/阿里云以及自建系统等)
* [kusion check](kusion_check.md) - 检查当前目录中的 KCL 配置是否可以编译
* [kusion compile](kusion_compile.md) - 将 KCL 编译成 YAML
* [kusion deps](kusion_deps.md) - Show KCL file dependency information
* [kusion destroy](kusion_destroy.md) - 删除运行时中指定的资源
Expand All @@ -28,4 +29,4 @@ kusion [flags]
* [kusion preview](kusion_preview.md) - 预览 Stack 中的一系列资源更改
* [kusion version](kusion_version.md) - 打印当前 Kusion 的版本信息

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
7 changes: 4 additions & 3 deletions docs/cmd/zh_CN/kusion_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

将一系列资源变更 apply 到当前栈中。

在当前 Stack 中根据 KCL 文件创建、更新、删除资源。 默认情况下,在采取任何行动之前,Kusion 会生成一个执行计划,并提交给你批准。
在当前 Stack 中根据 KCL 文件创建、更新、删除资源。 默认情况下,在采取任何行动之前,Kusion 会生成一个执行计划,并提交给你批准。

你可以检查计划详细信息,然后决定是否应采取或中止这些操作。
你可以检查计划详细信息,然后决定是否应采取或中止这些操作。

```
kusion apply [flags]
Expand Down Expand Up @@ -49,6 +49,7 @@ kusion apply [flags]
-o, --output string 指定输出文件
-O, --overrides strings 指定配置覆盖路径和值
-Y, --setting strings 指定命令行配置文件
--spec-file string 指定 spec 文件路径作为输入,spce 文件必须位于工作目录或其子目录下
--watch 在创建/更新/删除请求的对象后,观测变更
-w, --workdir string 指定工作目录
-y, --yes 预览后自动审批并应用更新
Expand All @@ -58,4 +59,4 @@ kusion apply [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
4 changes: 2 additions & 2 deletions docs/cmd/zh_CN/kusion_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Check if KCL configurations in current directory ok to compile

### Synopsis

Check if KCL configurations in current directory ok to compile.
Check if KCL configurations in current directory ok to compile

```
kusion check [flags]
Expand Down Expand Up @@ -42,4 +42,4 @@ kusion check [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
4 changes: 2 additions & 2 deletions docs/cmd/zh_CN/kusion_compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

编译一个或多个 KCL 文件。

必须指定 KCL 文件名。 你可以指定参数列表来替换 KCL 中定义的占位符, 并在使用 --output 标志时将编译结果输出到文件。
必须指定 KCL 文件名。 你可以指定参数列表来替换 KCL 中定义的占位符, 并在使用 --output 标志时将编译结果输出到文件。

```
kusion compile [flags]
Expand Down Expand Up @@ -55,4 +55,4 @@ kusion compile [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/zh_CN/kusion_deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ kusion deps [WORKDIR] [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
6 changes: 3 additions & 3 deletions docs/cmd/zh_CN/kusion_destroy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

通过资源规约删除资源。

只接受 KCL 文件。只能指定一种类型的参数:文件名、资源、名称、资源或标签选择器。
只接受 KCL 文件。只能指定一种类型的参数:文件名、资源、名称、资源或标签选择器。

请注意,destroy 命令不会进行资源版本检查, 因此如果有人在你提交销毁时提交了对资源的更新, 他们的更新将与资源一起丢失。
请注意,destroy 命令不会进行资源版本检查, 因此如果有人在你提交销毁时提交了对资源的更新, 他们的更新将与资源一起丢失。

```
kusion destroy [flags]
Expand Down Expand Up @@ -40,4 +40,4 @@ kusion destroy [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/zh_CN/kusion_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ kusion env [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
4 changes: 2 additions & 2 deletions docs/cmd/zh_CN/kusion_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

该指令用于初始化一个 Project 脚手架,从选定的模板生成具备正确结构的 Project。

脚手架模板可以从本地或者线上获取。默认使用内置模板;若需要使用自定义的模板,需要指定模板仓库的地址。
脚手架模板可以从本地或者线上获取。默认使用内置模板;若需要使用自定义的模板,需要指定模板仓库的地址。

```
kusion init
Expand Down Expand Up @@ -45,4 +45,4 @@ kusion init
* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎
* [kusion init templates](kusion_init_templates.md) - 列出用于初始化 Project 的模板

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/zh_CN/kusion_init_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ kusion init templates

* [kusion init](kusion_init.md) - 初始化一个 Project 的脚手架

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/zh_CN/kusion_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ kusion ls [WORKDIR] [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
5 changes: 3 additions & 2 deletions docs/cmd/zh_CN/kusion_preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

预览 Stack 中的一系列资源更改。

根据 Stack 内的 KCL 文件创建或更新或删除资源。 默认情况下,Kusion 会生成一个执行计划并在采取任何行动之前将其提交给您批准。
根据 Stack 内的 KCL 文件创建或更新或删除资源。 默认情况下,Kusion 会生成一个执行计划并在采取任何行动之前将其提交给您批准。

```
kusion preview [flags]
Expand Down Expand Up @@ -46,11 +46,12 @@ kusion preview [flags]
-o, --output string 指定输出文件
-O, --overrides strings 指定配置覆盖路径和值
-Y, --setting strings 指定命令行配置文件
--spec-file string 指定 spec 文件路径作为输入,spce 文件必须位于工作目录或其子目录下
-w, --workdir string 指定工作目录
```

### SEE ALSO

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
2 changes: 1 addition & 1 deletion docs/cmd/zh_CN/kusion_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ kusion version [flags]

* [kusion](kusion.md) - Kusion 是 KusionStack 的平台工程引擎

###### Auto generated by spf13/cobra on 15-Jul-2023
###### Auto generated by spf13/cobra on 24-Jul-2023
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ require (
bou.ke/monkey v1.0.2
github.com/AlecAivazis/survey/v2 v2.3.4
github.com/Azure/go-autorest/autorest/mocks v0.4.1
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible
github.com/aws/aws-sdk-go v1.42.35
github.com/blang/semver/v4 v4.0.0
github.com/bytedance/mockey v1.2.4
github.com/chai2010/gettext-go v1.0.2
github.com/davecgh/go-spew v1.1.1
github.com/didi/gendry v1.7.0
Expand Down Expand Up @@ -98,7 +100,6 @@ require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/a8m/envsubst v1.3.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/agext/levenshtein v1.2.1 // indirect
Expand Down Expand Up @@ -142,6 +143,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/gookit/color v1.5.3 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/gosuri/uilive v0.0.4 // indirect
github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -163,6 +165,7 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand Down Expand Up @@ -203,6 +206,8 @@ require (
github.com/satori/go.uuid v1.2.0 // indirect
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
Expand All @@ -216,6 +221,7 @@ require (
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/arch v0.1.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
Expand Down
Loading
Loading