Skip to content

Commit

Permalink
Pin submariner version
Browse files Browse the repository at this point in the history
The current code installed the latest version that the installed subctl
tool can install. Change to install specific version so we can have more
predictable results.

Another benefit is reusing the netest image installed by submariner for
testing it later. Previously we pulled both nettest:0.15.2 and
netest:lastest.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jul 12, 2023
1 parent c36e115 commit 2eb9469
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion test/addons/submariner/base/src/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ metadata:
spec:
containers:
- name: test
image: quay.io/submariner/nettest
# NOTE: keep in sync with start:VERSION.
image: quay.io/submariner/nettest:0.15.2
command:
- sh
- -c
Expand Down
17 changes: 15 additions & 2 deletions test/addons/submariner/start
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ from drenv import cluster as drenv_cluster
from drenv import kubectl
from drenv import subctl

VERSION = "0.15.2"

NAMESPACE = "submariner-operator"

BROKER_DEPLOYMENTS = ("submariner-operator",)
Expand All @@ -33,7 +35,12 @@ def deploy_broker(broker):
os.makedirs(broker_dir, exist_ok=True)

print(f"Deploying submariner broker in cluster '{broker}'")
subctl.deploy_broker(broker, globalnet=True, broker_info=broker_info)
subctl.deploy_broker(
broker,
globalnet=True,
broker_info=broker_info,
version=VERSION,
)
print(f"Broker info stored in '{broker_info}'")

print(f"Waiting for submariner broker deployments in cluster '{broker}'")
Expand All @@ -47,7 +54,13 @@ def join_cluster(cluster, broker_info):
drenv_cluster.wait_until_ready(cluster)

print(f"Joining cluster '{cluster}' to broker")
subctl.join(broker_info, context=cluster, clusterid=cluster, cable_driver="vxlan")
subctl.join(
broker_info,
context=cluster,
clusterid=cluster,
cable_driver="vxlan",
version=VERSION,
)


def wait_for_cluster(cluster):
Expand Down
8 changes: 6 additions & 2 deletions test/drenv/subctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
BROKER_INFO = "broker-info.subm"


def deploy_broker(context, globalnet=False, broker_info=None, log=print):
def deploy_broker(context, globalnet=False, broker_info=None, version=None, log=print):
"""
Run subctl deploy-broker ... logging progress messages.
Expand All @@ -18,20 +18,24 @@ def deploy_broker(context, globalnet=False, broker_info=None, log=print):
args = ["deploy-broker", "--context", context]
if globalnet:
args.append("--globalnet")
if version:
args.append(f"--version={version}")

_watch(*args, log=log)

if broker_info:
shutil.move(BROKER_INFO, broker_info)


def join(broker_info, context, clusterid, cable_driver=None, log=print):
def join(broker_info, context, clusterid, cable_driver=None, version=None, log=print):
"""
Run subctl join ... logging progress messages.
"""
args = ["join", broker_info, "--context", context, "--clusterid", clusterid]
if cable_driver:
args.extend(("--cable-driver", cable_driver))
if version:
args.append(f"--version={version}")
_watch(*args, log=log)


Expand Down

0 comments on commit 2eb9469

Please sign in to comment.