test(ci): use k8s websocket executor for tests

Use k8s websocket executor over SPDY.

Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
Noel Georgi 2025-03-12 17:50:52 +05:30
parent 9531c1c6d2
commit 29f7b3bf37
No known key found for this signature in database
GPG Key ID: 21A9F444075C9E36
2 changed files with 5 additions and 2 deletions

View File

@ -240,6 +240,8 @@ func (suite *ExtensionsSuiteQEMU) TestExtensionsCrun() {
// TestExtensionsKataContainers verifies gvisor runtime class is working.
func (suite *ExtensionsSuiteQEMU) TestExtensionsKataContainers() {
suite.T().Skip("TODO: skipping since Kata is broken")
suite.testRuntimeClass("kata", "kata")
}

View File

@ -274,6 +274,7 @@ func (p *pod) Exec(ctx context.Context, command string) (string, string, error)
}
req := p.suite.Clientset.CoreV1().RESTClient().Post().Resource("pods").Name(p.name).
Namespace(p.namespace).SubResource("exec")
option := &corev1.PodExecOptions{
Command: cmd,
Stdin: false,
@ -287,14 +288,14 @@ func (p *pod) Exec(ctx context.Context, command string) (string, string, error)
scheme.ParameterCodec,
)
exec, err := remotecommand.NewSPDYExecutor(p.suite.RestConfig, "POST", req.URL())
websocketExec, err := remotecommand.NewWebSocketExecutor(p.suite.RestConfig, "GET", req.URL().String())
if err != nil {
return "", "", err
}
var stdout, stderr strings.Builder
err = exec.StreamWithContext(ctx, remotecommand.StreamOptions{
err = websocketExec.StreamWithContext(ctx, remotecommand.StreamOptions{
Stdout: &stdout,
Stderr: &stderr,
})