From 56224ae08d42616cc955a12b607369c4f4589a75 Mon Sep 17 00:00:00 2001 From: Gennady Lipenkov Date: Wed, 17 Jun 2020 18:15:53 +0300 Subject: [PATCH] Instance SA auth for yandex-export post-processor --- post-processor/yandex-export/post-processor.go | 5 ----- post-processor/yandex-export/post-processor_test.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) 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",