diff --git a/post-processor/yandex-export/post-processor.go b/post-processor/yandex-export/post-processor.go index 8e75ac807..bc0fe48da 100644 --- a/post-processor/yandex-export/post-processor.go +++ b/post-processor/yandex-export/post-processor.go @@ -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")) diff --git a/post-processor/yandex-export/post-processor_test.go b/post-processor/yandex-export/post-processor_test.go index 82cc21a39..d538504b0 100644 --- a/post-processor/yandex-export/post-processor_test.go +++ b/post-processor/yandex-export/post-processor_test.go @@ -28,7 +28,7 @@ func TestPostProcessor_Configure(t *testing.T) { ServiceAccountKeyFile: "", }, }, - wantErr: true, + wantErr: false, }, { name: "both token and sa key file",