Skip to content

Commit

Permalink
Explicitly set labels to nil for Alert Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisst committed Jan 9, 2020
1 parent 2b851e7 commit 49e7d4e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions products/monitoring/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
alert_policy_display_name: "My Alert Policy"
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
decoder: 'templates/terraform/decoders/alert_policy_removed_fields.go.erb'
post_create: templates/terraform/post_create/set_computed_name.erb
extra_schema_entry: templates/terraform/extra_schema_entry/alert_policy.erb

Expand Down
18 changes: 18 additions & 0 deletions templates/terraform/decoders/alert_policy_removed_fields.go.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<%# The license inside this block applies to this file.
# Copyright 2019 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
if err := d.Set("labels", nil); err != nil {
return res, fmt.Errorf("Error ignoring Removed fields for AlertPolicy: %s", err)
}
return res, nil

0 comments on commit 49e7d4e

Please sign in to comment.