1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 15:45:08 +01:00

quadlet: handle generate environment params that inherit from host

Fixes: #26247

Signed-off-by: Volodymyr Pankin <volopank@gmail.com>
This commit is contained in:
Volodymyr Pankin
2025-06-08 21:53:29 +02:00
committed by volodymyr
parent 246a688ee0
commit 2b6c477884
4 changed files with 14 additions and 9 deletions

View File

@@ -839,9 +839,9 @@ func (f *UnitFile) LookupLastArgs(groupName string, key string) ([]string, bool)
}
// Look up 'Environment' style key-value keys
func (f *UnitFile) LookupAllKeyVal(groupName string, key string) (map[string]string, error) {
func (f *UnitFile) LookupAllKeyVal(groupName string, key string) (map[string]*string, error) {
var warnings error
res := make(map[string]string)
res := make(map[string]*string)
allKeyvals := f.LookupAll(groupName, key)
for _, keyvals := range allKeyvals {
assigns, err := splitString(keyvals, WhitespaceSeparators, SplitRelax|SplitUnquote|SplitCUnescape)
@@ -852,9 +852,9 @@ func (f *UnitFile) LookupAllKeyVal(groupName string, key string) (map[string]str
for _, assign := range assigns {
key, value, found := strings.Cut(assign, "=")
if found {
res[key] = value
res[key] = &value
} else {
warnings = errors.Join(warnings, fmt.Errorf("separator was not found for %s", assign))
res[key] = nil
}
}
}