Skip to content

Commit

Permalink
Added support for impersonation in the kubectl
Browse files Browse the repository at this point in the history
Signed-off-by: anandf <anjoseph@redhat.com>
  • Loading branch information
anandf committed Feb 7, 2024
1 parent 5fd9f44 commit d6d94bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/utils/kube/resource_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ func kubeCmdFactory(kubeconfig, ns string, config *rest.Config) cmdutil.Factory
kubeConfigFlags.KubeConfig = &kubeconfig
kubeConfigFlags.WithDiscoveryBurst(config.Burst)
kubeConfigFlags.WithDiscoveryQPS(config.QPS)
kubeConfigFlags.Impersonate = &config.Impersonate.UserName
kubeConfigFlags.ImpersonateUID = &config.Impersonate.UID
kubeConfigFlags.ImpersonateGroup = &config.Impersonate.Groups
matchVersionKubeConfigFlags := cmdutil.NewMatchVersionFlags(kubeConfigFlags)
return cmdutil.NewFactory(matchVersionKubeConfigFlags)
}
Expand Down

0 comments on commit d6d94bc

Please sign in to comment.