Skip to content

Commit ab848a8

Browse files
Merge pull request #7720 from AnnaZivkovic/remove_openshift-sdn
CORS-2950: Remove openshift-sdn as an install-time option
2 parents 0604a58 + 6469f94 commit ab848a8

File tree

3 files changed

+14
-80
lines changed

3 files changed

+14
-80
lines changed

pkg/asset/agent/installconfig_test.go

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ networking:
5454
clusterNetwork:
5555
- cidr: 10.128.0.0/14
5656
hostPrefix: 23
57-
networkType: OpenShiftSDN
57+
networkType: OVNKubernetes
5858
machineNetwork:
5959
- cidr: 192.168.122.0/23
6060
serviceNetwork:
@@ -269,34 +269,6 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
269269
expectedFound: false,
270270
expectedError: "invalid install-config configuration: Compute.Replicas: Required value: Total number of Compute.Replicas must be 0 when ControlPlane.Replicas is 1 for platform none or external. Found 3",
271271
},
272-
{
273-
name: "invalid networkType for SNO cluster",
274-
data: `
275-
apiVersion: v1
276-
metadata:
277-
name: test-cluster
278-
baseDomain: test-domain
279-
networking:
280-
networkType: OpenShiftSDN
281-
compute:
282-
- architecture: amd64
283-
hyperthreading: Enabled
284-
name: worker
285-
platform: {}
286-
replicas: 0
287-
controlPlane:
288-
architecture: amd64
289-
hyperthreading: Enabled
290-
name: master
291-
platform: {}
292-
replicas: 1
293-
platform:
294-
none : {}
295-
pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
296-
`,
297-
expectedFound: false,
298-
expectedError: "invalid install-config configuration: Networking.NetworkType: Invalid value: \"OpenShiftSDN\": Only OVNKubernetes network type is allowed for Single Node OpenShift (SNO) cluster",
299-
},
300272
{
301273
name: "invalid platform for SNO cluster",
302274
data: `
@@ -305,7 +277,7 @@ metadata:
305277
name: test-cluster
306278
baseDomain: test-domain
307279
networking:
308-
networkType: OpenShiftSDN
280+
networkType: OVNKubernetes
309281
compute:
310282
- architecture: amd64
311283
hyperthreading: Enabled
@@ -637,7 +609,7 @@ networking:
637609
clusterNetwork:
638610
- cidr: 10.128.0.0/14
639611
hostPrefix: 23
640-
networkType: OpenShiftSDN
612+
networkType: OVNKubernetes
641613
machineNetwork:
642614
- cidr: 192.168.122.0/23
643615
serviceNetwork:
@@ -700,7 +672,7 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
700672
MachineNetwork: []types.MachineNetworkEntry{
701673
{CIDR: *ipnet.MustParseCIDR("192.168.122.0/23")},
702674
},
703-
NetworkType: "OpenShiftSDN",
675+
NetworkType: "OVNKubernetes",
704676
ServiceNetwork: []ipnet.IPNet{*ipnet.MustParseCIDR("172.30.0.0/16")},
705677
ClusterNetwork: []types.ClusterNetworkEntry{
706678
{
@@ -798,7 +770,7 @@ networking:
798770
clusterNetwork:
799771
- cidr: 10.128.0.0/14
800772
hostPrefix: 23
801-
networkType: OpenShiftSDN
773+
networkType: OVNKubernetes
802774
machineNetwork:
803775
- cidr: 192.168.122.0/23
804776
serviceNetwork:
@@ -843,7 +815,7 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
843815
MachineNetwork: []types.MachineNetworkEntry{
844816
{CIDR: *ipnet.MustParseCIDR("192.168.122.0/23")},
845817
},
846-
NetworkType: "OpenShiftSDN",
818+
NetworkType: "OVNKubernetes",
847819
ServiceNetwork: []ipnet.IPNet{*ipnet.MustParseCIDR("172.30.0.0/16")},
848820
ClusterNetwork: []types.ClusterNetworkEntry{
849821
{
@@ -916,7 +888,7 @@ networking:
916888
clusterNetwork:
917889
- cidr: 10.128.0.0/14
918890
hostPrefix: 23
919-
networkType: OpenShiftSDN
891+
networkType: OVNKubernetes
920892
machineNetwork:
921893
- cidr: 192.168.122.0/23
922894
serviceNetwork:
@@ -952,7 +924,7 @@ networking:
952924
clusterNetwork:
953925
- cidr: 10.128.0.0/14
954926
hostPrefix: 23
955-
networkType: OpenShiftSDN
927+
networkType: OVNKubernetes
956928
machineNetwork:
957929
- cidr: 192.168.122.0/23
958930
serviceNetwork:

pkg/types/validation/installconfig.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import (
5353
)
5454

5555
// list of known plugins that require hostPrefix to be set
56-
var pluginsUsingHostPrefix = sets.NewString(string(operv1.NetworkTypeOpenShiftSDN), string(operv1.NetworkTypeOVNKubernetes))
56+
var pluginsUsingHostPrefix = sets.NewString(string(operv1.NetworkTypeOVNKubernetes))
5757

5858
// ValidateInstallConfig checks that the specified install config is valid.
5959
//
@@ -297,10 +297,6 @@ func validateNetworkingIPVersion(n *types.Networking, p *types.Platform) field.E
297297

298298
switch {
299299
case hasIPv4 && hasIPv6:
300-
if n.NetworkType == string(operv1.NetworkTypeOpenShiftSDN) {
301-
allErrs = append(allErrs, field.Invalid(field.NewPath("networking", "networkType"), n.NetworkType, "dual-stack IPv4/IPv6 is not supported for this networking plugin"))
302-
}
303-
304300
if len(n.ServiceNetwork) != 2 {
305301
allErrs = append(allErrs, field.Invalid(field.NewPath("networking", "serviceNetwork"), strings.Join(ipnetworksToStrings(n.ServiceNetwork), ", "), "when installing dual-stack IPv4/IPv6 you must provide two service networks, one for each IP address type"))
306302
}
@@ -342,10 +338,6 @@ func validateNetworkingIPVersion(n *types.Networking, p *types.Platform) field.E
342338
}
343339

344340
case hasIPv6:
345-
if n.NetworkType == string(operv1.NetworkTypeOpenShiftSDN) {
346-
allErrs = append(allErrs, field.Invalid(field.NewPath("networking", "networkType"), n.NetworkType, "IPv6 is not supported for this networking plugin"))
347-
}
348-
349341
switch {
350342
case p.BareMetal != nil:
351343
case p.VSphere != nil:
@@ -384,8 +376,8 @@ func validateNetworking(n *types.Networking, singleNodeOpenShift bool, fldPath *
384376
allErrs = append(allErrs, field.Invalid(fldPath.Child("networkType"), n.NetworkType, "networkType Kuryr is not supported on OpenShift later than 4.14"))
385377
}
386378

387-
if singleNodeOpenShift && n.NetworkType == string(operv1.NetworkTypeOpenShiftSDN) {
388-
allErrs = append(allErrs, field.Invalid(fldPath.Child("networkType"), n.NetworkType, "networkType OpenShiftSDN is currently not supported on Single Node OpenShift"))
379+
if n.NetworkType == string(operv1.NetworkTypeOpenShiftSDN) {
380+
allErrs = append(allErrs, field.Invalid(fldPath.Child("networkType"), n.NetworkType, "networkType OpenShiftSDN is deprecated, please use OVNKubernetes"))
389381
}
390382

391383
if len(n.MachineNetwork) > 0 {
@@ -787,10 +779,6 @@ func validateAPIAndIngressVIPs(vips vips, fieldNames vipFields, vipIsRequired, r
787779
allErrs = append(allErrs, field.Invalid(fldPath.Child(fieldNames.APIVIPs), vip, err.Error()))
788780
}
789781
}
790-
791-
if utilsnet.IsIPv6String(vip) && n.NetworkType == string(operv1.NetworkTypeOpenShiftSDN) {
792-
allErrs = append(allErrs, field.Invalid(fldPath.Child(fieldNames.APIVIPs), vip, "IPv6 is not supported on OpenShiftSDN"))
793-
}
794782
}
795783

796784
if len(vips.Ingress) == 0 {
@@ -834,10 +822,6 @@ func validateAPIAndIngressVIPs(vips vips, fieldNames vipFields, vipIsRequired, r
834822
allErrs = append(allErrs, field.Invalid(fldPath.Child(fieldNames.IngressVIPs), vip, err.Error()))
835823
}
836824
}
837-
838-
if utilsnet.IsIPv6String(vip) && n.NetworkType == string(operv1.NetworkTypeOpenShiftSDN) {
839-
allErrs = append(allErrs, field.Invalid(fldPath.Child(fieldNames.IngressVIPs), vip, "IPv6 is not supported on OpenShiftSDN"))
840-
}
841825
}
842826

843827
if len(vips.API) == 0 {

pkg/types/validation/installconfig_test.go

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ func TestValidateInstallConfig(t *testing.T) {
572572
c.Networking.ClusterNetworkMTU = 8000
573573
return c
574574
}(),
575-
expectedError: `networking\.clusterNetworkMTU: Invalid value: 8000: cluster network MTU is not valid with network plugin OpenShiftSDN$`,
575+
expectedError: `networking.networkType: Invalid value: "OpenShiftSDN": networkType OpenShiftSDN is deprecated, please use OVNKubernetes, networking.clusterNetworkMTU: Invalid value: 8000: cluster network MTU is not valid with network plugin OpenShiftSDN`,
576576
},
577577
{
578578
name: "missing control plane",
@@ -1363,28 +1363,6 @@ func TestValidateInstallConfig(t *testing.T) {
13631363
}(),
13641364
expectedError: `Invalid value: "IPv6": single-stack IPv6 is not supported for this platform`,
13651365
},
1366-
{
1367-
name: "invalid dual-stack configuration, bad plugin",
1368-
installConfig: func() *types.InstallConfig {
1369-
c := validInstallConfig()
1370-
c.Platform = types.Platform{None: &none.Platform{}}
1371-
c.Networking = validDualStackNetworkingConfig()
1372-
c.Networking.NetworkType = "OpenShiftSDN"
1373-
return c
1374-
}(),
1375-
expectedError: `IPv6 is not supported for this networking plugin`,
1376-
},
1377-
{
1378-
name: "invalid single-stack IPv6 configuration, bad plugin",
1379-
installConfig: func() *types.InstallConfig {
1380-
c := validInstallConfig()
1381-
c.Platform = types.Platform{None: &none.Platform{}}
1382-
c.Networking = validIPv6NetworkingConfig()
1383-
c.Networking.NetworkType = "OpenShiftSDN"
1384-
return c
1385-
}(),
1386-
expectedError: `IPv6 is not supported for this networking plugin`,
1387-
},
13881366
{
13891367
name: "invalid dual-stack configuration, machine has no IPv6",
13901368
installConfig: func() *types.InstallConfig {
@@ -1728,7 +1706,7 @@ func TestValidateInstallConfig(t *testing.T) {
17281706

17291707
return c
17301708
}(),
1731-
expectedError: "platform.baremetal.apiVIPs: Invalid value: \"ffd0::1\": IPv6 is not supported on OpenShiftSDN",
1709+
expectedError: "[networking.networkType: Invalid value: \"OpenShiftSDN\": networkType OpenShiftSDN is deprecated, please use OVNKubernetes, platform.baremetal.ingressVIPs: Invalid value: \"10.0.0.4\": IP expected to be in one of the machine networks: ffd0::/48]",
17321710
},
17331711
{
17341712
name: "ingressvips_v6_on_openshiftsdn",
@@ -1744,7 +1722,7 @@ func TestValidateInstallConfig(t *testing.T) {
17441722

17451723
return c
17461724
}(),
1747-
expectedError: "platform.baremetal.ingressVIPs: Invalid value: \"ffd0::1\": IPv6 is not supported on OpenShiftSDN",
1725+
expectedError: "[networking.networkType: Invalid value: \"OpenShiftSDN\": networkType OpenShiftSDN is deprecated, please use OVNKubernetes, platform.baremetal.apiVIPs: Invalid value: \"10.0.0.5\": IP expected to be in one of the machine networks: ffd0::/48]",
17481726
},
17491727
{
17501728
name: "too_many_apivips",

0 commit comments

Comments
 (0)