Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: Env override NETWORKING_E2E_BOND_MTU #29630

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions test/extended/networking/bonds.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"strconv"
"strings"

g "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -36,15 +38,23 @@ var _ = g.Describe("[sig-network][Feature:bond]", func() {
)
o.Expect(err).NotTo(o.HaveOccurred(), "unable to create macvlan network-attachment-definition")

networkConfig, err := oc.AdminConfigClient().ConfigV1().Networks().Get(context.Background(), "cluster", metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred(), "unable to get network config")
var mtu int
if mtuEnv := os.Getenv("NETWORKING_E2E_BOND_MTU"); mtuEnv != "" {
mtu, err = strconv.Atoi(mtuEnv)
o.Expect(err).NotTo(o.HaveOccurred())
} else {
networkConfig, err := oc.AdminConfigClient().ConfigV1().Networks().
Get(context.Background(), "cluster", metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred(), "unable to get network config")
mtu = networkConfig.Status.ClusterNetworkMTU
}

err = createBondNAD(
oc.AdminConfig(),
namespace,
bondnad1,
"192.0.2.10/24",
networkConfig.Status.ClusterNetworkMTU,
mtu,
"net1",
"net2",
)
Expand All @@ -55,7 +65,7 @@ var _ = g.Describe("[sig-network][Feature:bond]", func() {
namespace,
bondnad2,
"192.0.2.11/24",
networkConfig.Status.ClusterNetworkMTU,
mtu,
"net1",
"net2",
)
Expand Down