Skip to content
Merged
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
12 changes: 10 additions & 2 deletions felix/fv/infrastructure/ext_client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022 Tigera, Inc. All rights reserved.
// Copyright (c) 2022-2025 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,13 +18,15 @@ import (
"os"

. "github.com/onsi/gomega"
"github.com/sirupsen/logrus"

"github.com/projectcalico/calico/felix/fv/containers"
"github.com/projectcalico/calico/felix/fv/utils"
)

type ExtClientOpts struct {
IPv6Enabled bool
Comment thread
mazdakn marked this conversation as resolved.
Image string
}

func RunExtClient(namePrefix string) *containers.Container {
Expand All @@ -34,14 +36,20 @@ func RunExtClient(namePrefix string) *containers.Container {
func RunExtClientWithOpts(namePrefix string, opts ExtClientOpts) *containers.Container {
wd, err := os.Getwd()
Expect(err).NotTo(HaveOccurred(), "failed to get working directory")

image := utils.Config.BusyboxImage
if opts.Image != "" {
image = opts.Image
}
logrus.Infof("Running external client container with options %#v", opts)
c := containers.Run(
namePrefix,
containers.RunOpts{
AutoRemove: true,
},
"--privileged", // So that we can add routes inside the container.
"-v", wd+"/../bin:/usr/local/bin", // Map in the test-connectivity binary etc.
utils.Config.BusyboxImage,
image,
"/bin/sh", "-c", "sleep 1000")

if opts.IPv6Enabled {
Expand Down
Loading