-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 support for shielded instance initial state #12369
base: main
Are you sure you want to change the base?
Add support for shielded instance initial state #12369
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @SirGitsalot, 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. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_compute_image" "primary" {
shielded_instance_initial_state {
dbs {
content = # value needed
file_type = # value needed
}
dbxs {
content = # value needed
file_type = # value needed
}
keks {
content = # value needed
file_type = # value needed
}
pk {
content = # value needed
file_type = # value needed
}
}
}
|
Tests analyticsTotal tests: 1064 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
The error message |
4b3fb99
to
a35ea0b
Compare
@BBBmau This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 1 week. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 2 weeks. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 3 weeks. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 4 weeks. Please take a look! Use the label |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_compute_image" "primary" {
shielded_instance_initial_state {
dbs {
content = # value needed
file_type = # value needed
}
dbxs {
content = # value needed
file_type = # value needed
}
keks {
content = # value needed
file_type = # value needed
}
pk {
content = # value needed
file_type = # value needed
}
}
}
|
Tests analyticsTotal tests: 1076 Click here to see the affected service packages
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
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
@@ -277,3 +277,69 @@ properties: | |||
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' | |||
resource: 'Snapshot' | |||
imports: 'selfLink' | |||
- name: 'shieldedInstanceInitialState' |
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.
although you've added the fields it's still required to include example tests as well as tests that test the update functionality. More can be found here: https://googlecloudplatform.github.io/magic-modules/test/test/#add-an-update-test
@NotTheEvilOne, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
285dc51
to
814d1a7
Compare
Tests analyticsTotal tests: 1081 Click here to see the affected service packages
Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 4 weeks. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 5 weeks. Please take a look! Use the label |
@modular-magician reassign-reviewer |
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 problem is that the provider is sending a base64 string using standard encoding and getting back a base64 string in URL safe encoding. That's valid (the proto JSON encoding standard says "JSON value will be the data encoded as a string using standard base64 encoding with paddings. Either standard or URL-safe base64 encoding with/without paddings are accepted.") I'm actually surprised we haven't run into this before.
The fix is to assign a diff_suppress_func to content
that does a standard encoding/URL encoding agnostic compare a la:
// Base64DiffSuppress compares two Base64 strings, ignoring differences
// between standard encoding and web safe URL encoding, padding, and
// embedded line endings.
func Base64DiffSuppress(_, old, new string, _ *schema.ResourceData) bool {
r := strings.NewReplacer("\r", "", "\n", "", "+", "-", "/", "_", "=", "")
normalizedOld = r.Replace(old)
normalizedNew = r.Replace(new)
return normalizedOld == normalizedNew
}
I wrote this in the GitHub comment editor so it may be a little off. It should go in mmv1/third_party/terraform/tpgresource/common_diff_suppress.go.tmpl
(along with an accompanying unit test in mmv1/third_party/terraform/tpgresource/common_diff_suppress_test.go
please!)
Interesting. I'll have a look at this implementation detail. |
This commit provides support to use UEFI secure boot with `terraform-provider-google`. Signed-off-by: Tobias Wolf <[email protected]>
Signed-off-by: Tobias Wolf <[email protected]>
Signed-off-by: Eike Waldt <[email protected]>
b3ab136
to
d7a9ba0
Compare
Signed-off-by: Eike Waldt <[email protected]>
d7a9ba0
to
0a1e0c0
Compare
@SirGitsalot I stepped in for @NotTheEvilOne and added |
/gcbrun |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_compute_image" "primary" {
raw_disk {
sha1 = # value needed
}
}
|
Tests analyticsTotal tests: 4614 Click here to see the affected service packages
Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🔴 Tests failed when rerunning REPLAYING mode: Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
@SirGitsalot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
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 good news is that the diff suppress did fix the problem, the bad news is that there's a broken test elsewhere (but in more good news it's an easy fix - see the other comment)
@@ -270,3 +271,73 @@ properties: | |||
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' | |||
resource: 'Snapshot' | |||
imports: 'selfLink' | |||
- name: 'shieldedInstanceInitialState' |
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 looks like shieldedInstanceInitialState
needs default_from_api: true
(documented here).
TestAccComputeInstanceFromTemplate_confidentialInstanceConfigMain
creates a new google_compute_image
from an existing Ubuntu image, and that Ubuntu image has shieldedInstanceInitialState
set, causing a plan mismatch (that is, if you create a new image from an existing image that has shieldedInstanceInitialState
but don't specify your own shieldedInstanceInitialState
, the API is returning the shieldedInstanceInitialState
from the source image; Terraform is expecting there to be no shieldedInstanceInitialState
on output since none was specified on input).
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.
@SirGitsalot added default_from_api: true
/gcbrun |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_compute_image" "primary" {
raw_disk {
sha1 = # value needed
}
}
|
Tests analyticsTotal tests: 4645 Click here to see the affected service packages
Action takenFound 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🔴 Tests failed when rerunning REPLAYING mode: Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
This PR provides support to use UEFI secure boot with
terraform-provider-google
. The requirement originates from enabling UEFI secure boot with custom config and keys. See gardenlinux/gardenlinux#2473Fixes hashicorp/terraform-provider-google#20303
Release Note Template for Downstream PRs (will be copied)