Migrate expandConfidentialInstanceConfig, flattenConfidentialInstanceConfig functions in compute_instance_helpers.go.tmpl to use direct HTTP rather than a client library#17721
Conversation
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 8c8be03: Diff reportYour PR generated the following diffs in downstream repositories:
Errors
Step 1: Replaying Mode Caution Build Failure during VCR tests 🔴 REPLAYING mode: The following packages failed to build:
Please fix the compilation errors to complete your PR. View the build log @nsamartsev VCR tests complete for 8c8be03! |
8c8be03 to
e54f1f8
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit e54f1f8: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
🟢 All tests passed! View the recording VCR build log or the debug logs folder for detailed results. @nsamartsev VCR tests complete for e54f1f8! |
193b70d to
88750fc
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 193b70d: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode 🟢 All tests passed in Replaying mode! No Recording was needed. View the replaying VCR build log @nsamartsev VCR tests complete for 193b70d! |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 88750fc: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode 🟢 All tests passed in Replaying mode! No Recording was needed. View the replaying VCR build log @nsamartsev VCR tests complete for 88750fc! |
expandConfidentialInstanceConfig, flattenConfidentialInstanceConfig functionsexpandConfidentialInstanceConfig, flattenConfidentialInstanceConfig functions in compute_instance_helpers.go.tmpl to use direct HTTP rather than a client library
88750fc to
34598af
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 34598af: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode 🟢 All tests passed in Replaying mode! No Recording was needed. View the replaying VCR build log @nsamartsev VCR tests complete for 34598af! |
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
| {{- end }} | ||
| }, nil | ||
| } | ||
| if cic := expandConfidentialInstanceConfig(d); cic != nil { |
There was a problem hiding this comment.
Why the change in handling confidential instance config here?
There was a problem hiding this comment.
Hello @slevenick
expandConfidentialInstanceConfig now returns map[string]interface{} instead of *compute.ConfidentialInstanceConfig, but this resource still builds an Apiary struct.
The post-struct block is the adapter needed to convert the map back to the pointer type - without it there's a compile error.
| hclData["description"] = instance.Description | ||
| hclData["hostname"] = instance.Hostname | ||
| hclData["confidential_instance_config"] = flattenConfidentialInstanceConfig(instance.ConfidentialInstanceConfig) | ||
| if instance.ConfidentialInstanceConfig != nil { |
There was a problem hiding this comment.
Why the guard here? It may make sense if we were starting from scratch, but changing behavior may cause unintended consequences
There was a problem hiding this comment.
The same.
The guard is needed because we can no longer pass the Apiary struct directly to flattenConfidentialInstanceConfig (type changed to map[string]interface{}), so we have to build the map from struct fields manually - which requires a nil check.
You're right about the behavioral change.
I can fix it by always writing to hclData.
For example:
var cicFlat []map[string]interface{}
if instance.ConfidentialInstanceConfig != nil {
cicFlat = flattenConfidentialInstanceConfig(map[string]interface{}{...})
}
hclData["confidential_instance_config"] = cicFlat
…nceConfig` functions
34598af to
34c70ae
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 34c70ae: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode 🟢 All tests passed in Replaying mode! No Recording was needed. View the replaying VCR build log @nsamartsev, @slevenick VCR tests complete for 34c70ae! |
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.