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

Violation in PatchDeployment.recurring_schedule.time_of_day - missing field #11213

Assignees
Labels
bug forward/review In review; remove label to forward service/osconfig

Comments

@Azraeht
Copy link

Azraeht commented Mar 3, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.14.8
+ provider registry.terraform.io/alexkappa/auth0 v0.26.2
+ provider registry.terraform.io/datadog/datadog v2.13.0
+ provider registry.terraform.io/hashicorp/google v4.12.0
+ provider registry.terraform.io/hashicorp/google-beta v4.12.0
+ provider registry.terraform.io/hashicorp/helm v2.3.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.5.1
+ provider registry.terraform.io/hashicorp/vault v2.24.1

Affected Resource(s)

  • google_os_config_patch_deployment

Terraform Configuration Files

resource "google_os_config_patch_deployment" "wireguard_engineering_patch" {
  patch_deployment_id = "wireguard-engineering"

  instance_filter {
    instances = [module.wireguard_instances["wireguard-engineering"].id]
  }

  patch_config {
    apt {
      type     = "DIST"
      excludes = ["wireguard", "datadog-agent"]
    }
  }

  recurring_schedule {
    time_zone {
      id = "Europe/Paris"
    }
    time_of_day {
      hours   = 0
      minutes = 0
      seconds = 0
      nanos   = 0
    }

  }
}

Debug Output

Error: Error creating PatchDeployment: googleapi: Error 400: Validation Errors: Violation in PatchDeployment.recurring_schedule.time_of_day - missing field.

  on ospatchs.tf line 1, in resource "google_os_config_patch_deployment" "wireguard_engineering_patch":
   1: resource "google_os_config_patch_deployment" "wireguard_engineering_patch" {

Expected Behavior

The resource should be created as the recurring_schedule.time_of_day contains all the mandatory fields

Actual Behavior

We got an API error because the configuration is not passed to the API

---[ REQUEST ]---------------------------------------
POST /v1/projects/sre-devops/patchDeployments?alt=json&patchDeploymentId=wireguard-engineering HTTP/1.1
Host: osconfig.googleapis.com
User-Agent: Terraform/0.14.8 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
Content-Length: 264
Content-Type: application/json
Accept-Encoding: gzip

{
 "instanceFilter": {
  "instances": [
   "projects/sre-devops/zones/europe-west1-b/instances/wireguard-engineering"
  ]
 },
 "patchConfig": {
  "apt": {
   "excludes": [
    "wireguard",
    "datadog-agent"
   ],
   "type": "DIST"
  }
 },
 "recurringSchedule": {
  "frequency": "DAILY",
  "timeZone": {
   "id": "Europe/Paris"
  }
 }
}
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Thu, 03 Mar 2022 17:02:38 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 400,
    "message": "Validation Errors: Violation in PatchDeployment.recurring_schedule.time_of_day - missing field.",
    "status": "INVALID_ARGUMENT"
  }
}
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2022
@github-actions github-actions bot added forward/review In review; remove label to forward service/osconfig labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.