-
Notifications
You must be signed in to change notification settings - Fork 15
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: resource env0_environment - add support to change template_id #998
Conversation
/review |
@@ -382,13 +381,6 @@ func resourceEnvironment() *schema.Resource { | |||
Optional: true, | |||
}, | |||
}, | |||
CustomizeDiff: customdiff.ValidateChange("template_id", func(ctx context.Context, oldValue, newValue, meta interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this blocked changing template_id...
@@ -736,7 +728,7 @@ func shouldDeploy(d *schema.ResourceData) bool { | |||
} | |||
} | |||
|
|||
return d.HasChanges("revision", "configuration", "sub_environment_configuration", "variable_sets") | |||
return d.HasChanges("revision", "configuration", "sub_environment_configuration", "variable_sets", "template_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will call redeploy if template_id has changed.
@@ -626,6 +643,12 @@ func TestUnitEnvironmentResource(t *testing.T) { | |||
mock.EXPECT().ConfigurationSetsAssignments("ENVIRONMENT", environment.Id).Times(1).Return(nil, nil), | |||
mock.EXPECT().Environment(environment.Id).Times(1).Return(environment, nil), | |||
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeEnvironment, environment.Id).Times(1).Return(client.ConfigurationChanges{}, nil), | |||
mock.EXPECT().ConfigurationSetsAssignments("ENVIRONMENT", environment.Id).Times(2).Return(nil, nil), | |||
mock.EXPECT().EnvironmentDeploy(environment.Id, deployRequest).Times(1).Return(client.EnvironmentDeployResponse{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is important - it shows that redeploy is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Co-authored-by: Liran Farage <[email protected]>
Issue & Steps to Reproduce / Feature Request
resolves #986
Solution