Skip to content

Fix: Add --container-runtime flag to run-controllers command#82

Merged
danegsta merged 2 commits intomainfrom
copilot/fix-dcp-timeout-issue
Feb 14, 2026
Merged

Fix: Add --container-runtime flag to run-controllers command#82
danegsta merged 2 commits intomainfrom
copilot/fix-dcp-timeout-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

start-apiserver forwards --container-runtime to the run-controllers subprocess, but run-controllers wasn't registered to accept this flag, causing immediate crash with exit code 1.

Changes

  • Added container_flags.EnsureRuntimeFlag() to run-controllers command registration in internal/dcpctrl/commands/run_controllers.go

The flag value is already consumed by runtimes.FindAvailableContainerRuntime() on line 123, so this completes the plumbing.

func NewRunControllersCommand(log logr.Logger) *cobra.Command {
    // ...
    kubeconfig.EnsureKubeconfigFlag(runControllersCmd.Flags())
    kubeconfig.EnsureKubeconfigPortFlag(runControllersCmd.Flags())
    
    container_flags.EnsureRuntimeFlag(runControllersCmd.Flags())  // Added
    
    cmds.AddMonitorFlags(runControllersCmd)
    // ...
}

This mirrors the pattern used in start-apiserver where flags passed via invocationFlags must be accepted by the receiving command.

Original prompt

This section details on the original issue you should resolve

<issue_title>DCP Timeout Issue in Aspire - Related to --container-runtime Argument in 'run-controllers' SubCommand</issue_title>
<issue_description>## Summary

When Aspire passes --container-runtime podman to dcp start-apiserver, DCP's API server starts successfully but then forwards the --container-runtime flag to the dcp run-controllers subprocess. The run-controllers subcommand does not accept this flag and crashes immediately with exit code 1. Because the controllers never start, DCP Service objects are never reconciled, and Aspire times out waiting for effective addresses.

The Full Writeup

See the full writeup from an issue on the dotnet/aspire repo prior to landing here in a microsoft/dcp github repo.

dotnet/aspire#12241 (comment)</issue_description>

<agent_instructions>The —container-runtime flag was previously defined on the root command of dcpctrl, but the sub-commands of dcpctrl have been unified into the dcp binary. This is causing the flag to be invalid in the run-controllers sub-command. We need to make sure the command is implemented using the appropriate API in that command. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

This fixes the issue where start-apiserver was forwarding the
--container-runtime flag to run-controllers, which didn't accept it,
causing the controllers subprocess to crash with exit code 1.

Co-authored-by: danegsta <50252651+danegsta@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix DCP timeout issue related to container-runtime flag Fix: Add --container-runtime flag to run-controllers command Feb 14, 2026
Copilot AI requested a review from danegsta February 14, 2026 07:19
@danegsta danegsta marked this pull request as ready for review February 14, 2026 07:38
Copilot AI review requested due to automatic review settings February 14, 2026 07:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a crash when dcp start-apiserver forwards --container-runtime to the dcp run-controllers subprocess by registering the flag on the receiving command.

Changes:

  • Register --container-runtime on the run-controllers Cobra command via container_flags.EnsureRuntimeFlag().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danegsta
Copy link
Member

/backport to release/0.22

@github-actions
Copy link

Started backporting to release/0.22: https://github.com/microsoft/dcp/actions/runs/22020113895

@github-actions
Copy link

@danegsta backport PR couldn't be created automatically, please create the backport PR manually!

Open backport PR into release/0.22.

@danegsta danegsta merged commit 2362a8d into main Feb 14, 2026
17 checks passed
@danegsta danegsta deleted the copilot/fix-dcp-timeout-issue branch February 14, 2026 22:29
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.

DCP Timeout Issue in Aspire - Related to --container-runtime Argument in 'run-controllers' SubCommand

4 participants