Instance SA auth for yandex-export post-processor

This commit is contained in:
Gennady Lipenkov 2020-06-17 18:15:53 +03:00
parent 5cb2ef6e9d
commit 56224ae08d
2 changed files with 1 additions and 6 deletions

View File

@ -88,11 +88,6 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
p.config.ServiceAccountKeyFile = os.Getenv("YC_SERVICE_ACCOUNT_KEY_FILE")
}
if p.config.Token == "" && p.config.ServiceAccountKeyFile == "" {
errs = packer.MultiErrorAppend(
errs, fmt.Errorf("a token or service account key file must be specified"))
}
if p.config.Token != "" && p.config.ServiceAccountKeyFile != "" {
errs = packer.MultiErrorAppend(
errs, fmt.Errorf("one of token or service account key file must be specified, not both"))

View File

@ -28,7 +28,7 @@ func TestPostProcessor_Configure(t *testing.T) {
ServiceAccountKeyFile: "",
},
},
wantErr: true,
wantErr: false,
},
{
name: "both token and sa key file",