kubesphere / s2ioperator

Operator for Source to image
Apache License 2.0
47 stars 31 forks source link

Request to carry more settings on S2iRun into S2i webhook #164

Open JohnNiang opened 3 years ago

JohnNiang commented 3 years ago

KubeSphere provides Source-to-Image (S2I) and Binary-to-Image (B2I) features to automate image building and pushing and application deployment. In KubeSphere v3.1, you can configure S2I and B2I webhooks so that your Image Builder can be automatically triggered when there is any relevant activity in your code repository.

References:

But it has a drawback, which we cannot trigger the webhook with payload. For example, someone want to automatically trigger the webhook but with different version every time. For example, we could pass the payload into the webhook:

curl -d '{ "builderName": "johnniang-halo-s2i-latest-ahs", "newTag": "v1.0.1" }' -H "Content-Type: application/json" -X POST http://xyz...

The type of payload could be:

https://github.com/kubesphere/s2ioperator/blob/56f9327294aa65d3f6621a9d0740e5d97533f644/pkg/apis/devops/v1alpha1/s2irun_types.go#L33-L46

And could obtain the payload at here:

https://github.com/kubesphere/s2ioperator/blob/56f9327294aa65d3f6621a9d0740e5d97533f644/pkg/handler/general/general_webhook.go#L30-L58

/kind feature /cc @kubesphere/sig-devops