Skip to content

Commit 8ba8243

Browse files
modular-magicianSirGitsalot
authored andcommitted
Made firewall policy with rules ignore decoding operations on create (#13651) (#9776)
[upstream:9a5c4ebb5e9df0236bc5bc127fbd6a457690c89e] Signed-off-by: Modular Magician <[email protected]>
1 parent fa45be4 commit 8ba8243

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

google-beta/services/compute/resource_compute_firewall_policy_with_rules.go

+5
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,11 @@ func resourceComputeFirewallPolicyWithRulesUpdateEncoder(d *schema.ResourceData,
18191819
}
18201820

18211821
func resourceComputeFirewallPolicyWithRulesDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
1822+
// If rules is nil, this is being called on a Create operation (and we don't want to do anything in that case.)
1823+
if _, ok := res["rules"]; !ok {
1824+
return res, nil
1825+
}
1826+
18221827
rules, predefinedRules, err := firewallPolicyWithRulesSplitPredefinedRules(res["rules"].([]interface{}))
18231828

18241829
if err != nil {

0 commit comments

Comments
 (0)