bluebrown / kobold

update container image references, based on webhook events
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

Are there plans to support dynamic configuration? #60

Open saltbo opened 2 months ago

saltbo commented 2 months ago

I found there's some APIs, but just queries. Is there any plans to support create pipeline by the API?

bluebrown commented 2 months ago

Hi, I personally dont need that, so its not planned on my end. What use case do you have for it?

saltbo commented 2 months ago

We use it for our internal platform. There is a lot of ArgoCD Application. it was created by our platform API, so we want create the pipeline by our platfrom API too.

bluebrown commented 2 months ago

I think, technically everything for a basic write API should be in the code base, more or less. You could make a PR, perhaps.

It would be here https://github.com/bluebrown/kobold/blob/main/http/api/handler.go and here https://github.com/bluebrown/kobold/blob/main/store/model/config.query.sql.go, roughly.

This is using sqlc, so go generate should be invoked.

bluebrown commented 2 months ago

One thing to keep in mind is this: https://github.com/bluebrown/kobold/blob/53ba093691e825677a148d66cf3502b995bcaf3d/config/configure.go#L24

I decided, back then, to remove old configs and reapply them to the db, if a config file was provided. This is to prevent config drift (between file and database) All in all it may be still confusing but it was sufficient until now.

When we support dynamic config writes, this scenario has to be taken care of as well. It needs to make sense and yield no surprises for the user. Its a design choice.