Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tctl resource commands for AutoUpdateConfig and AutoUpdateVersion #46771

Merged
merged 5 commits into from
Sep 21, 2024

Conversation

vapopov
Copy link
Contributor

@vapopov vapopov commented Sep 19, 2024

In this PR added tctl resource commands for receiving, editing, updating and deleting auto update resources (config and version)

@vapopov vapopov added the no-changelog Indicates that a PR does not require a changelog entry label Sep 19, 2024
@github-actions github-actions bot added size/md tctl tctl - Teleport admin tool labels Sep 19, 2024
Comment on lines 3072 to 3073
serviceClient := autoupdatev1pb.NewAutoUpdateServiceClient(client.GetConnection())
config, err := serviceClient.GetAutoUpdateConfig(ctx, &autoupdatev1pb.GetAutoUpdateConfigRequest{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
serviceClient := autoupdatev1pb.NewAutoUpdateServiceClient(client.GetConnection())
config, err := serviceClient.GetAutoUpdateConfig(ctx, &autoupdatev1pb.GetAutoUpdateConfigRequest{})
config, err := client.GetAutoUpdateConfig(ctx)

Comment on lines 3079 to 3080
serviceClient := autoupdatev1pb.NewAutoUpdateServiceClient(client.GetConnection())
version, err := serviceClient.GetAutoUpdateVersion(ctx, &autoupdatev1pb.GetAutoUpdateVersionRequest{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
serviceClient := autoupdatev1pb.NewAutoUpdateServiceClient(client.GetConnection())
version, err := serviceClient.GetAutoUpdateVersion(ctx, &autoupdatev1pb.GetAutoUpdateVersionRequest{})
version, err := client.GetAutoUpdateVersion(ctx)

return trace.Wrap(err)
}

serviceClient := autoupdatev1pb.NewAutoUpdateServiceClient(client.GetConnection())
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the api.Client implement Create/Update/Upsert like it does Get so that users don't need to construct the additional client manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is necessary, since from proxy side we going to read-only these resources

Copy link
Contributor

Choose a reason for hiding this comment

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

The RPCs are exposed via Auth though and any user that has permissions to create/update/get the resource kinds will be able to interact with them via the API client.

@flyinghermit flyinghermit removed their request for review September 19, 2024 17:53
@vapopov vapopov added this pull request to the merge queue Sep 21, 2024
Merged via the queue into master with commit 20cc81e Sep 21, 2024
40 checks passed
@vapopov vapopov deleted the vapopov/auto-update-resource-command branch September 21, 2024 06:54
@public-teleport-github-review-bot

@vapopov See the table below for backport results.

Branch Result
branch/v14 Failed
branch/v15 Failed
branch/v16 Failed

vapopov added a commit that referenced this pull request Sep 21, 2024
…#46771)

* Add autoupdate command for resource

* Reuse client methods

* Implement all exposed auto update methods for service client

* Fix linter
vapopov added a commit that referenced this pull request Sep 21, 2024
…#46771)

* Add autoupdate command for resource

* Reuse client methods

* Implement all exposed auto update methods for service client

* Fix linter
vapopov added a commit that referenced this pull request Sep 21, 2024
…#46771)

* Add autoupdate command for resource

* Reuse client methods

* Implement all exposed auto update methods for service client

* Fix linter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v14 backport/branch/v15 backport/branch/v16 no-changelog Indicates that a PR does not require a changelog entry size/md tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants