Skip to content

Commit 8b3b4b5

Browse files
committed
feat: add TLSServerName and SkipTLSVerify options
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
1 parent 5e04e7e commit 8b3b4b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/kube/kube_config_getter.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type KubeConfigGetterOptions struct {
2222
BearerToken string
2323
APIServer string
2424
CAFile string
25+
TLSServerName string
26+
SkipTLSVerify bool
2527
Impersonate string
2628
ImpersonateGroup []string
2729
}
@@ -50,6 +52,9 @@ func NewKubeConfigGetter(opts KubeConfigGetterOptions) (genericclioptions.RESTCl
5052
configFlags.KubeConfig = new(string)
5153
*configFlags.KubeConfig = opts.ConfigPath
5254

55+
configFlags.Insecure = new(bool)
56+
*configFlags.Insecure = opts.SkipTLSVerify
57+
5358
if opts.Namespace != "" {
5459
configFlags.Namespace = new(string)
5560
*configFlags.Namespace = opts.Namespace
@@ -70,6 +75,11 @@ func NewKubeConfigGetter(opts KubeConfigGetterOptions) (genericclioptions.RESTCl
7075
*configFlags.CAFile = opts.CAFile
7176
}
7277

78+
if opts.TLSServerName != "" {
79+
configFlags.TLSServerName = new(string)
80+
*configFlags.TLSServerName = opts.TLSServerName
81+
}
82+
7383
if opts.Impersonate != "" {
7484
configFlags.Impersonate = new(string)
7585
*configFlags.Impersonate = opts.Impersonate

0 commit comments

Comments
 (0)