File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,22 @@ def image_build_config_from_args(args) -> ImageBuildConfiguration:
142142 # Get agent_tools_version for agent builds (from --agent-tools-version arg)
143143 agent_tools_version = getattr (args , "agent_tools_version" , None )
144144
145- if version is None :
145+ # Validate version requirements
146+ if image == "agent" :
147+ # Agent builds: version can be "all", "current", or explicit version (requires agent_tools_version)
148+ if version is None :
149+ raise ValueError (
150+ "Agent build requires --version. Use one of:\n "
151+ " --version all (for all agents in release.json)\n "
152+ " --version current (for currently used agents)\n "
153+ " --version <ver> --agent-tools-version <tools_ver> (for specific agent)"
154+ )
155+ is_special_version = version in ("all" , "current" )
156+ if not is_special_version and agent_tools_version is None :
157+ raise ValueError (
158+ f"For agent builds with explicit version '{ version } ', --agent-tools-version must also be provided."
159+ )
160+ elif version is None :
146161 raise ValueError (f"Version cannot be empty for { image } ." )
147162
148163 return ImageBuildConfiguration (
You can’t perform that action at this time.
0 commit comments