Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daily patchdeployment #5569

Merged
merged 2 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions mmv1/products/osconfig/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,6 @@ objects:
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
- !ruby/object:Api::Type::NestedObject
name: 'weekly'
exactly_one_of:
- recurring_schedule.0.weekly
- recurring_schedule.0.monthly
description: |
Schedule with weekly executions.
properties:
Expand All @@ -803,9 +800,6 @@ objects:
- :SUNDAY
- !ruby/object:Api::Type::NestedObject
name: 'monthly'
exactly_one_of:
- recurring_schedule.0.weekly
- recurring_schedule.0.monthly
description: |
Schedule with monthly executions.
properties:
Expand Down
9 changes: 6 additions & 3 deletions mmv1/products/osconfig/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "os_config_patch_deployment_basic"
primary_resource_id: "patch"
vars:
instance_name: "patch-deploy-inst"
patch_deployment_id: "patch-deploy"
- !ruby/object:Provider::Terraform::Examples
name: "os_config_patch_deployment_daily"
primary_resource_id: "patch"
vars:
patch_deployment_id: "patch-deploy"
- !ruby/object:Provider::Terraform::Examples
name: "os_config_patch_deployment_instance"
Expand All @@ -32,7 +36,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "os_config_patch_deployment_full"
primary_resource_id: "patch"
vars:
instance_name: "patch-deploy-inst"
patch_deployment_id: "patch-deploy"
properties:
patchDeploymentId: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down Expand Up @@ -127,4 +130,4 @@ files: !ruby/object:Provider::Config::Files
# These files have templating (ERB) code that will be run.
# This is usually to add licensing info, autogeneration notices, etc.
compile:
<%= lines(indent(compile('provider/terraform/product~compile.yaml'), 4)) -%>
<%= lines(indent(compile('provider/terraform/product~compile.yaml'), 4)) -%>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ if obj["recurringSchedule"] != nil {
obj["recurringSchedule"].(map[string]interface{})["frequency"] = "MONTHLY"
} else if schedule["weekly"] != nil {
obj["recurringSchedule"].(map[string]interface{})["frequency"] = "WEEKLY"
} else {
obj["recurringSchedule"].(map[string]interface{})["frequency"] = "DAILY"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" {
patch_deployment_id = "<%= ctx[:vars]['instance_name'] %>"
patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>"

instance_filter {
all = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" {
patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>"

instance_filter {
all = true
}

recurring_schedule {
time_zone {
id = "America/New_York"
}

time_of_day {
hours = 0
minutes = 30
seconds = 30
nanos = 20
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" {
patch_deployment_id = "<%= ctx[:vars]['instance_name'] %>"
patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>"

instance_filter {
group_labels {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "google_compute_instance" "foobar" {
}

resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" {
patch_deployment_id = "<%= ctx[:vars]['instance_name'] %>"
patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>"

instance_filter {
instances = [google_compute_instance.foobar.id]
Expand Down Expand Up @@ -56,4 +56,4 @@ resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>"
month_day = 1
}
}
}
}