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

[v15] Reduce exposure of lib/cloud/gcp #41708

Merged
merged 1 commit into from
May 17, 2024

Conversation

rosstimothy
Copy link
Contributor

Backport #41678 to branch/v15

@rosstimothy rosstimothy added backport no-changelog Indicates that a PR does not require a changelog entry labels May 17, 2024
* Move imds related code into their own packages

Separating imds from cloud vm, kubernetes, etc. prevents the
dependency tree expanding to include extra cloud related things
for callers that only require an imds client.

* Move cloud constructors for types.KubeCluster out of lib/services

lib/services is meant to be a relatively dependency free package
that provides basic interfaces and functions for dealing with
types. NewKubeClusterFromGCPGKE, NewKubeClusterFromAWSEKS, NewKubeClusterFromAzureAKS
caused a slew of cloud related dependencies to be imported in
lib/services which increases binary sizes of client tools.

They have all been moved into lib/srv/discovery/common since
they were only consumed by other code in lib/srv/discovery.

* Decouple servicecfg and lib/auth/keystore

This was the last remaining way for lib/cloud/gcp to slip
into client tools that aren't importing lib/auth directly.

```
goda tree "reach(github.com/gravitational/teleport/tool/tctl...:all, cloud.google.com/go/compute/apiv1)"
├ github.com/gravitational/teleport/tool/tctl
    └ github.com/gravitational/teleport/tool/tctl/common
      ├ github.com/gravitational/teleport/lib/config
        ├ github.com/gravitational/teleport/lib/pam
          └ github.com/gravitational/teleport/lib/service/servicecfg
            └ github.com/gravitational/teleport/lib/auth/keystore
              └ github.com/gravitational/teleport/lib/cloud
                └ github.com/gravitational/teleport/lib/cloud/gcp
                  └ cloud.google.com/go/compute/apiv1
        └ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/tool/tctl/common/accessmonitoring
        └ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/tool/tctl/common/loginrule
        └ github.com/gravitational/teleport/lib/service/servicecfg ~
      ├ github.com/gravitational/teleport/tool/tctl/sso/configure
        ├ github.com/gravitational/teleport/lib/service/servicecfg ~
        └ github.com/gravitational/teleport/tool/tctl/sso/tester
          └ github.com/gravitational/teleport/lib/service/servicecfg ~
      └ github.com/gravitational/teleport/tool/tctl/sso/tester ~
```

* fix lints

* tidy integrations/event-handler

* fix license

* fix: only populate cloud clients if aws kms configured
@rosstimothy rosstimothy marked this pull request as ready for review May 17, 2024 14:47
@github-actions github-actions bot added database-access Database access related issues and PRs discovery machine-id size/md tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels May 17, 2024
@rosstimothy rosstimothy added this pull request to the merge queue May 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 17, 2024
@rosstimothy rosstimothy added this pull request to the merge queue May 17, 2024
Merged via the queue into branch/v15 with commit f876d16 May 17, 2024
35 checks passed
@rosstimothy rosstimothy deleted the tross/backport-41678/v15 branch May 17, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport database-access Database access related issues and PRs discovery machine-id no-changelog Indicates that a PR does not require a changelog entry size/md tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants