haproxytech / dataplaneapi

HAProxy Data Plane API
https://www.haproxy.com/documentation/dataplaneapi/
Apache License 2.0
328 stars 76 forks source link

Why h.ReloadAgent.Reload() is not called after creating a new Storage SSL Certificate? #308

Closed funcmike closed 1 year ago

funcmike commented 1 year ago

https://github.com/haproxytech/dataplaneapi/blob/6ae438715bad154ef3e7d5297f0100511d361188/handlers/ssl_cert_storage.go#L256

Other endpoints like for example replace has this: https://github.com/haproxytech/dataplaneapi/blob/6ae438715bad154ef3e7d5297f0100511d361188/handlers/ssl_cert_storage.go#L213

Without this after creating a new certificate it's not loaded until something other will force new HAProxy reload.

I can create Pull Request.

mjuraga commented 1 year ago

Hi @funcmike, there was a reason for that. When you use storage/ handlers, currently we only deal with file-system stuff, so when creating a new certificate in the storage, you basically just upload a file on the disk, and that file doesn't have to be referenced in the config, when you create a change in the config it will reload HAProxy.

But since you can use the parent directory in your config uploading a new cert is a change that should reload HAProxy. We will add it in a future patch version if you are willing to contribute.

mjuraga commented 1 year ago

This has been fixed in recent releases.