Merge pull request #9164 from sharifelgamal/trim-project

trim whitespace when setting gcp project id
pull/9166/head
Sharif Elgamal 2020-09-02 13:28:54 -07:00 committed by GitHub
commit dd48dab036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
package gcpauth
import (
"bytes"
"context"
"os"
"os/exec"
@ -79,7 +80,7 @@ func enableAddon(cfg *config.ClusterConfig) error {
// We're currently assuming gcloud is installed and in the user's path
project, err := exec.Command("gcloud", "config", "get-value", "project").Output()
if err == nil && len(project) > 0 {
f := assets.NewMemoryAssetTarget(project, projectPath, "0444")
f := assets.NewMemoryAssetTarget(bytes.TrimSpace(project), projectPath, "0444")
return r.Copy(f)
}