Merge pull request #10106 from johngmyers/tf-json

Remove dependency of TerraformJSON feature flag
This commit is contained in:
Kubernetes Prow Robot 2020-10-26 07:23:01 -07:00 committed by GitHub
commit d739bae871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -194,9 +194,9 @@ func TestBastionAdditionalUserData(t *testing.T) {
// TestMinimalJSON runs the test on a minimal data set and outputs JSON
func TestMinimalJSON(t *testing.T) {
featureflag.ParseFlags("+TerraformJSON,-Terraform-0.12")
featureflag.ParseFlags("+TerraformJSON")
unsetFeaureFlag := func() {
featureflag.ParseFlags("-TerraformJSON,+Terraform-0.12")
featureflag.ParseFlags("-TerraformJSON")
}
defer unsetFeaureFlag()
newIntegrationTest("minimal-json.example.com", "minimal-json").withJSONOutput().runTestTerraformAWS(t)

View File

@ -725,7 +725,7 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error {
checkExisting = false
outDir := c.OutDir
tfVersion := terraform.Version011
if featureflag.Terraform012.Enabled() {
if featureflag.Terraform012.Enabled() && !featureflag.TerraformJSON.Enabled() {
tfVersion = terraform.Version012
}
tf := terraform.NewTerraformTarget(cloud, region, project, outDir, tfVersion, cluster.Spec.Target)

View File

@ -216,7 +216,7 @@ func (t *LaunchTemplate) RenderTerraform(target *terraform.TerraformTarget, a, e
return err
}
if d != nil {
if featureflag.Terraform012.Enabled() {
if featureflag.Terraform012.Enabled() && !featureflag.TerraformJSON.Enabled() {
userDataResource := fi.WrapResource(fi.NewBytesResource(d))
tf.UserData, err = target.AddFile("aws_launch_template", fi.StringValue(e.Name), "user_data", userDataResource, true)