Skip to content

Commit 9ee1fd9

Browse files
allow multi-setting for classifications and excludes (#8988) (#15904)
Signed-off-by: Modular Magician <[email protected]>
1 parent 9f02f46 commit 9ee1fd9

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.changelog/8988.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
osconfig: fixed no more than one setting is allowed under `patch_config.windows_update` on `google_os_config_patch_deployment`
3+
```

google/services/osconfig/resource_os_config_patch_deployment.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ be executed directly, which will likely only succeed for scripts with shebang li
547547
Type: schema.TypeString,
548548
ValidateFunc: verify.ValidateEnum([]string{"CRITICAL", "SECURITY", "DEFINITION", "DRIVER", "FEATURE_PACK", "SERVICE_PACK", "TOOL", "UPDATE_ROLLUP", "UPDATE"}),
549549
},
550-
ExactlyOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
550+
ConflictsWith: []string{"patch_config.0.windows_update.0.exclusive_patches"},
551+
AtLeastOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
551552
},
552553
"excludes": {
553554
Type: schema.TypeList,
@@ -557,7 +558,8 @@ be executed directly, which will likely only succeed for scripts with shebang li
557558
Elem: &schema.Schema{
558559
Type: schema.TypeString,
559560
},
560-
ExactlyOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
561+
ConflictsWith: []string{"patch_config.0.windows_update.0.exclusive_patches"},
562+
AtLeastOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
561563
},
562564
"exclusive_patches": {
563565
Type: schema.TypeList,
@@ -568,7 +570,8 @@ This field must not be used with other patch configurations.`,
568570
Elem: &schema.Schema{
569571
Type: schema.TypeString,
570572
},
571-
ExactlyOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
573+
ConflictsWith: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes"},
574+
AtLeastOneOf: []string{"patch_config.0.windows_update.0.classifications", "patch_config.0.windows_update.0.excludes", "patch_config.0.windows_update.0.exclusive_patches"},
572575
},
573576
},
574577
},

google/services/osconfig/resource_os_config_patch_deployment_generated_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ resource "google_os_config_patch_deployment" "patch" {
305305
306306
patch_config {
307307
mig_instances_allowed = true
308-
308+
309309
reboot_config = "ALWAYS"
310310
311311
apt {
@@ -329,6 +329,7 @@ resource "google_os_config_patch_deployment" "patch" {
329329
330330
windows_update {
331331
classifications = ["CRITICAL", "SECURITY", "UPDATE"]
332+
excludes = ["5012170"]
332333
}
333334
334335
pre_step {

website/docs/r/os_config_patch_deployment.html.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ resource "google_os_config_patch_deployment" "patch" {
206206
207207
patch_config {
208208
mig_instances_allowed = true
209-
209+
210210
reboot_config = "ALWAYS"
211211
212212
apt {
@@ -230,6 +230,7 @@ resource "google_os_config_patch_deployment" "patch" {
230230
231231
windows_update {
232232
classifications = ["CRITICAL", "SECURITY", "UPDATE"]
233+
excludes = ["5012170"]
233234
}
234235
235236
pre_step {

0 commit comments

Comments
 (0)