Skip to content

fix: enhance multi-resource editing in tctl edit#58878

Merged
tigrato merged 2 commits intomasterfrom
tigrato/tctleditmulti
Sep 8, 2025
Merged

fix: enhance multi-resource editing in tctl edit#58878
tigrato merged 2 commits intomasterfrom
tigrato/tctleditmulti

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Sep 8, 2025

This PR enhances tctl edit command to support multiple resources such as when editing all roles.

tctl edit roles

Now, all updated roles are reflected into the backend and not only the first one.

Changelog: Support multiple resource editing in tctl edit when editing collections

Fixes #38531

This PR enhances tctl edit command to support multiple resources such as
when editing all roles.

`tctl edit roles`

Now, all updated roles are reflected into the backend and not only the
first one.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
@tigrato tigrato force-pushed the tigrato/tctleditmulti branch from 823d3fc to 5523632 Compare September 8, 2025 18:27
}

key := func(r services.UnknownResource) string {
return fmt.Sprintf("%s/%s", r.Kind, r.GetName())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't we have a func in the backend package for this? (Instead of using sprintf)

Copy link
Copy Markdown
Contributor Author

@tigrato tigrato Sep 8, 2025

Choose a reason for hiding this comment

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

it’s not specifically meant for the backend since the data doesn’t really depend on that. In fact, it should only support a single Kind - from what I remember all collections only support a single kind. I left it as is just in case someone starts using multiple kinds and the names collide

@tigrato tigrato added this pull request to the merge queue Sep 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 8, 2025
@tigrato tigrato added this pull request to the merge queue Sep 8, 2025
Merged via the queue into master with commit 8736ad4 Sep 8, 2025
42 checks passed
@tigrato tigrato deleted the tigrato/tctleditmulti branch September 8, 2025 22:27
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@tigrato See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Create PR
branch/v18 Create PR

mmcallister pushed a commit that referenced this pull request Sep 22, 2025
* fix: enhance multi-resource editing in tctl edit

This PR enhances tctl edit command to support multiple resources such as
when editing all roles.

`tctl edit roles`

Now, all updated roles are reflected into the backend and not only the
first one.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* add multi int tests

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tctl edit <resource_kind> only applies the first resource in the list

3 participants