File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -137,14 +137,17 @@ func NewAnonymizerFromConfigClient(
137
137
return nil , err
138
138
}
139
139
140
- // for egress subnets
140
+ var networks []string
141
+
142
+ // hostsubnets are needed for egress subnets (on SDN clusters only)
141
143
hostSubnets , err := networkClient .HostSubnets ().List (ctx , metav1.ListOptions {})
142
144
if err != nil {
143
- return nil , err
145
+ klog .Infof ("unable to find HostSubnets, could be OVN cluster: %v" , err )
146
+ networks = getNetworksForAnonymizer (networksConfig , clusterConfigV1 , nil )
147
+ } else {
148
+ networks = getNetworksForAnonymizer (networksConfig , clusterConfigV1 , hostSubnets .Items )
144
149
}
145
150
146
- networks := getNetworksForAnonymizer (networksConfig , clusterConfigV1 , hostSubnets .Items )
147
-
148
151
secretsClient := kubeClient .CoreV1 ().Secrets (secretNamespace )
149
152
150
153
return NewAnonymizer (baseDomain , networks , secretsClient )
@@ -226,6 +229,13 @@ func getNetworksForAnonymizer(
226
229
}
227
230
}
228
231
232
+ // ovn clusters don't have hostsubnet objects and their egress CIDR is 192.168.126.0/18
233
+ // nolint:lll
234
+ // https://docs.openshift.com/container-platform/4.8/networking/ovn_kubernetes_network_provider/configuring-egress-ips-ovn.html#configuring-egress-ips-ovn
235
+ if len (hostSubnets ) == 0 {
236
+ networks = append (networks , "192.168.126.0/18" )
237
+ }
238
+
229
239
sortNetworks (networks )
230
240
231
241
return networks
You can’t perform that action at this time.
0 commit comments