From fb1aa3c74e21e6aac7cc21997e514c47eac04204 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Fri, 5 Jan 2024 12:27:11 -0600 Subject: [PATCH] set KAS runtime-config in alignment with feature gates --- .../controllers/hostedcontrolplane/kas/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/control-plane-operator/controllers/hostedcontrolplane/kas/config.go b/control-plane-operator/controllers/hostedcontrolplane/kas/config.go index cf0488ff3e..b06f0d6ad6 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/kas/config.go +++ b/control-plane-operator/controllers/hostedcontrolplane/kas/config.go @@ -219,6 +219,16 @@ func generateConfig(p KubeAPIServerConfigParams, version semver.Version) *kcpv1. args.Set("requestheader-extra-headers-prefix", "X-Remote-Extra-") args.Set("requestheader-group-headers", "X-Remote-Group") args.Set("requestheader-username-headers", "X-Remote-User") + runtimeConfig := []string{} + for _, gate := range p.FeatureGates { + if gate == "ValidatingAdmissionPolicy=true" { + runtimeConfig = append(runtimeConfig, "admissionregistration.k8s.io/v1beta1=true") + } + if gate == "DynamicResourceAllocation=true" { + runtimeConfig = append(runtimeConfig, "resource.k8s.io/v1alpha2=true") + } + } + args.Set("runtime-config", runtimeConfig...) args.Set("service-account-issuer", p.ServiceAccountIssuerURL) args.Set("service-account-jwks-uri", jwksURL(p.ServiceAccountIssuerURL)) args.Set("service-account-lookup", "true")