mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 16:21:13 +00:00
Fix indentation and skip leading v on the semver.
This commit is contained in:
parent
b6f23b1eed
commit
7221fe6dd4
@ -305,7 +305,7 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
|
|||||||
func CreateGCECloud(config *CloudConfig) (*GCECloud, error) {
|
func CreateGCECloud(config *CloudConfig) (*GCECloud, error) {
|
||||||
// Remove any pre-release version and build metadata from the semver, leaving only the MAJOR.MINOR.PATCH portion.
|
// Remove any pre-release version and build metadata from the semver, leaving only the MAJOR.MINOR.PATCH portion.
|
||||||
// See http://semver.org/.
|
// See http://semver.org/.
|
||||||
version := strings.Split(strings.Split(version.Get().GitVersion, "-")[0], "+")[0]
|
version := strings.TrimLeft(strings.Split(strings.Split(version.Get().GitVersion, "-")[0], "+")[0], "v")
|
||||||
|
|
||||||
// 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.
|
// 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)
|
userAgent := fmt.Sprintf("(%s %s) Kubernetes/%s", runtime.GOOS, runtime.GOARCH, version)
|
||||||
|
Loading…
Reference in New Issue
Block a user