diff --git a/cmd/platforms.go b/cmd/platforms.go index 45724d752dc..3a612c7fa00 100644 --- a/cmd/platforms.go +++ b/cmd/platforms.go @@ -13,9 +13,9 @@ func (i *Input) newPlatforms() map[string]string { } for _, p := range i.platforms { - pParts := strings.Split(p, "=") - if len(pParts) == 2 { - platforms[strings.ToLower(pParts[0])] = pParts[1] + separator := strings.LastIndex(p, "=") + if separator > 0 && separator < len(p)-1 { + platforms[strings.ToLower(p[:separator])] = p[separator+1:] } } return platforms diff --git a/cmd/root_test.go b/cmd/root_test.go index ab6f5f221a4..6820bd0c713 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -36,6 +36,14 @@ func TestListOptions(t *testing.T) { assert.NoError(t, err) } +func TestNewPlatformsSupportsEqualsInRunnerLabels(t *testing.T) { + platforms := (&Input{ + platforms: []string{"runner-size=large=node:16-bullseye-slim"}, + }).newPlatforms() + + assert.Equal(t, "node:16-bullseye-slim", platforms["runner-size=large"]) +} + func TestRun(t *testing.T) { rootCmd := createRootCommand(context.Background(), &Input{}, "") err := newRunCommand(context.Background(), &Input{