From efe6d2f08fe6e474e074f08cd4b53957a091b948 Mon Sep 17 00:00:00 2001 From: Roman Mingazeev Date: Tue, 1 Dec 2020 19:45:43 +0300 Subject: [PATCH] add comment and remove overrides --- builder/yandex/common_config.go | 6 ------ post-processor/yandex-export/post-processor.go | 12 ++++++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/builder/yandex/common_config.go b/builder/yandex/common_config.go index 308e4b112..992f5c022 100644 --- a/builder/yandex/common_config.go +++ b/builder/yandex/common_config.go @@ -120,12 +120,6 @@ func (c *NetworkConfig) Prepare(errs *packer.MultiError) *packer.MultiError { c.Zone = defaultZone } - // if c.UseIPv4Nat && c.UseIPv6 { - // errs = packer.MultiErrorAppend( - // errors.New("one of use_ipv4_nat or use_ipv6 key file must be specified, not both"), - // errs, - // ) - // } return errs } diff --git a/post-processor/yandex-export/post-processor.go b/post-processor/yandex-export/post-processor.go index 8626f34ec..070ba50f7 100644 --- a/post-processor/yandex-export/post-processor.go +++ b/post-processor/yandex-export/post-processor.go @@ -101,6 +101,10 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { return errs } + // Due to the fact that now it's impossible to go to the object storage + // through the internal network - we need access + // to the global Internet: either through ipv4 or ipv6 + // TODO: delete this when access appears if p.config.UseIPv4Nat && p.config.UseIPv6 == false { p.config.UseIPv4Nat = true } @@ -109,8 +113,12 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { if p.config.Labels == nil { p.config.Labels = make(map[string]string) } - p.config.Labels["role"] = "exporter" - p.config.Labels["target"] = "object-storage" + if _, ok := p.config.Labels["role"]; !ok { + p.config.Labels["role"] = "exporter" + } + if _, ok := p.config.Labels["target"]; !ok { + p.config.Labels["target"] = "object-storage" + } return nil }