bake: add no-cache-filter

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2021-11-22 20:56:29 -08:00
parent 3b47722032
commit 32f6358d78
3 changed files with 25 additions and 10 deletions

View File

@ -194,6 +194,14 @@ func (t *Target) composeExtTarget(exts map[string]interface{}) error {
if res, ok := val.(bool); ok {
t.NoCache = &res
}
case "no-cache-filter":
if res, k := val.(string); k {
t.NoCacheFilter = append(t.NoCacheFilter, res)
} else {
for _, res := range val.([]interface{}) {
t.NoCacheFilter = append(t.NoCacheFilter, res.(string))
}
}
default:
return fmt.Errorf("compose file invalid: unkwown %s field for x-bake", key)
}