Skip to content

BearerTokenFile should be set to empty when overwrites BearerToken

Gao Peng requested to merge gaopenghigh/gitlab-runner:master into master

What does this MR do?

According to https://github.com/kubernetes/client-go/blob/master/rest/config.go#L75 , Content of rest.Config.BearerToken will be replaced by content of BearerTokenFile:

	// Path to a file containing a BearerToken.
	// If set, the contents are periodically read.
	// The last successfully read value takes precedence over BearerToken.
	BearerTokenFile string

If runner use "in cluster config", BearerTokenFile is set to /var/run/secrets/kubernetes.io/serviceaccount/token, and BearerToken overwrite will not work correctly. When overwrites BearerToken, BearerTokenFile should set to "".

Why was this MR needed?

What's the best way to test this MR?

What are the relevant issue numbers?

Merge request reports