Skip to content

Commit 3bb4cae

Browse files
committed
Allow changing extenal client image in Felix FVs
1 parent 374b73d commit 3bb4cae

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

felix/fv/infrastructure/ext_client.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 Tigera, Inc. All rights reserved.
1+
// Copyright (c) 2022-2025 Tigera, Inc. All rights reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -18,13 +18,15 @@ import (
1818
"os"
1919

2020
. "github.com/onsi/gomega"
21+
"github.com/sirupsen/logrus"
2122

2223
"github.com/projectcalico/calico/felix/fv/containers"
2324
"github.com/projectcalico/calico/felix/fv/utils"
2425
)
2526

2627
type ExtClientOpts struct {
2728
IPv6Enabled bool
29+
Image string
2830
}
2931

3032
func RunExtClient(namePrefix string) *containers.Container {
@@ -34,14 +36,20 @@ func RunExtClient(namePrefix string) *containers.Container {
3436
func RunExtClientWithOpts(namePrefix string, opts ExtClientOpts) *containers.Container {
3537
wd, err := os.Getwd()
3638
Expect(err).NotTo(HaveOccurred(), "failed to get working directory")
39+
40+
image := utils.Config.BusyboxImage
41+
if opts.Image != "" {
42+
image = opts.Image
43+
}
44+
logrus.Infof("Running external client container with options %#v", opts)
3745
c := containers.Run(
3846
namePrefix,
3947
containers.RunOpts{
4048
AutoRemove: true,
4149
},
4250
"--privileged", // So that we can add routes inside the container.
4351
"-v", wd+"/../bin:/usr/local/bin", // Map in the test-connectivity binary etc.
44-
utils.Config.BusyboxImage,
52+
image,
4553
"/bin/sh", "-c", "sleep 1000")
4654

4755
if opts.IPv6Enabled {

0 commit comments

Comments
 (0)