Repository navigation
fix(scale): reject empty service name in --scale flag - #14481
Open
arsalanyavari wants to merge 1 commit into
Open
arsalanyavari wants to merge 1 commit into
arsalanyavari wants to merge 1 commit into
Conversation
Signed-off-by: arsalanyavari <arya48.yavari79@gmail.com>
arsalanyavari
requested review from
glours and
ndeloof
and
a balanced review from Copilot
November 10, 2026 00:51
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Fixes
--scaleflag validation indocker compose up/createwhen an empty service name is passed (e.g.--scale "=2").Currently,
applyScaleOptsonly checks!ok || val == "", missing the empty service name check (name == ""). As a result, passing an empty service name passes flag validation and fails later during service lookup withno such service: : not found.This change adds
name == ""to the validation check inapplyScaleOpts, aligning it withcmd/compose/scale.goto reject the syntax upfront with a clear CLI error:invalid --scale option "=2". Should be SERVICE=NUM.Related issue
Fixes #14480
Changes made
name == ""check toapplyScaleOptsincmd/compose/create.go(consistent withcmd/compose/scale.go)."=2") to existingTestApplyScaleOptincmd/compose/up_test.go.Testing done
Unit tests pass:
make testE2E tests pass:
make e2e-composeormake e2e-compose-standaloneLinting passes:
make lintCode formatted:
make fmtManually tested (describe):
--scale "web=2").AI tool used (if applicable)
AI Tool:
Additional context
(not mandatory) A picture of a cute animal, if possible in relation to what you did