feat: Allow unsetting ssh config options from deployment (#6847)

This allows deleting ssh config options
This commit is contained in:
Steven Masley
2023-03-28 11:06:42 -05:00
committed by GitHub
parent 1176256a44
commit a8346bd8ea
2 changed files with 15 additions and 3 deletions
+3
View File
@@ -66,6 +66,7 @@ func TestConfigSSH(t *testing.T) {
const hostname = "test-coder."
const expectedKey = "ConnectionAttempts"
const removeKey = "ConnectionTimeout"
client := coderdtest.New(t, &coderdtest.Options{
IncludeProvisionerDaemon: true,
ConfigSSH: codersdk.SSHConfigResponse{
@@ -73,6 +74,7 @@ func TestConfigSSH(t *testing.T) {
SSHConfigOptions: map[string]string{
// Something we can test for
expectedKey: "3",
removeKey: "",
},
},
})
@@ -176,6 +178,7 @@ func TestConfigSSH(t *testing.T) {
fileContents, err := os.ReadFile(sshConfigFile)
require.NoError(t, err, "read ssh config file")
require.Contains(t, string(fileContents), expectedKey, "ssh config file contains expected key")
require.NotContains(t, string(fileContents), removeKey, "ssh config file should not have removed key")
home := filepath.Dir(filepath.Dir(sshConfigFile))
// #nosec