From c384e37177614ad6dcf58eb2dd5543f9c06cc455 Mon Sep 17 00:00:00 2001 From: Yibo Zhuang Date: Mon, 27 Nov 2023 17:51:02 -0800 Subject: [PATCH] containerd-stress: use config address for CRI test This change removes the hard-coded containerd endpoint for CRI test and use the address in the config which would honor the CLI flag. Signed-off-by: Yibo Zhuang --- cmd/containerd-stress/main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/containerd-stress/main.go b/cmd/containerd-stress/main.go index bf0aa829d..df5c06b78 100644 --- a/cmd/containerd-stress/main.go +++ b/cmd/containerd-stress/main.go @@ -264,13 +264,12 @@ func serve(c config) error { func criTest(c config) error { var ( - timeout = 1 * time.Minute - wg sync.WaitGroup - ctx = namespaces.WithNamespace(context.Background(), stressNs) - criEndpoint = "unix:///run/containerd/containerd.sock" + timeout = 1 * time.Minute + wg sync.WaitGroup + ctx = namespaces.WithNamespace(context.Background(), stressNs) ) - client, err := remote.NewRuntimeService(criEndpoint, timeout) + client, err := remote.NewRuntimeService(c.Address, timeout) if err != nil { return fmt.Errorf("failed to create runtime service: %w", err) }