Skip to content

CloudBuildTrigger has trouble updating after v1.33.0 #357

Closed

Description

@tonybenchsci

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/**"

Activity

  1. spew commented on Dec 28, 2020

    @spew
    Contributor

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

  2. spew commented on Dec 28, 2020

    @spew
    Contributor

    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?

  3. tonybenchsci commented on Jan 6, 2021

    @tonybenchsci
    Author

    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)

  4. spew commented on Jan 6, 2021

    @spew
    Contributor

    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?

  5. tonybenchsci commented on Jan 8, 2021

    @tonybenchsci
    Author

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

  6. spew commented on Jan 8, 2021

    @spew
    Contributor

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

  7. jcanseco commented on Mar 22, 2022

    @jcanseco
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址