Skip to content

fix(k8s): devops k8s apply runs for real under its own --dry-run #2312

Description

@dan-petty

Problem Statement

In src/devops_cli/commands/k8s/cluster_context.py:182, devops k8s apply declares --dry-run.
The function does not call set_dry_run(dry_run).
Because the function does not set dry-run state, is_dry_run() evaluates to False.
Execution continues to runtime._run_cmd(cmd, check=True) at line 231.
The command executes kubectl apply -f <path> --dry-run=client against the Kubernetes cluster.
Under #412 and #986, contacting the remote cluster under --dry-run is external communication.

Proposed Solution

Check dry_run or is_dry_run() and render the preview before the subprocess runner.
Use render_dry_run_result(command="devops k8s apply", ...) to show the planned action.
Ensure the command starts zero child processes.

Source: #986

Activity

  1. added
    source/agent
    type/bug
    on Oct 26, 2026
  2. dan-petty commented on Oct 26, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/bug. The candidate describes a defect where the --dry-run flag does not work correctly in the k8s apply command.
    • Priority: P2-Medium. This is a functional bug that affects dry-run behavior but does not break core functionality.
    • Value: Medium. Fixes incorrect behavior of a key command and improves user experience with dry-run previews.
    • Effort: Medium. Requires modifying one function to check dry-run state and add preview rendering, but does not require major architectural changes.
    • Related: feat(k8s): k8s cluster read and access commands list their requests in a dry run and make none #2238, which asks for a different change. Both items relate to k8s commands and dry-run behavior, but the candidate fixes a specific bug in apply command while the related item is about adding dry-run support to multiple k8s read/access commands.
  3. added a commit that references this issue on Oct 26, 2026
    16e26b0
  4. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/bug

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions