Skip to content

Commit 71cac61

Browse files
haarchriJimBugwadiaeddycharly
authored
fix(kube): add required interactivemode for exec (#2264)
* fix(kube): add required interactivemode for exec Signed-off-by: Christopher Haar <[email protected]> * style(lint): fix linter for new golangci-lint Signed-off-by: Christopher Haar <[email protected]> --------- Signed-off-by: Christopher Haar <[email protected]> Co-authored-by: Jim Bugwadia <[email protected]> Co-authored-by: Charles-Edouard Brétéché <[email protected]>
1 parent de947f2 commit 71cac61

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ linters:
2828
- noctx
2929
- nolintlint
3030
- nosprintfhostport
31-
# - paralleltest
3231
- staticcheck
3332
- thelper
3433
- tparallel

pkg/utils/rest/config.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ func Save(cfg *rest.Config, w io.Writer) error {
4040
}
4141
if cfg.ExecProvider != nil {
4242
execConfig = &api.ExecConfig{
43-
Command: cfg.ExecProvider.Command,
44-
Args: cfg.ExecProvider.Args,
45-
APIVersion: cfg.ExecProvider.APIVersion,
46-
Env: []api.ExecEnvVar{},
43+
Command: cfg.ExecProvider.Command,
44+
Args: cfg.ExecProvider.Args,
45+
APIVersion: cfg.ExecProvider.APIVersion,
46+
Env: []api.ExecEnvVar{},
47+
InteractiveMode: api.ExecInteractiveMode(cfg.ExecProvider.InteractiveMode),
4748
}
4849
for _, envVar := range cfg.ExecProvider.Env {
4950
execConfig.Env = append(execConfig.Env, api.ExecEnvVar{

pkg/utils/rest/config_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func TestSave(t *testing.T) {
185185
Name: "foo",
186186
Value: "bar",
187187
}},
188+
InteractiveMode: api.IfAvailableExecInteractiveMode,
188189
},
189190
},
190191
wantW: `
@@ -212,6 +213,7 @@ users:
212213
env:
213214
- name: foo
214215
value: bar
216+
interactiveMode: IfAvailable
215217
provideClusterInfo: false
216218
`,
217219
}}

0 commit comments

Comments
 (0)