From 41505643f358ff118c6493036886589b8afa4577 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 29 Jan 2020 18:15:00 +0000 Subject: [PATCH] Move expr to GA (#3028) Signed-off-by: Modular Magician --- .changelog/3028.txt | 3 +++ google/binaryauthorization_attestor.go | 14 +++----------- 2 files changed, 6 insertions(+), 11 deletions(-) create mode 100644 .changelog/3028.txt diff --git a/.changelog/3028.txt b/.changelog/3028.txt new file mode 100644 index 000000000..564912896 --- /dev/null +++ b/.changelog/3028.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +compute: `google_compute_security_policy` `rule.match.expr` field is now GA +``` diff --git a/google/binaryauthorization_attestor.go b/google/binaryauthorization_attestor.go index 8f6fbf25e..b844b150f 100644 --- a/google/binaryauthorization_attestor.go +++ b/google/binaryauthorization_attestor.go @@ -55,21 +55,13 @@ func GetBinaryAuthorizationAttestorApiObject(d TerraformResourceData, config *Co } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { obj["description"] = descriptionProp } - userOwnedDrydockNoteProp, err := expandBinaryAuthorizationAttestorAttestationAuthorityNote(d.Get("attestation_authority_note"), d, config) + userOwnedGrafeasNoteProp, err := expandBinaryAuthorizationAttestorAttestationAuthorityNote(d.Get("attestation_authority_note"), d, config) if err != nil { return nil, err - } else if v, ok := d.GetOkExists("attestation_authority_note"); !isEmptyValue(reflect.ValueOf(userOwnedDrydockNoteProp)) && (ok || !reflect.DeepEqual(v, userOwnedDrydockNoteProp)) { - obj["userOwnedDrydockNote"] = userOwnedDrydockNoteProp + } else if v, ok := d.GetOkExists("attestation_authority_note"); !isEmptyValue(reflect.ValueOf(userOwnedGrafeasNoteProp)) && (ok || !reflect.DeepEqual(v, userOwnedGrafeasNoteProp)) { + obj["userOwnedGrafeasNote"] = userOwnedGrafeasNoteProp } - return resourceBinaryAuthorizationAttestorEncoder(d, config, obj) -} - -func resourceBinaryAuthorizationAttestorEncoder(d TerraformResourceData, meta interface{}, obj map[string]interface{}) (map[string]interface{}, error) { - // Field was renamed in GA API - obj["userOwnedGrafeasNote"] = obj["userOwnedDrydockNote"] - delete(obj, "userOwnedDrydockNote") - return obj, nil }