mirror of https://github.com/kubernetes/kops.git
				
				
				
			Create feature flag to disable Terraform managed files
This commit is contained in:
		
							parent
							
								
									e90f2cc834
								
							
						
					
					
						commit
						f76c9559bc
					
				|  | @ -93,12 +93,14 @@ var ( | |||
| 	Azure = New("Azure", Bool(false)) | ||||
| 	// KopsControllerStateStore enables fetching the kops state from kops-controller, instead of requiring access to S3/GCS/etc.
 | ||||
| 	KopsControllerStateStore = New("KopsControllerStateStore", Bool(false)) | ||||
| 	// APIServerNodes enables ability to provision nodes that only run the kube-apiserver
 | ||||
| 	// APIServerNodes enables ability to provision nodes that only run the kube-apiserver.
 | ||||
| 	APIServerNodes = New("APIServerNodes", Bool(false)) | ||||
| 	// UseAddonOperators activates experimental addon operator support
 | ||||
| 	UseAddonOperators = New("UseAddonOperators", Bool(false)) | ||||
| 	// AWSIPv6 activates experimental AWS IPv6 support.
 | ||||
| 	AWSIPv6 = New("AWSIPv6", Bool(false)) | ||||
| 	// TerraformManagedFiles enables rendering managed files into the Terraform configuration.
 | ||||
| 	TerraformManagedFiles = New("TerraformManagedFiles", Bool(true)) | ||||
| ) | ||||
| 
 | ||||
| // FeatureFlag defines a feature flag
 | ||||
|  |  | |||
|  | @ -18,6 +18,7 @@ go_library( | |||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//pkg/acls:go_default_library", | ||||
|         "//pkg/featureflag:go_default_library", | ||||
|         "//pkg/pki:go_default_library", | ||||
|         "//upup/pkg/fi:go_default_library", | ||||
|         "//upup/pkg/fi/cloudup/terraform:go_default_library", | ||||
|  |  | |||
|  | @ -21,6 +21,8 @@ import ( | |||
| 	"fmt" | ||||
| 	"os" | ||||
| 
 | ||||
| 	"k8s.io/kops/pkg/featureflag" | ||||
| 
 | ||||
| 	"k8s.io/apimachinery/pkg/util/validation/field" | ||||
| 	"k8s.io/kops/pkg/acls" | ||||
| 	"k8s.io/kops/upup/pkg/fi" | ||||
|  | @ -151,6 +153,10 @@ func getBasePath(c *fi.Context, e *ManagedFile) (vfs.Path, error) { | |||
| 
 | ||||
| // RenderTerraform is responsible for rendering the terraform json.
 | ||||
| func (f *ManagedFile) RenderTerraform(c *fi.Context, t *terraform.TerraformTarget, a, e, changes *ManagedFile) error { | ||||
| 	if !featureflag.TerraformManagedFiles.Enabled() { | ||||
| 		return f.Render(c, a, e, changes) | ||||
| 	} | ||||
| 
 | ||||
| 	location := fi.StringValue(e.Location) | ||||
| 	if location == "" { | ||||
| 		return fi.RequiredField("Location") | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue