Skip to content

Commit

Permalink
Merge pull request #2046 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2038-to-release-4.14

OCPBUGS-20254: [release-4.14] Revert Kuryr MTU fixes
  • Loading branch information
openshift-ci[bot] committed Oct 9, 2023
2 parents a936ce4 + 4d4c51a commit ed997d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
8 changes: 3 additions & 5 deletions pkg/network/kuryr.go
Expand Up @@ -112,6 +112,7 @@ func renderKuryr(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.BootstrapR

// Pods Network MTU
data.Data["PodsNetworkMTU"] = b.PodsNetworkMTU
c.MTU = &b.PodsNetworkMTU

manifests, err := render.RenderDir(filepath.Join(manifestDir, "network/kuryr"), &data)
if err != nil {
Expand Down Expand Up @@ -218,7 +219,7 @@ func isKuryrChangeSafe(prev, next *operv1.NetworkSpec) []error {
errs = append(errs, errors.Errorf("cannot change kuryr openStackServiceNetwork"))
}

if pn.MTU != nil && *pn.MTU != 0 && !reflect.DeepEqual(pn.MTU, nn.MTU) {
if !reflect.DeepEqual(pn.MTU, nn.MTU) {
errs = append(errs, errors.Errorf("cannot change mtu for the Pods Network"))
}

Expand Down Expand Up @@ -256,15 +257,12 @@ func fillKuryrDefaults(conf, previous *operv1.NetworkSpec) {
var batchPorts uint = 3
kc.PoolBatchPorts = &batchPorts
}
// MTU is currently the only field we pull from previous.
// MTU is currently the only field we pull from previous.
if kc.MTU == nil {
if previous != nil && previous.DefaultNetwork.KuryrConfig != nil &&
previous.DefaultNetwork.KuryrConfig.MTU != nil {
mtu := *previous.DefaultNetwork.KuryrConfig.MTU
kc.MTU = &mtu
}
// if it wasn't set, let's make sure we set something
var mtu uint32 = 0
kc.MTU = &mtu
}
}
2 changes: 0 additions & 2 deletions pkg/network/kuryr_test.go
Expand Up @@ -164,7 +164,6 @@ func TestFillKuryrDefaults(t *testing.T) {
c := uint32(8091)
d := uint32(8090)
batch := uint(3)
mtu := uint32(0)
expected := operv1.NetworkSpec{
ServiceNetwork: []string{"172.30.0.0/16"},
ClusterNetwork: []operv1.ClusterNetworkEntry{
Expand All @@ -183,7 +182,6 @@ func TestFillKuryrDefaults(t *testing.T) {
PoolMaxPorts: 0,
PoolMinPorts: 1,
PoolBatchPorts: &batch,
MTU: &mtu,
},
},
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/platform/openstack/kuryr_bootstrap.go
Expand Up @@ -417,14 +417,12 @@ func BootstrapKuryr(conf *operv1.NetworkSpec, kubeClient crclient.Client) (*boot

// Check the MTU. Basically if MTU is configured on KuryrConfig, then we need it to be lower or equal to nodes
// network MTU. Use configured value if it is, error out if it isn't.
if kc.MTU != nil && *kc.MTU != 0 {
if kc.MTU != nil {
if mtu >= *kc.MTU {
mtu = *kc.MTU
} else {
return nil, errors.Errorf("Configured MTU (%d) is incompatible with OpenShift nodes network MTU (%d).", *kc.MTU, mtu)
}
} else {
kc.MTU = &mtu
}

log.Print("Ensuring services network")
Expand Down

0 comments on commit ed997d2

Please sign in to comment.