Only until metadata.name matches the buildconfig will I get the 201 created code.

Now the second confusing thing is I can POST /oapi/v1/namespaces/{namespace}/buildconfigs/idontexist/instantiate

{

"metadata": {

"name": "test"

},

"triggeredBy" : {}

}

Now this is accepted and creates the build for test, even though I posted to the buildconfig"idontexist" which also doesn't exist..

you're correct, the rest endpoint for instantiate does not actually care what resource you invoked it with, all that matters is the name field of the buidlrequest object, the name field provides the name of the buildconfig you are instantiating.

Confusing!

Is there a better way for overwriting the git reference of the build request?

{

"kind": "BuildRequest",

"apiVersion": "v1",

"metadata": {

"name": "test",

"creationTimestamp": null

},

"revision": {

"type": "Source",

"git": {

"commit": "develop"

}

},

"triggeredBy": [{

"message": "Manually triggered"

}]

}

This will tell the build to pull from the "develop" branch but then the builds revision section will end up with "Source: develop authored by"

Can you provide me an exact paste of what you're referring to? I'm guessing the issue is we treat the value in "commit" as if it's a commit when describing it, even though in your case it's actually a branch ref.

It looks like it is because I am putting in the git "reference" as I want to deploy the "develop" branch. In the BuildRequest it is called "commit". This being my json:

{

"kind": "BuildRequest",

"apiVersion": "v1",

"metadata": {

"name": "test",

"creationTimestamp": null

},

"revision": {

"type": "Source",

"git": {

"commit": "develop"

}

},

"triggeredBy": [{

"message": "Manually triggered"

}]

}

It ends up pre-filling the resultant "Build" spec with:

[...]

revision:

git:

author: {}

commit: develop

committer: {}

type: Git

It does end up pulling the "develop" branch though. So my "revision" input from the BuildRequest overwrites the "Build" spec rather then the default when it was automatically pre-filled based on the source.

Perhaps this is intended as it is possible to put in also specify the author and committer values in the BuildRequest?