Skip to content

update discovery labels#28917

Merged
GavinFrazar merged 8 commits intomasterfrom
gavinfrazar/move-discovery-added-labels-into-constants
Jul 18, 2023
Merged

update discovery labels#28917
GavinFrazar merged 8 commits intomasterfrom
gavinfrazar/move-discovery-added-labels-into-constants

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

@GavinFrazar GavinFrazar commented Jul 10, 2023

This PR fixes:

It also moves all the labels created by discovery services into api/constants.go.

This is to make these labels visible and accessible elsewhere in the code, and hopefully to prevent further redundant labels from being created.

For instance, we are adding the label teleport.dev/aws-region for discovered EC2 instances, but for kube clusters and databases we are adding the label region for the AWS region they are discovered in. Likewise for AWS account ID. I think keeping these labels all in the constants file will make it easier to keep track of them, reference them, and reuse them in code.

The changes relevant to #28803 are:

  1. adding new labels for GKE/AKS: "TeleportKubernetesName"
  2. update docs to reference these new labels
  3. update setDBName and setKubeName in lib/services to be cloud-specific and pass through a common setResourceName helper func that takes the override label to check for as an arg.

* move all labels into api/types/constants.go
* add name override labels for GKE and AKS that are allowed tag names in
  GCP and Azure
Comment thread lib/services/kubernetes.go Outdated
Comment thread api/types/constants.go
Copy link
Copy Markdown
Contributor

@ptgott ptgott left a comment

Choose a reason for hiding this comment

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

Good to go from a docs standpoint

@GavinFrazar GavinFrazar requested a review from tigrato July 14, 2023 22:33
@GavinFrazar GavinFrazar added this pull request to the merge queue Jul 18, 2023
Merged via the queue into master with commit 5c12e45 Jul 18, 2023
@GavinFrazar GavinFrazar deleted the gavinfrazar/move-discovery-added-labels-into-constants branch July 18, 2023 18:35
@public-teleport-github-review-bot
Copy link
Copy Markdown

@GavinFrazar See the table below for backport results.

Branch Result
branch/v12 Failed
branch/v13 Create PR

GavinFrazar added a commit that referenced this pull request Jul 18, 2023
Backport #28917 to branch/v12

* update discovery labels and name overrides
* move all labels into api/types/constants.go
* add name override labels for GKE and AKS that are allowed tag names in
  GCP and Azure
* support legacy and cloud-agnostic name override labels for AWS
* add tests for creating kube clusters from cloud kube clusters
github-merge-queue Bot pushed a commit that referenced this pull request Jul 19, 2023
Backport #28917 to branch/v12

* update discovery labels and name overrides
* move all labels into api/types/constants.go
* add name override labels for GKE and AKS that are allowed tag names in
  GCP and Azure
* support legacy and cloud-agnostic name override labels for AWS
* add tests for creating kube clusters from cloud kube clusters
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.

5 participants