Skip to content

Commit

Permalink
feat: cleanup cert/key info in tls config for ensuring service accoun…
Browse files Browse the repository at this point in the history
…t will be used (#2098)

Signed-off-by: rambohe-ch <linbo.hlb@alibaba-inc.com>
  • Loading branch information
rambohe-ch committed Jul 16, 2024
1 parent b3ff015 commit beae373
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/yurt-manager/app/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ func GetConfigByControllerNameOrDie(mgr manager.Manager, controllerName string)
cfg := rest.CopyConfig(baseCfg)
rest.AddUserAgent(cfg, controllerName)

// clean cert/key info in tls config for ensuring service account will be used.
cfg.TLSClientConfig.KeyFile = ""
cfg.TLSClientConfig.CertFile = ""
cfg.TLSClientConfig.CertData = []byte{}
cfg.TLSClientConfig.KeyData = []byte{}

// add controller-specific token wrapper to cfg
cachedTokenSource := transport.NewCachedTokenSource(&tokenSourceImpl{
namespace: namespace,
Expand Down

0 comments on commit beae373

Please sign in to comment.