diff --git a/agent/engine/engine_sudo_linux_integ_test.go b/agent/engine/engine_sudo_linux_integ_test.go index 7f8456b9f41..f57781ab2b4 100644 --- a/agent/engine/engine_sudo_linux_integ_test.go +++ b/agent/engine/engine_sudo_linux_integ_test.go @@ -215,7 +215,9 @@ func TestFirelensFluentbit(t *testing.T) { defer server.Close() port := getPortFromAddr(t, server.URL) - serverURL := fmt.Sprintf("http://%s:%s", getHostPrivateIP(t, ec2.NewEC2MetadataClient(nil)), port) + ec2MetadataClient, err := ec2.NewEC2MetadataClient(nil) + require.NoError(t, err) + serverURL := fmt.Sprintf("http://%s:%s", getHostPrivateIP(t, ec2MetadataClient), port) defer setV3MetadataURLFormat(serverURL + "/v3/%s")() testTask := createFirelensTask(t)