mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
The Pod Identity webhook manifest carried only Floci's local CA, so with floci.tls.cert-path set the API server refused Floci's certificate, and failurePolicy Ignore admitted every pod unchanged. Its URL named the Docker host: with Floci in a container that is Floci's container IP, which Floci's own certificate does not name. An adopted cluster also kept the manifest written when its container was created. The caBundle is now the bundle /_floci/ca.pem serves, which moves into ContainerCaBundle so both read it from one place. The URL uses a host the served certificate names, through the check custom resource response URLs already make in ContainerReachableEndpoint: Floci's hostname when the node resolves through Floci's embedded DNS, otherwise the Docker host. When the certificate does not name that host, the webhook is skipped with a warning, as it is with TLS off. Adopting a surviving cluster writes the manifest again, and names Floci's hostname only when the surviving node was created with Floci's DNS server as its resolver. The manifest and the webhook k3s registered from it live on the cluster's data volume, so a skipped webhook now replaces the manifest with one holding no objects, and k3s deletes the webhook an earlier start registered. The manager's constructors that left collaborators out existed only for tests; they move to a test-side factory, so the endpoint the webhook needs is never null in production code. Closes #5563 Co-authored-by: Andre Kurait <AndreKurait@gmail.com>