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

Add validation to label keys for cloud functions #3431

Merged

Conversation

chrisst
Copy link
Contributor

@chrisst chrisst commented Apr 27, 2020

fixes hashicorp/terraform-provider-google#6144

Release Note Template for Downstream PRs (will be copied)

cloudfunctions: Added validation to label keys for `google_cloudfunctions_function` as API errors aren't useful.

@chrisst chrisst requested a review from emilymye April 27, 2020 22:41
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 69 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 3 files changed, 69 insertions(+), 4 deletions(-))

m := val.(map[string]interface{})
for k := range m {
if !labelKeyRegex.MatchString(k) {
errs = append(errs, fmt.Errorf("%q is an invlaid label key. See https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements", k))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/invlaid/invalid

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 69 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 3 files changed, 69 insertions(+), 4 deletions(-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cloud_functions should specify that labels should be lower case
4 participants