fix: do not allow the same direct port-mapping on more than one node

This commit is contained in:
iwilltry42 2021-07-07 15:52:18 +02:00
parent 99490ca7c1
commit bb237d3389
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
2 changed files with 3 additions and 4 deletions

View File

@ -484,10 +484,6 @@ func applyCLIOverrides(cfg conf.SimpleConfig) (conf.SimpleConfig, error) {
log.Fatalln(err)
}
if len(filters) > 1 {
log.Fatalln("Can only apply a Portmap to one node")
}
// create new entry or append filter to existing entry
if _, exists := portFilterMap[portmap]; exists {
log.Fatalln("Same Portmapping can not be used for multiple nodes")

View File

@ -219,6 +219,9 @@ func TransformSimpleToClusterConfig(ctx context.Context, runtime runtimes.Runtim
}
}
} else if suffix == "direct" {
if len(nodes) > 1 {
return nil, fmt.Errorf("error: cannot apply a direct port-mapping (%s) to more than one node", portmappings)
}
for _, node := range nodes {
if err := addPortMappings(node, portmappings); err != nil {
return nil, err