Skip to content

GenericCLI Fix: Commands set to 'false' in OnlyCmds are now correctly disabled#193

Merged
Gerrit91 merged 1 commit intomasterfrom
192-genericcli-onlycmds-check-verifies-key-presence-instead-of-its-boolean-value
Oct 28, 2025
Merged

GenericCLI Fix: Commands set to 'false' in OnlyCmds are now correctly disabled#193
Gerrit91 merged 1 commit intomasterfrom
192-genericcli-onlycmds-check-verifies-key-presence-instead-of-its-boolean-value

Conversation

@izvyk
Copy link
Copy Markdown
Contributor

@izvyk izvyk commented Oct 28, 2025

Description

Closes #192

@izvyk izvyk self-assigned this Oct 28, 2025
@izvyk izvyk added the patch Just bug fixes and chores, causes the release drafter to create a new patch version label Oct 28, 2025
@izvyk izvyk requested a review from a team as a code owner October 28, 2025 09:28
@Gerrit91
Copy link
Copy Markdown
Contributor

Did you check all the dependents that it does not break anything?

@izvyk
Copy link
Copy Markdown
Contributor Author

izvyk commented Oct 28, 2025

Yes, I've checked the dependents in metal-stack and metal-stack-cloud.

They all utilize the OnlyCmds helper function, like this:

// ...
OnlyCmds: genericcli.OnlyCmds(
    genericcli.ListCmd,
    genericcli.DescribeCmd,
),
// ...

This helper explicitly sets the map values to true.
From genericcli/cmds.go:

func OnlyCmds(cmds ...DefaultCmd) map[DefaultCmd]bool {
	res := map[DefaultCmd]bool{}

	for _, c := range cmds {
		res[c] = true
	}

	return res
}

Since all dependents already rely on this function to explicitly set true, this PR shouldn't cause any regressions.

@Gerrit91 Gerrit91 merged commit d4d668f into master Oct 28, 2025
2 checks passed
@Gerrit91 Gerrit91 deleted the 192-genericcli-onlycmds-check-verifies-key-presence-instead-of-its-boolean-value branch October 28, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Just bug fixes and chores, causes the release drafter to create a new patch version

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

GenericCLI OnlyCmds: Check verifies key presence instead of its boolean value

2 participants