mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 04:27:54 +00:00
Add some comments to the version and user-agent changes.
This commit is contained in:
parent
c947339f27
commit
b6f23b1eed
@ -303,7 +303,11 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
|
||||
// If no tokenSource is specified, uses oauth2.DefaultTokenSource.
|
||||
// If managedZones is nil / empty all zones in the region will be managed.
|
||||
func CreateGCECloud(config *CloudConfig) (*GCECloud, error) {
|
||||
// Remove any pre-release version and build metadata from the semver, leaving only the MAJOR.MINOR.PATCH portion.
|
||||
// See http://semver.org/.
|
||||
version := strings.Split(strings.Split(version.Get().GitVersion, "-")[0], "+")[0]
|
||||
|
||||
// Create a user-agent header append string to supply to the Google API clients, to identify Kubernetes as the origin of the GCP API calls.
|
||||
userAgent := fmt.Sprintf("(%s %s) Kubernetes/%s", runtime.GOOS, runtime.GOARCH, version)
|
||||
|
||||
client, err := newOauthClient(config.TokenSource)
|
||||
|
Loading…
Reference in New Issue
Block a user