Skip to content

[deckhouse-cli] Update the logic for creating the cluster-configuration secret - #514

Merged
ldmonster merged 1 commit into
mainfrom
fix/edit-static-cluster-configuration
Oct 20, 2026
Merged

ldmonster merged 1 commit into
mainfrom
fix/edit-static-cluster-configuration

Conversation

@VaLosev

@VaLosev VaLosev commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Currently, the deckhouse-controller edit static-cluster-configuration command allows for the creation of a secret if it does not already exist.
However, the d8-cli tool only supports editing an existing secret; if the secret is missing, the command returns an error:

# d8 p edit static-cluster-configuration
Error: Error updating secret: Error fetching secret: secrets "d8-static-cluster-configuration" not found

This PR adds logic to create the secret if it is absent from the cluster when the d8 p edit static-cluster-configuration command is executed.

image

P.S. A check is included to ensure that the user has actually made changes.
P.P.S. Explicit argument passing has been added to provider-cluster-configuration.go and cluster-configuration.go because a new parameter, "createOpts *CreateOptions", has been introduced in BaseEditConfigCMD.

The current logic for creating the secret is as follows:

Secret dhctl / deckhouse-controller d8 (current)
d8-static-cluster-configuration Creates if NotFound Creates if NotFound
d8-cluster-configuration Creates if NotFound (OnAbsentFor → nil) Does not create (returns error)
d8-provider-cluster-configuration Creates if the cloud-provider-<name> ModuleConfig is not enabled (RejectLegacyProviderEditOnMcFlow) Does not create (returns error)

@VaLosev VaLosev self-assigned this Oct 18, 2026
Signed-off-by: Losev Valery <valery.losev@flant.com>
@VaLosev
VaLosev force-pushed the fix/edit-static-cluster-configuration branch from 3e907c5 to 7c20d46 Compare October 18, 2026 07:36
@VaLosev
VaLosev marked this pull request as ready for review October 20, 2026 09:39
@VaLosev
VaLosev requested a review from ldmonster as a code owner October 20, 2026 09:39
@ldmonster
ldmonster merged commit 68c93b3 into main Oct 20, 2026
5 checks passed
@ldmonster
ldmonster deleted the fix/edit-static-cluster-configuration branch October 20, 2026 09:41
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.

2 participants