-
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
Add advanced_machine_features
to GCE Instance Templates
#4850
Add advanced_machine_features
to GCE Instance Templates
#4850
Conversation
Co-authored-by: upodroid <[email protected]>
Co-authored-by: upodroid <[email protected]>
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @ScottSuarez, please review this PR or find an appropriate assignee. |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=190965" |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=190967" |
getting a build failure in tpc build process
|
Maybe enable dependabot on that repo? |
/gcbrun - updated the deps |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191771" |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191772" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccInstanceTemplateDatasource_filter_mostRecent|TestAccComputeBackendService_withSecurityPolicy|TestAccComputeInstanceTemplate_AdvancedMachineFeatures|TestAccComputeSecurityPolicy_basic|TestAccComputeSecurityPolicy_withRule|TestAccComputeSecurityPolicy_withRuleExpr|TestAccComputeSecurityPolicy_update You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191774" |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191795" |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191798" |
/gcbrun - fixed downstream images |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191807" |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=191809" |
@@ -556,11 +556,38 @@ func resourceComputeInstanceTemplate() *schema.Resource { | |||
"enable_confidential_compute": { | |||
Type: schema.TypeBool, | |||
Required: true, | |||
ForceNew: true, |
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.
@ScottSuarez @upodroid: Why was this made ForceNew
? That's appears to be a breaking change at first glance, and I can't see any context in this PR on why it wouldn't be in this circumstance.
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.
It was something I forgot when I first added CVM to this resource. The resource doesn't have an update method so it is safe to sneak this change through.
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.
Ack, thanks. If you're making similar changes in the future can you make sure to specifically call that out when you send the review? Showing that modifying the field always returns an error is quick to collect and does all we need to justify the change.
One case that gives me pause as a reviewer is when Terraform doesn't return an error. We may want to avoid the change in those cases, even if it's correct. Unfortunately not all users run terraform plan
before apply, particularly after provider updates, and depending on the circumstances we may want to not make the change until a major version.
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.
I'll bear that in mind. There isn't a fix for end users running apply carelessly and not pinning provider versions.
Type: schema.TypeList, | ||
MaxItems: 1, | ||
Optional: true, | ||
Computed: true, |
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.
@upodroid: Just curious, why did you choose to make the value Computed: true
? I haven't seen the API return a default value, does it have a default that changes based on other configuration between the resource? (sorry for the drive-by comments here, there's a conversation internally about the implementation of the field)
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.
Yeah, values were computed in google_compute_instance
so I copied them over. I did the bulk of the testing with google_compute_instance
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! And GCE Instance will return the value when not sent in some circumstances?
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.
Also see hashicorp/terraform-provider-google#9436 if you're interested in some of the context here, I'm seeing @karlkfi decided to comment around the same time I did 🙂
Type: schema.TypeList, | ||
MaxItems: 1, | ||
Optional: true, | ||
Computed: true, |
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.
Does this need to be Computed=true?
It seems like this would cause undesirable behavior.
Going from
advanced_machine_features {
threads_per_core = 1
enable_nested_virtualization = true
}
to
// removed
would NOT trigger an update/recreate. It would just be ignored, even tho the threads_per_core
default value is 0.
Part of hashicorp/terraform-provider-google#9251
Raised instance template separately as it is easier to work with. There is a bug in the instances update method.
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)