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

cloud_functions should specify that labels should be lower case #6144

Closed
Assignees

Comments

@venkykuberan
Copy link
Contributor

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

Affected Resource(s)

  • google_cloudfunctions_function

Terraform Configuration Files

Debug Output

Panic Output

Expected Behavior

  1. doc should have warnings to use lower case as user facing error message not giving enough details other than
    "message": "The request has errors",
  2. Provider need to include field_voilations description into the returned error messages

Actual Behavior

API throws format error when the labels aren't lower case

{
  "error": {
    "code": 400,
    "message": "The request has errors",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "labels",
            "description": "labels {Dev_environment=testing-environment_ok} format is invalid"
          }
        ]
      },
      ]
  }
}

Steps to Reproduce

any cloud_function resource with labels have uppercase letters

Important Factoids

References

  • #0000
@venkykuberan
Copy link
Contributor Author

sample config

resource "google_storage_bucket" "functions_bucket" {
  name          = "gcf_bucket-${random_id.random_number.dec}"
  location      = "US-CENTRAL1"
  storage_class = "STANDARD"
  force_destroy = "true"
    bucket_policy_only = "true"
    project            = var.project_id //module.project-factory.project_id
    # project = google_project.my_project.project_id
}

resource "google_storage_bucket_object" "functions_code_archive" {
  name   = "functions_code.zip"
  bucket = google_storage_bucket.functions_bucket.name
    source = "./functions/functions_code.zip"

  storage_class       = "STANDARD"
  content_disposition = "attachment"
  content_encoding    = "gzip"
  content_type        = "application/zip"
}

resource "google_cloudfunctions_function" "py-function" {
  name                  = "python_function"
  description           = "Pull code from GCS"
  available_memory_mb   = 256
  region                = "us-central1"
  runtime               = "python37"
  trigger_http          = true
  entry_point           = "test_function"
  timeout               = 60
  source_archive_bucket = google_storage_bucket.functions_bucket.name
  source_archive_object = google_storage_bucket_object.functions_code_archive.name
  project               = var.project_id 
    labels =   {
      purpose = "Testing"
  }
}

@ghost
Copy link

ghost commented May 28, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.