Instance SA auth for yandex-export post-processor
This commit is contained in:
parent
5cb2ef6e9d
commit
56224ae08d
|
@ -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"))
|
||||
|
|
|
@ -28,7 +28,7 @@ func TestPostProcessor_Configure(t *testing.T) {
|
|||
ServiceAccountKeyFile: "",
|
||||
},
|
||||
},
|
||||
wantErr: true,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "both token and sa key file",
|
||||
|
|
Loading…
Reference in New Issue