From d16ae2a6f732efc559b3b7b8fafa62c1f95e2ec0 Mon Sep 17 00:00:00 2001 From: Zheng Xi Zhou Date: Mon, 22 Nov 2021 19:12:42 +0800 Subject: [PATCH] Fix: allow external cloud resources to be kept when Application is deleted (#2750) Provide an option for users whether to keep provisioned cloud resources when Terraform-typed Application is deleted. Fix #2697 --- apis/core.oam.dev/common/types.go | 10 +--- .../common/zz_generated.deepcopy.go | 7 +-- .../crds/core.oam.dev_traitdefinitions.yaml | 10 ++++ .../core.oam.dev_workloaddefinitions.yaml | 10 ++++ .../core.oam.dev_applicationrevisions.yaml | 48 +++++++++++++++++++ .../core.oam.dev_componentdefinitions.yaml | 10 ++++ .../core.oam.dev_definitionrevisions.yaml | 24 ++++++++++ .../crds/core.oam.dev_policydefinitions.yaml | 5 ++ .../crds/core.oam.dev_traitdefinitions.yaml | 10 ++++ .../core.oam.dev_workflowstepdefinitions.yaml | 5 ++ .../core.oam.dev_workloaddefinitions.yaml | 10 ++++ .../vela-core/templates/addons/terraform.yaml | 2 +- .../core.oam.dev_applicationrevisions.yaml | 48 +++++++++++++++++++ .../core.oam.dev_definitionrevisions.yaml | 24 ++++++++++ .../crds/core.oam.dev_policydefinitions.yaml | 5 ++ .../crds/core.oam.dev_traitdefinitions.yaml | 10 ++++ .../core.oam.dev_workflowstepdefinitions.yaml | 5 ++ .../core.oam.dev_workloaddefinitions.yaml | 10 ++++ go.mod | 2 +- go.sum | 7 ++- .../core.oam.dev_applicationrevisions.yaml | 48 +++++++++++++++++++ .../core.oam.dev_componentdefinitions.yaml | 10 ++++ .../core.oam.dev_definitionrevisions.yaml | 24 ++++++++++ .../crds/core.oam.dev_policydefinitions.yaml | 5 ++ .../crds/core.oam.dev_traitdefinitions.yaml | 10 ++++ .../core.oam.dev_workflowstepdefinitions.yaml | 5 ++ .../core.oam.dev_workloaddefinitions.yaml | 10 ++++ vela-templates/addons/auto-gen/terraform.yaml | 2 +- vela-templates/addons/terraform/template.yaml | 2 +- 29 files changed, 358 insertions(+), 20 deletions(-) diff --git a/apis/core.oam.dev/common/types.go b/apis/core.oam.dev/common/types.go index 3cb3f1986..073df0001 100644 --- a/apis/core.oam.dev/common/types.go +++ b/apis/core.oam.dev/common/types.go @@ -19,13 +19,11 @@ package common import ( "encoding/json" + "github.com/oam-dev/terraform-controller/api/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" - types "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime" - "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" - "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" ) @@ -114,11 +112,7 @@ type Terraform struct { // +kubebuilder:validation:Enum:=hcl;json;remote Type string `json:"type,omitempty"` - // Path is the sub-directory of remote git repository. It's valid when remote is set - Path string `json:"path,omitempty"` - - // ProviderReference specifies the reference to Provider - ProviderReference *types.Reference `json:"providerRef,omitempty"` + v1beta1.BaseConfigurationSpec `json:",inline"` } // A WorkloadTypeDescriptor refer to a Workload Type diff --git a/apis/core.oam.dev/common/zz_generated.deepcopy.go b/apis/core.oam.dev/common/zz_generated.deepcopy.go index c636ac71c..6e898402f 100644 --- a/apis/core.oam.dev/common/zz_generated.deepcopy.go +++ b/apis/core.oam.dev/common/zz_generated.deepcopy.go @@ -21,7 +21,6 @@ limitations under the License. package common import ( - crossplane_runtime "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -559,11 +558,7 @@ func (in *SubStepsStatus) DeepCopy() *SubStepsStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Terraform) DeepCopyInto(out *Terraform) { *out = *in - if in.ProviderReference != nil { - in, out := &in.ProviderReference, &out.ProviderReference - *out = new(crossplane_runtime.Reference) - **out = **in - } + in.BaseConfigurationSpec.DeepCopyInto(&out.BaseConfigurationSpec) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform. diff --git a/charts/oam-runtime/crds/core.oam.dev_traitdefinitions.yaml b/charts/oam-runtime/crds/core.oam.dev_traitdefinitions.yaml index 3f33343d6..73f5e55b6 100644 --- a/charts/oam-runtime/crds/core.oam.dev_traitdefinitions.yaml +++ b/charts/oam-runtime/crds/core.oam.dev_traitdefinitions.yaml @@ -188,6 +188,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -472,6 +477,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/oam-runtime/crds/core.oam.dev_workloaddefinitions.yaml b/charts/oam-runtime/crds/core.oam.dev_workloaddefinitions.yaml index 394473b85..68441b531 100644 --- a/charts/oam-runtime/crds/core.oam.dev_workloaddefinitions.yaml +++ b/charts/oam-runtime/crds/core.oam.dev_workloaddefinitions.yaml @@ -193,6 +193,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -458,6 +463,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml b/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml index dbc74dd46..bd9517705 100644 --- a/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml +++ b/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml @@ -1232,6 +1232,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1639,6 +1645,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1944,6 +1956,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -3372,6 +3390,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -3672,6 +3696,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4061,6 +4091,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4329,6 +4365,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4617,6 +4659,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml b/charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml index 519bb7a93..6579a1839 100644 --- a/charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml +++ b/charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml @@ -179,6 +179,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -467,6 +472,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml b/charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml index ce9d540dd..b6ee804b9 100644 --- a/charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml +++ b/charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml @@ -222,6 +222,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -510,6 +516,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -791,6 +803,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1053,6 +1071,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_policydefinitions.yaml b/charts/vela-core/crds/core.oam.dev_policydefinitions.yaml index 16eeb0635..6639a4b7e 100644 --- a/charts/vela-core/crds/core.oam.dev_policydefinitions.yaml +++ b/charts/vela-core/crds/core.oam.dev_policydefinitions.yaml @@ -151,6 +151,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml b/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml index 3f33343d6..73f5e55b6 100644 --- a/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml +++ b/charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml @@ -188,6 +188,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -472,6 +477,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_workflowstepdefinitions.yaml b/charts/vela-core/crds/core.oam.dev_workflowstepdefinitions.yaml index c6a0d4353..72073dfa0 100644 --- a/charts/vela-core/crds/core.oam.dev_workflowstepdefinitions.yaml +++ b/charts/vela-core/crds/core.oam.dev_workflowstepdefinitions.yaml @@ -148,6 +148,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml b/charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml index 394473b85..68441b531 100644 --- a/charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml +++ b/charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml @@ -193,6 +193,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -458,6 +463,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-core/templates/addons/terraform.yaml b/charts/vela-core/templates/addons/terraform.yaml index 59028cf1b..21466cc0b 100644 --- a/charts/vela-core/templates/addons/terraform.yaml +++ b/charts/vela-core/templates/addons/terraform.yaml @@ -23,7 +23,7 @@ data: chart: terraform-controller repoType: helm url: https://charts.kubevela.net/addons - version: 0.2.6 + version: 0.2.8 type: helm - name: alibaba-ack properties: diff --git a/charts/vela-minimal/crds/core.oam.dev_applicationrevisions.yaml b/charts/vela-minimal/crds/core.oam.dev_applicationrevisions.yaml index dbc74dd46..bd9517705 100644 --- a/charts/vela-minimal/crds/core.oam.dev_applicationrevisions.yaml +++ b/charts/vela-minimal/crds/core.oam.dev_applicationrevisions.yaml @@ -1232,6 +1232,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1639,6 +1645,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1944,6 +1956,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -3372,6 +3390,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -3672,6 +3696,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4061,6 +4091,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4329,6 +4365,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4617,6 +4659,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-minimal/crds/core.oam.dev_definitionrevisions.yaml b/charts/vela-minimal/crds/core.oam.dev_definitionrevisions.yaml index ce9d540dd..b6ee804b9 100644 --- a/charts/vela-minimal/crds/core.oam.dev_definitionrevisions.yaml +++ b/charts/vela-minimal/crds/core.oam.dev_definitionrevisions.yaml @@ -222,6 +222,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -510,6 +516,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -791,6 +803,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1053,6 +1071,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-minimal/crds/core.oam.dev_policydefinitions.yaml b/charts/vela-minimal/crds/core.oam.dev_policydefinitions.yaml index 16eeb0635..6639a4b7e 100644 --- a/charts/vela-minimal/crds/core.oam.dev_policydefinitions.yaml +++ b/charts/vela-minimal/crds/core.oam.dev_policydefinitions.yaml @@ -151,6 +151,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-minimal/crds/core.oam.dev_traitdefinitions.yaml b/charts/vela-minimal/crds/core.oam.dev_traitdefinitions.yaml index 3f33343d6..73f5e55b6 100644 --- a/charts/vela-minimal/crds/core.oam.dev_traitdefinitions.yaml +++ b/charts/vela-minimal/crds/core.oam.dev_traitdefinitions.yaml @@ -188,6 +188,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -472,6 +477,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-minimal/crds/core.oam.dev_workflowstepdefinitions.yaml b/charts/vela-minimal/crds/core.oam.dev_workflowstepdefinitions.yaml index c6a0d4353..72073dfa0 100644 --- a/charts/vela-minimal/crds/core.oam.dev_workflowstepdefinitions.yaml +++ b/charts/vela-minimal/crds/core.oam.dev_workflowstepdefinitions.yaml @@ -148,6 +148,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/charts/vela-minimal/crds/core.oam.dev_workloaddefinitions.yaml b/charts/vela-minimal/crds/core.oam.dev_workloaddefinitions.yaml index 394473b85..68441b531 100644 --- a/charts/vela-minimal/crds/core.oam.dev_workloaddefinitions.yaml +++ b/charts/vela-minimal/crds/core.oam.dev_workloaddefinitions.yaml @@ -193,6 +193,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -458,6 +463,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/go.mod b/go.mod index 0d1789d8c..13f6ec4d8 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/mitchellh/hashstructure/v2 v2.0.1 github.com/oam-dev/cluster-gateway v1.1.6 github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 - github.com/oam-dev/terraform-controller v0.2.6 + github.com/oam-dev/terraform-controller v0.2.8 github.com/olekukonko/tablewriter v0.0.5 github.com/onsi/ginkgo v1.16.4 github.com/onsi/gomega v1.16.0 diff --git a/go.sum b/go.sum index 22c27e841..58a4ba485 100644 --- a/go.sum +++ b/go.sum @@ -181,6 +181,7 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alessio/shellescape v1.2.2 h1:8LnL+ncxhWT2TR00dfJRT25JWWrhkMZXneHVWnetDZg= github.com/alessio/shellescape v1.2.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1318/go.mod h1:9CMdKNL3ynIGPpfTcdwTvIm8SGuAZYYC4jFVSSvE1YQ= github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= @@ -673,6 +674,7 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= @@ -964,6 +966,7 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -1214,8 +1217,8 @@ github.com/oam-dev/stern v1.13.1 h1:Gt7xMBmQjRueHVFjRo5CHDTVhiYrssjlmvPwRiZtq7c= github.com/oam-dev/stern v1.13.1/go.mod h1:0pLjZt0amXE/ErF16Rdrgd98H2owN8Hmn3/7CX5+AeA= github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 h1:tD8HiFKnt0jnwdTWjeqUnfnUYLD/+Nsmj8ZGIxqDWiU= github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28/go.mod h1:Mu8i0/DdplvnjwRbAYPsc8+LRR27n/mp8VWdkN10GzE= -github.com/oam-dev/terraform-controller v0.2.6 h1:aoEj4sfxDMBdTkM5uKYmjVFOgjhYeYBm0xzdRb4+Xu0= -github.com/oam-dev/terraform-controller v0.2.6/go.mod h1:xFSCd3Nwuh6P1HEpx5jDnLzN35T9hoH53zdojDYE6LI= +github.com/oam-dev/terraform-controller v0.2.8 h1:DXqDDP4mWLNThVgPwr/9uvHC1TR40drBCU2XnlRkmm0= +github.com/oam-dev/terraform-controller v0.2.8/go.mod h1:6YPAr54np9qwBCmOdK7OAhJ9sOlm3JgSFMP4QfiS4FY= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml index 359245ee1..c391b38fb 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml @@ -1232,6 +1232,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1639,6 +1645,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1944,6 +1956,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -3372,6 +3390,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -3672,6 +3696,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4061,6 +4091,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4329,6 +4365,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -4617,6 +4659,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_componentdefinitions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_componentdefinitions.yaml index c8edcfbc4..7077bf557 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_componentdefinitions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_componentdefinitions.yaml @@ -179,6 +179,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -467,6 +472,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_definitionrevisions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_definitionrevisions.yaml index f723729fd..16226c92d 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_definitionrevisions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_definitionrevisions.yaml @@ -222,6 +222,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -510,6 +516,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -791,6 +803,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -1053,6 +1071,12 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether + provisioned cloud resources will be deleted when + CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_policydefinitions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_policydefinitions.yaml index 925e30f5f..944262ee0 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_policydefinitions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_policydefinitions.yaml @@ -151,6 +151,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_traitdefinitions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_traitdefinitions.yaml index 3b54c2a6e..ba9640f1c 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_traitdefinitions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_traitdefinitions.yaml @@ -188,6 +188,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -472,6 +477,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflowstepdefinitions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflowstepdefinitions.yaml index 9303ba2d9..008abfc92 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflowstepdefinitions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_workflowstepdefinitions.yaml @@ -148,6 +148,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_workloaddefinitions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_workloaddefinitions.yaml index 9b48f018f..8af6fe857 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_workloaddefinitions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_workloaddefinitions.yaml @@ -193,6 +193,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set @@ -458,6 +463,11 @@ spec: configuration: description: Configuration is Terraform Configuration type: string + deleteResource: + default: true + description: DeleteResource will determine whether provisioned + cloud resources will be deleted when CR is deleted + type: boolean path: description: Path is the sub-directory of remote git repository. It's valid when remote is set diff --git a/vela-templates/addons/auto-gen/terraform.yaml b/vela-templates/addons/auto-gen/terraform.yaml index b3f724a10..c6cfba640 100644 --- a/vela-templates/addons/auto-gen/terraform.yaml +++ b/vela-templates/addons/auto-gen/terraform.yaml @@ -20,7 +20,7 @@ spec: chart: terraform-controller repoType: helm url: https://charts.kubevela.net/addons - version: 0.2.6 + version: 0.2.8 type: helm - name: alibaba-ack properties: diff --git a/vela-templates/addons/terraform/template.yaml b/vela-templates/addons/terraform/template.yaml index 3cf3c338f..cd910e120 100644 --- a/vela-templates/addons/terraform/template.yaml +++ b/vela-templates/addons/terraform/template.yaml @@ -33,7 +33,7 @@ spec: repoType: helm url: https://charts.kubevela.net/addons chart: terraform-controller - version: 0.2.6 + version: 0.2.8 {{ range .ResourceFiles }} - name: {{ .Name }} type: raw