@@ -2,7 +2,6 @@ package config
22
33import (
44 "fmt"
5- "net"
65
76 corev1 "k8s.io/api/core/v1"
87)
@@ -52,16 +51,6 @@ type ProxyConfig struct {
5251 // external TCP egress to. It MUST match the authbridge proxy-sidecar
5352 // listener.transparent_proxy_addr (default :8082).
5453 TransparentPort int32 `json:"transparentPort" yaml:"transparentPort"`
55-
56- // ClusterCIDRs are the in-cluster ranges (pods / services / DNS) that the
57- // enforce-redirect guard allows direct; external TCP is REDIRECTed to the
58- // transparent listener and external non-TCP is dropped. The default
59- // 10.0.0.0/8 is Kind-shaped (pods 10.244/16 + services 10.96/16). OCP/EKS
60- // MUST override this (e.g. OCP services 172.30.0.0/16, pods 10.128.0.0/14 —
61- // 172.30/16 is outside 10/8) or in-cluster service traffic will be dropped.
62- // Egress enforcement is always-on for proxy-sidecar / lite, so this is
63- // always consumed there; envoy-sidecar (transparent redirect) does not use it.
64- ClusterCIDRs []string `json:"clusterCIDRs" yaml:"clusterCIDRs"`
6554}
6655
6756type ResourcesConfig struct {
@@ -98,11 +87,6 @@ func (c *PlatformConfig) DeepCopy() *PlatformConfig {
9887 copy (result .TokenExchange .DefaultScopes , c .TokenExchange .DefaultScopes )
9988 }
10089
101- if c .Proxy .ClusterCIDRs != nil {
102- result .Proxy .ClusterCIDRs = make ([]string , len (c .Proxy .ClusterCIDRs ))
103- copy (result .Proxy .ClusterCIDRs , c .Proxy .ClusterCIDRs )
104- }
105-
10690 // Deep copy ResourceRequirements — ResourceList is a map that would be shared
10791 result .Resources .EnvoyProxy = deepCopyResourceRequirements (c .Resources .EnvoyProxy )
10892 result .Resources .ProxyInit = deepCopyResourceRequirements (c .Resources .ProxyInit )
@@ -147,23 +131,6 @@ func (c *PlatformConfig) Validate() error {
147131 if c .Proxy .UID < 1 {
148132 return fmt .Errorf ("proxy.uid must be >= 1 (got %d): the proxy must not run as root and the egress-enforcement exemption keys on this UID" , c .Proxy .UID )
149133 }
150- // ClusterCIDRs drive the only in-cluster allowance in the enforce-redirect
151- // guard, which is always-on for proxy-sidecar / lite. Validate at load time so
152- // a misconfig fails fast with a clear message rather than: (a) an empty list
153- // silently falling back to the Kind-shaped 10.0.0.0/8 default in
154- // init-iptables.sh, or (b) a malformed entry crashing the proxy-init container
155- // under `set -e` with a cryptic iptables error.
156- if len (c .Proxy .ClusterCIDRs ) == 0 {
157- return fmt .Errorf ("proxy.clusterCIDRs must be non-empty (set the cluster's pod+service CIDRs)" )
158- }
159- // Syntactic validation only — overlapping ranges and IPv4/IPv6 mixing are
160- // accepted (iptables handles both, and the init script splits v4/v6 itself);
161- // we only reject malformed strings here.
162- for _ , cidr := range c .Proxy .ClusterCIDRs {
163- if _ , _ , err := net .ParseCIDR (cidr ); err != nil {
164- return fmt .Errorf ("proxy.clusterCIDRs entry %q is not a valid CIDR: %w" , cidr , err )
165- }
166- }
167134 if c .Images .EnvoyProxy == "" {
168135 return fmt .Errorf ("images.envoyProxy is required" )
169136 }
0 commit comments