Skip to content

Commit 7615cf0

Browse files
Merge pull request #2849 from jrvaldes/e2e-fix-updates
Fix unknown verb in message and ignore SSH known hosts in test suite
2 parents 83e0b12 + 1f5df66 commit 7615cf0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/e2e/certificates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (tc *testContext) testKubeletCARotation(t *testing.T) {
4646
// spin-off subtests to ensure the CA bundle file is verified in all Windows nodes
4747
t.Run("node/"+winNode.Name, func(t *testing.T) {
4848
err := tc.waitForKubeletCACertificateInNode(&winNode)
49-
assert.NoErrorf(t, err, "kubelet CA certificate should be present in node %S", winNode.Name)
49+
assert.NoErrorf(t, err, "kubelet CA certificate should be present in node %s", winNode.Name)
5050
})
5151
}
5252
}

test/e2e/validation_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,12 @@ func (tc *testContext) runPowerShellSSHJob(name, command, ip string) (string, er
375375
}
376376

377377
keyMountDir := "/private-key"
378+
sshOptions := "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
378379
sshCommand := []string{"bash", "-c",
379380
fmt.Sprintf(
380381
// first determine if the host has PowerShell or cmd as the default shell by running a simple PowerShell
381382
// command. If it succeeds, then the host's default shell is PowerShell
382-
"if ssh -o StrictHostKeyChecking=no -i %s %s@%s 'Get-Help';"+
383+
"if ssh "+sshOptions+" -i %s %s@%s 'Get-Help';"+
383384
"then CMD_PREFIX=\"\";CMD_SUFFIX=\"\";"+
384385
// to respect quoting within the given command, wrap the command as a script block
385386
"COMMAND='{"+powershellDefaultCommand+"}';"+
@@ -388,7 +389,7 @@ func (tc *testContext) runPowerShellSSHJob(name, command, ip string) (string, er
388389
"COMMAND='{"+command+"}';"+
389390
"fi;"+
390391
// execute the command as a script block via the PowerShell call operator `&`
391-
"ssh -o StrictHostKeyChecking=no -i %s %s@%s ${CMD_PREFIX}\" & $COMMAND \"${CMD_SUFFIX}",
392+
"ssh "+sshOptions+" -i %s %s@%s ${CMD_PREFIX}\" & $COMMAND \"${CMD_SUFFIX}",
392393
filepath.Join(keyMountDir, secrets.PrivateKeySecretKey), tc.vmUsername(), ip,
393394
filepath.Join(keyMountDir, secrets.PrivateKeySecretKey), tc.vmUsername(), ip)}
394395

0 commit comments

Comments
 (0)