Fix linter error reported.
Some checks failed
Run the E2E test on kind / get-go-version (push) Failing after 1m17s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
Xun Jiang
2025-11-25 01:01:49 +08:00
committed by Xun Jiang/Bruce Jiang
parent 758f6a4847
commit 64e3643006
20 changed files with 37 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ limitations under the License.
package process
import (
"context"
"os"
"os/exec"
@@ -78,7 +79,7 @@ func (b *clientBuilder) clientConfig() *hcplugin.ClientConfig {
string(common.PluginKindItemBlockAction): ibav1.NewItemBlockActionPlugin(common.ClientLogger(b.clientLogger)),
},
Logger: b.pluginLogger,
Cmd: exec.Command(b.commandName, b.commandArgs...), //nolint:gosec // Internal call. No need to check the command line.
Cmd: exec.CommandContext(context.Background(), b.commandName, b.commandArgs...), //nolint:gosec // Internal call. No need to check the command line.
}
}

View File

@@ -65,9 +65,11 @@ func TestClientConfig(t *testing.T) {
string(common.PluginKindItemBlockAction): ibav1.NewItemBlockActionPlugin(common.ClientLogger(logger)),
},
Logger: cb.pluginLogger,
Cmd: exec.Command(cb.commandName, cb.commandArgs...),
Cmd: exec.CommandContext(t.Context(), cb.commandName, cb.commandArgs...),
}
cc := cb.clientConfig()
assert.Equal(t, expected, cc)
assert.Equal(t, expected.HandshakeConfig, cc.HandshakeConfig)
assert.Equal(t, expected.AllowedProtocols, cc.AllowedProtocols)
assert.Equal(t, expected.Plugins, cc.Plugins)
}