cmd/{k8s-operator,k8s-proxy}: apply accept-routes configuration to k8s-proxy (#16522)

This commit modifies the k8s-operator and k8s-proxy to support passing down
the accept-routes configuration from the proxy class as a configuration value
read and used by the k8s-proxy when ran as a distinct container managed by
the operator.

Updates #13358

Signed-off-by: David Bond <davidsbond93@gmail.com>
This commit is contained in:
David Bond
2025-07-10 15:53:01 +01:00
committed by GitHub
parent 2b665c370c
commit d0cafc0a67
3 changed files with 20 additions and 4 deletions

View File

@@ -820,6 +820,10 @@ func (r *ProxyGroupReconciler) ensureConfigSecretsCreated(ctx context.Context, p
cfg.ServerURL = &r.loginServer
}
if proxyClass != nil && proxyClass.Spec.TailscaleConfig != nil {
cfg.AcceptRoutes = &proxyClass.Spec.TailscaleConfig.AcceptRoutes
}
cfgB, err := json.Marshal(cfg)
if err != nil {
return nil, fmt.Errorf("error marshalling k8s-proxy config: %w", err)