Skip to content

Conversation

brileyyyy
Copy link
Contributor

@brileyyyy brileyyyy commented Oct 15, 2025

Related to this issue: #137

Problem

When using d8 k edit commands and encountering errors, kubectl would suggest an incorrect command for retrying the operation:

Before:

error: moduleconfigs.deckhouse.io "console" could not be patched: ...
You can run `d8 replace -f /tmp/kubectl-edit-123.yaml` to try this update again.

After:

error: moduleconfigs.deckhouse.io "console" could not be patched: ...
You can run `d8 k replace -f /tmp/kubectl-edit-123.yaml` to try this update again.

The issue occurred because kubectl uses filepath.Base(os.Args[0]) to generate error messages, which returned "d8" instead of "d8 k".

Solution

Set os.Args[0] = "d8 k" before executing any kubectl command. This ensures that kubectl generates correct error messages with the proper command prefix.

@brileyyyy brileyyyy self-assigned this Oct 15, 2025
@brileyyyy brileyyyy marked this pull request as ready for review October 15, 2025 14:36
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.

1 participant