Skip to content

Commit

Permalink
passing 'workflow' in type
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Feb 1, 2023
1 parent 5a6680a commit e44c2ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ type EnvironmentCreate struct {
TerragruntWorkingDirectory string `json:"terragruntWorkingDirectory,omitempty"`
VcsCommandsAlias string `json:"vcsCommandsAlias"`
IsRemoteBackend *bool `json:"isRemoteBackend,omitempty" tfschema:"-"`
Type string `json:"type,omitempty"`
}

// When converted to JSON needs to be flattened. See custom MarshalJSON below.
Expand Down
2 changes: 2 additions & 0 deletions env0/resource_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ func getCreatePayload(d *schema.ResourceData, apiClient client.ApiClientInterfac
}

if len(subEnvironments) > 0 {
payload.Type = "workflow"

deployPayload.SubEnvironments = make(map[string]client.SubEnvironment)

for _, subEnvironment := range subEnvironments {
Expand Down
1 change: 1 addition & 0 deletions env0/resource_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,7 @@ func TestUnitEnvironmentWithoutSubEnvironment(t *testing.T) {
},
},
},
Type: "workflow",
}

template := client.Template{
Expand Down

0 comments on commit e44c2ee

Please sign in to comment.