Skip to content

Commit

Permalink
[v0.19] bake: remove empty values set by --set
Browse files Browse the repository at this point in the history
These parser functions are called for `--set` to
resolve entitlement paths that would be automatically added
and will fail for empty value.

The empty values would already be ignored but in v0.19 is
done after merging the `--set` values and then calling
parse again.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
tonistiigi committed Dec 16, 2024
1 parent 85acd30 commit 9a9dd4e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util/buildflags/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
func ParseCacheEntry(in []string) ([]*controllerapi.CacheOptionsEntry, error) {
outs := make([]*controllerapi.CacheOptionsEntry, 0, len(in))
for _, in := range in {
if in == "" {
continue
}
fields, err := csvvalue.Fields(in, nil)
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions util/buildflags/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func ParseExports(inp []string) ([]*controllerapi.ExportEntry, error) {
return nil, nil
}
for _, s := range inp {
if s == "" {
continue
}
fields, err := csvvalue.Fields(s, nil)
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions util/buildflags/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
func ParseSecretSpecs(sl []string) ([]*controllerapi.Secret, error) {
fs := make([]*controllerapi.Secret, 0, len(sl))
for _, v := range sl {
if v == "" {
continue
}
s, err := parseSecret(v)
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions util/buildflags/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ func ParseSSHSpecs(sl []string) ([]*controllerapi.SSH, error) {
}

for _, s := range sl {
if s == "" {
continue
}
parts := strings.SplitN(s, "=", 2)
out := controllerapi.SSH{
ID: parts[0],
Expand Down

0 comments on commit 9a9dd4e

Please sign in to comment.