Skip to content

Conversation

@WVerlaek
Copy link
Member

Description

The --docker-build-options flag used StringToString which parses values as comma-separated key=value pairs. This breaks Docker buildx cache options that contain commas in their values (e.g., cache-to=type=gha,mode=max).

Changed to StringArray flag type so each repeated flag is a complete option without comma-based splitting.

Before:

leeway build --docker-build-options=cache-to=type=gha,mode=max
# Parsed as: --cache-to type=gha AND --mode max (broken)

After:

leeway build --docker-build-options=cache-to=type=gha,mode=max
# Parsed as: --cache-to=type=gha,mode=max (correct)

Related Issue(s)

Fixes the docker-build-options comma parsing issue.

How to test

# Build leeway
go build .

# Verify flag type in help
./leeway build --help | grep docker-build-options
# Should show: --docker-build-options stringArray

# Run tests
go test -v -run TestDockerBuildOptions ./pkg/leeway/

Change flag type from StringToString to StringArray to prevent
comma-based splitting of option values. This allows docker buildx
cache options like cache-to=type=gha,mode=max to work correctly.

Co-authored-by: Ona <no-reply@ona.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants