-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
dataflow job update-by-replacement #3387
dataflow job update-by-replacement #3387
Conversation
b8ce119
to
1123f40
Compare
1 similar comment
params := expandStringMap(d, "parameters") | ||
labels := expandStringMap(d, "labels") | ||
|
||
env := dataflow.RuntimeEnvironment{ |
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.
can this be made into a function that can be called from both create and update?
third_party/terraform/website/docs/r/dataflow_job.html.markdown
Outdated
Show resolved
Hide resolved
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.
For the changelog, I think (but you'll want to verify) you can actually separate it out into two different release note blocks. That way you could do one enhancement block for the new changes, and another note
or breaking-change
block for the other stuff.
@@ -182,6 +183,35 @@ func TestAccDataflowJob_withIpConfig(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccDataflowJob_streamUpdate(t *testing.T) { |
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.
Oh, how possible would it be to do one that tests the contents of the template changing?
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.
Should be possible, and a good test to add. I'll cook one up.
3f6bdb5
to
b479f2d
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 192 insertions(+), 13 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 198 insertions(+), 13 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 214 insertions(+), 32 deletions(-)) |
Reverted all of the template hash logic, modified the update test, and added a retry to the update-by-replacement call. |
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.
LGTM assuming tests pass
return err | ||
} | ||
optionsMap := sdkPipelineOptions["options"].(map[string]interface{}) | ||
d.Set("template_gcs_path", optionsMap["templateLocation"]) |
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.
Can you add to the CHANGELOG that we now detect drift on these fields?
} | ||
on_delete = "cancel" | ||
} | ||
`, suffix, suffix, suffix, suffix, testDataflowJobTemplateTextToPubsub, tempLocation) |
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.
Should the last two params here be switched?
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.
The field names are confusing, but it is correct as it is. template_gcs_path
needs to remain fixed, temp_gcs_location
is the field I am actually updating.
Ran all dataflow tests in TC, looks good. |
@@ -100,13 +103,13 @@ func resourceDataflowJob() *schema.Resource { | |||
ValidateFunc: validation.StringInSlice([]string{"cancel", "drain"}, false), |
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.
Hi @c2thorn, does this mean that changes to on_delete
would also trigger an update-by-replacement?
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.
Hi, yes that is true. Previously any changes to on_delete
would destroy/recreate both stream or batch jobs. Now it will trigger the update-by-replacement for streaming jobs, while retaining the same destroy/recreate functionality for batch.
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.
Oh that's interesting that we used to ForceNew on that! It probably should be something that can be updatable completely on its own, without triggering a ForceNew or an update-by-replacement.
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.
Ah yeah I was surprised to see that it used to be ForceNew
as well.
I agree that this field should be updatable on its own without triggering a ForceNew or update-by-replacement. Would you like me to file this as a separate issue?
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.
Created hashicorp/terraform-provider-google#6301 to track
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.
Thanks!
Fixes hashicorp/terraform-provider-google#5991
template_md5hash
Release Note Template for Downstream PRs (will be copied)