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 }