Skip to content

Commit

Permalink
allow multi-setting for classifications and excludes (#8988) (#15904)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Sep 19, 2023
1 parent 9f02f46 commit 9ee1fd9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/8988.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
osconfig: fixed no more than one setting is allowed under `patch_config.windows_update` on `google_os_config_patch_deployment`
```
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ be executed directly, which will likely only succeed for scripts with shebang li
Type: schema.TypeString,
ValidateFunc: verify.ValidateEnum([]string{"CRITICAL", "SECURITY", "DEFINITION", "DRIVER", "FEATURE_PACK", "SERVICE_PACK", "TOOL", "UPDATE_ROLLUP", "UPDATE"}),
},
ExactlyOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
ConflictsWith: []string{"patch_config.0.windows_update.0.exclusive_patches"},
AtLeastOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
},
"excludes": {
Type: schema.TypeList,
Expand All @@ -557,7 +558,8 @@ be executed directly, which will likely only succeed for scripts with shebang li
Elem: &schema.Schema{
Type: schema.TypeString,
},
ExactlyOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
ConflictsWith: []string{"patch_config.0.windows_update.0.exclusive_patches"},
AtLeastOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
},
"exclusive_patches": {
Type: schema.TypeList,
Expand All @@ -568,7 +570,8 @@ This field must not be used with other patch configurations.`,
Elem: &schema.Schema{
Type: schema.TypeString,
},
ExactlyOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
ConflictsWith: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes"},
AtLeastOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ resource "google_os_config_patch_deployment" "patch" {
patch_config {
mig_instances_allowed = true
reboot_config = "ALWAYS"
apt {
Expand All @@ -329,6 +329,7 @@ resource "google_os_config_patch_deployment" "patch" {
windows_update {
classifications = ["CRITICAL", "SECURITY", "UPDATE"]
excludes = ["5012170"]
}
pre_step {
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/os_config_patch_deployment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ resource "google_os_config_patch_deployment" "patch" {
patch_config {
mig_instances_allowed = true
reboot_config = "ALWAYS"
apt {
Expand All @@ -230,6 +230,7 @@ resource "google_os_config_patch_deployment" "patch" {
windows_update {
classifications = ["CRITICAL", "SECURITY", "UPDATE"]
excludes = ["5012170"]
}
pre_step {
Expand Down

0 comments on commit 9ee1fd9

Please sign in to comment.