add comment and remove overrides

This commit is contained in:
Roman Mingazeev 2020-12-01 19:45:43 +03:00
parent 23118c451c
commit efe6d2f08f
2 changed files with 10 additions and 8 deletions

View File

@ -120,12 +120,6 @@ func (c *NetworkConfig) Prepare(errs *packer.MultiError) *packer.MultiError {
c.Zone = defaultZone 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 return errs
} }

View File

@ -101,6 +101,10 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
return errs 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 { if p.config.UseIPv4Nat && p.config.UseIPv6 == false {
p.config.UseIPv4Nat = true p.config.UseIPv4Nat = true
} }
@ -109,8 +113,12 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
if p.config.Labels == nil { if p.config.Labels == nil {
p.config.Labels = make(map[string]string) p.config.Labels = make(map[string]string)
} }
p.config.Labels["role"] = "exporter" if _, ok := p.config.Labels["role"]; !ok {
p.config.Labels["target"] = "object-storage" p.config.Labels["role"] = "exporter"
}
if _, ok := p.config.Labels["target"]; !ok {
p.config.Labels["target"] = "object-storage"
}
return nil return nil
} }