Skip to content

Commit

Permalink
Added support for impersonation in the kubectl (#534)
Browse files Browse the repository at this point in the history
Signed-off-by: anandf <anjoseph@redhat.com>
  • Loading branch information
anandf authored Sep 5, 2024
1 parent 95e0025 commit bd7681a
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 @@ -155,6 +155,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 bd7681a

Please sign in to comment.