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

CloudBuildTrigger has trouble updating after v1.33.0 #357

Closed
tonybenchsci opened this issue Dec 22, 2020 · 7 comments
Closed

CloudBuildTrigger has trouble updating after v1.33.0 #357

tonybenchsci opened this issue Dec 22, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@tonybenchsci
Copy link

tonybenchsci commented Dec 22, 2020

Describe the bug
Any changes to CloudBuildTrigger spec.github will return

"Update call failed: error applying desired state: summary: Error updating
      Trigger \"projects/b6i-cicd/triggers/00d81165-513f-4c20-b722-f93e9823acac\":
      googleapi: Error 400: Invalid value at 'trigger.github' (oneof), oneof field
      'event' is already set. Cannot set 'push'\nDetails:\n[\n  {\n    \"@type\":
      \"type.googleapis.com/google.rpc.BadRequest\",\n    \"fieldViolations\": [\n
      \     {\n        \"description\": \"Invalid value at 'trigger.github' (oneof),
      oneof field 'event' is already set. Cannot set 'push'\",\n        \"field\":
      \"trigger.github\"\n      }\n    ]\n  }\n], detail: "

Behaviour suggests that KCC merges the mappings (key-value) rather than overwrite, and then complains that there are two 'event' defined.

ConfigConnector Version
1.33.0 (previously on 1.26.0)

To Reproduce
Create a CloudBuildTrigger, then change the YAML from, say triggering on push to on pull.

YAML snippets:

apiVersion: cloudbuild.cnrm.cloud.google.com/v1beta1
kind: CloudBuildTrigger
metadata:
  name: frontend-e2e-tests
spec:
  description: End-to-end tests on frontend pull requests.
  disabled: true
  filename: frontend/cloudbuild_e2e_tests.yaml
  github:
    owner: <BLAH>
    name:  <BLAH>
    pullRequest:
      branch: .*
  includedFiles:
  # Defines the frontend.
  - "frontend/**"
@tonybenchsci tonybenchsci added the bug Something isn't working label Dec 22, 2020
@spew
Copy link
Contributor

spew commented Dec 28, 2020

Hi @tonybenchsci thanks for reporting this, we will work on reproducing and let you know.

@spew
Copy link
Contributor

spew commented Dec 28, 2020

hi @tonybenchsci can you let me know how this resource was created, did you "acquire" a resource and it had 'push' defined? Or did you specify the full resource with push and deleted it and added pullRequest?

@tonybenchsci
Copy link
Author

tonybenchsci commented Jan 6, 2021

Hi @spew, the full resource was created with github.push at first (status UpToDate). We tried to change it to github.pullRequest, which led to the error. I think it was working before (we upgraded from 1.26.0 to 1.33.0)

@spew
Copy link
Contributor

spew commented Jan 6, 2021

Thanks for the information @tonybenchsci . Was it created with github.push via config connector? That is to say the resource was entirely created and managed through config connector and you managed to reach this state?

@tonybenchsci
Copy link
Author

tonybenchsci commented Jan 8, 2021

@spew Yes it was created initially with KCC as well. We pretty much use it for our entire GCP infra across multiple projects :)

@spew
Copy link
Contributor

spew commented Jan 8, 2021

Thank you, we will be taking a look at this one.

@jcanseco
Copy link
Member

Hello all, we recently fixed this in KCC 1.78.0. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants