when k9s --insecure-skip-tls-verify is set, kubectl would set the same (#1101)

* when k9s --insecure-skip-tls-verify is set, kubectl would set the same

* check insecure flag nil
mine
Harry Han 2021-04-29 10:09:30 -07:00 committed by GitHub
parent 5166686be5
commit 67fc0e347d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,9 @@ func runK(a *App, opts shellOpts) bool {
if g, err := a.Conn().Config().ImpersonateGroups(); err == nil {
args = append(args, "--as-group", g)
}
if isInsecure := a.Conn().Config().Flags().Insecure; isInsecure != nil && *isInsecure {
args = append(args, "--insecure-skip-tls-verify")
}
args = append(args, "--context", a.Config.K9s.CurrentContext)
if cfg := a.Conn().Config().Flags().KubeConfig; cfg != nil && *cfg != "" {
args = append(args, "--kubeconfig", *cfg)