Skip to content

Commit

Permalink
feat: add TLSServerName and SkipTLSVerify options
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Lesikov <[email protected]>
  • Loading branch information
ilya-lesikov committed Jan 20, 2025
1 parent 5e04e7e commit 8b3b4b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/kube/kube_config_getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type KubeConfigGetterOptions struct {
BearerToken string
APIServer string
CAFile string
TLSServerName string
SkipTLSVerify bool
Impersonate string
ImpersonateGroup []string
}
Expand Down Expand Up @@ -50,6 +52,9 @@ func NewKubeConfigGetter(opts KubeConfigGetterOptions) (genericclioptions.RESTCl
configFlags.KubeConfig = new(string)
*configFlags.KubeConfig = opts.ConfigPath

configFlags.Insecure = new(bool)
*configFlags.Insecure = opts.SkipTLSVerify

if opts.Namespace != "" {
configFlags.Namespace = new(string)
*configFlags.Namespace = opts.Namespace
Expand All @@ -70,6 +75,11 @@ func NewKubeConfigGetter(opts KubeConfigGetterOptions) (genericclioptions.RESTCl
*configFlags.CAFile = opts.CAFile
}

if opts.TLSServerName != "" {
configFlags.TLSServerName = new(string)
*configFlags.TLSServerName = opts.TLSServerName
}

if opts.Impersonate != "" {
configFlags.Impersonate = new(string)
*configFlags.Impersonate = opts.Impersonate
Expand Down

0 comments on commit 8b3b4b5

Please sign in to comment.