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

Teleterm: Add listing kube resources endpoint #46753

Merged
merged 6 commits into from
Oct 8, 2024

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Sep 19, 2024

part of #46742

easier to review by commit

Adds a new grpc endpoint and related boilerplates for listing kube resources

if confused what is the difference between the other endpoint where we list kubes, kube resources refers to kube_cluster's sub resources:

// KubernetesResourcesKinds lists the supported Kubernetes resource kinds.

This comment was marked as resolved.

lib/teleterm/api/uri/uri.go Outdated Show resolved Hide resolved
@kimlisa kimlisa added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v16 labels Sep 19, 2024
lib/teleterm/daemon/daemon.go Outdated Show resolved Hide resolved
lib/teleterm/daemon/daemon.go Outdated Show resolved Hide resolved
lib/teleterm/api/uri/uri.go Outdated Show resolved Hide resolved
@kimlisa kimlisa requested a review from gzdunek September 20, 2024 04:37
web/packages/teleterm/src/ui/uri.ts Show resolved Hide resolved
lib/teleterm/api/uri/uri.go Outdated Show resolved Hide resolved
proto/teleport/lib/teleterm/v1/service.proto Outdated Show resolved Hide resolved
proto/teleport/lib/teleterm/v1/service.proto Outdated Show resolved Hide resolved
lib/teleterm/apiserver/handler/handler_kubes.go Outdated Show resolved Hide resolved
lib/teleterm/daemon/daemon.go Outdated Show resolved Hide resolved
proto/teleport/lib/teleterm/v1/kube.proto Outdated Show resolved Hide resolved
@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch from 86815ca to 5ee774f Compare September 23, 2024 19:41
lib/web/ui/labels_test.go Outdated Show resolved Hide resolved
web/packages/teleterm/src/ui/uri.ts Outdated Show resolved Hide resolved
lib/teleterm/api/uri/uri.go Outdated Show resolved Hide resolved
@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch 5 times, most recently from 34aadea to ecc4409 Compare October 7, 2024 03:34
@kimlisa kimlisa requested a review from ravicious October 7, 2024 03:34
@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch 2 times, most recently from 724eb86 to 6251b55 Compare October 7, 2024 04:57
return generatePath(
paths.kubeResourceNamespaceLeaf,
params as any
) as string;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
) as string;
) as LeafClusterKubeResourceNamespaceUri;

params as any
) as string;
} else {
return generatePath(paths.kubeResourceNamespace, params as any) as string;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return generatePath(paths.kubeResourceNamespace, params as any) as string;
return generatePath(paths.kubeResourceNamespace, params as any) as KubeResourceNamespaceUri;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

think you meant RootClusterKubeResourceNamespaceUri, so i went with that

@@ -189,6 +206,12 @@ func (r ResourceURI) AppendKube(name string) ResourceURI {
return r
}

// AppendKubeResourceNamespace appends kube resource namespace segment to the URI.
func (r ResourceURI) AppendKubeResourceNamespace(kubeClusterName string, kubeNamespaceName string) ResourceURI {
Copy link
Member

Choose a reason for hiding this comment

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

I think this should accept just kubeNameSpaceName string as an argument, with the intention that if you want to make a URI to a kube namespace, you'd do something like uri.NewClusterURI(profileName).AppendKube(kubeClusterName).AppendKubeNamespace(kubeNamespaceName).

AppendLeafCluster already follows a similar approach, though AppendKubeResourceNamespace does not need to handle that extra case with name == "" like AppendLeafCluster does.

return nil, trace.Wrap(err)
}

var proxyGRPCClient kubeproto.KubeServiceClient
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer needed, as in the client can just stay defined within AddMetadataToRetryableError. Maybe we could also name it kubenetesServiceClient or something along those lines? proxyGRPCClient makes it sound like it's used for more than just k8s, but it's actually heavily focused on k8s only.

@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch from 6251b55 to 21bed0c Compare October 8, 2024 17:26
@kimlisa kimlisa enabled auto-merge October 8, 2024 17:26
@r0mant
Copy link
Collaborator

r0mant commented Oct 8, 2024

/excludeflake *

@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch from 4dda04e to e4c646e Compare October 8, 2024 18:24
@kimlisa kimlisa added this pull request to the merge queue Oct 8, 2024
Merged via the queue into master with commit 354eb49 Oct 8, 2024
43 checks passed
@kimlisa kimlisa deleted the lisa/teleterm-kube-resource-endpoint branch October 8, 2024 21:02
@public-teleport-github-review-bot

@kimlisa See the table below for backport results.

Branch Result
branch/v16 Failed

kimlisa added a commit that referenced this pull request Oct 9, 2024
* Rename makeLabels into MakeUILabelsWithoutInternalPrefixes

* Teleterm: add listing kube resource endpoint

* Teleterm pb updates

* Renames, moves test, fix imports, address CRS
mvbrock pushed a commit that referenced this pull request Oct 16, 2024
* Rename makeLabels into MakeUILabelsWithoutInternalPrefixes

* Teleterm: add listing kube resource endpoint

* Teleterm pb updates

* Renames, moves test, fix imports, address CRS
github-merge-queue bot pushed a commit that referenced this pull request Oct 28, 2024
* Teleterm: Add listing kube resources endpoint (#46753)

* Rename makeLabels into MakeUILabelsWithoutInternalPrefixes

* Teleterm: add listing kube resource endpoint

* Teleterm pb updates

* Renames, moves test, fix imports, address CRS

* Straggling file from make grpc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v16 no-changelog Indicates that a PR does not require a changelog entry size/md ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants