Discover EKS: allow custom labels for Kube Server#49420
Discover EKS: allow custom labels for Kube Server#49420marcoandredinis merged 1 commit intomasterfrom
Conversation
f2be289 to
55a8e42
Compare
|
@doggydogworld @timothyb89 Can you please take a look when you get a chance? |
r0mant
left a comment
There was a problem hiding this comment.
lgtm with a question/suggestion
| maps.Copy(labels, extraLabels) | ||
| maps.Copy(labels, kubeCluster.GetStaticLabels()) |
There was a problem hiding this comment.
I assume "extraLabels" are basically user-provided labels and "static labels" are labels from EKS tags, correct? In that case, should user-defined labels take precedence, i.e. should we swap the order of these two copies?
There was a problem hiding this comment.
I assume "extraLabels" are basically user-provided labels and "static labels" are labels from EKS tags, correct?
Yes 👍
In that case, should user-defined labels take precedence, i.e. should we swap the order of these two copies?
My assumption was that we want static/cloud labels to always be applied after the custom ones, preventing any override of values such as the AWS Account ID/Region.
I looked into how Teleport Server + ServerInfo labels and it seems that its order is:
- Cloud Labels
- ServerInfo Labels
- Static Labels
teleport/lib/srv/regular/sshserver.go
Lines 1026 to 1040 in 4846ef4
Static labels end up being the last to be applied.
Having said that, I'm ok changing the order 👍
379aa3f to
9178e6c
Compare
| "priority": "yes", | ||
| "region": "us-east-1", | ||
| } | ||
| resourceID := uuid.NewString() |
There was a problem hiding this comment.
Is it necessary to use UUID generation for testing?
There was a problem hiding this comment.
We can use whatever value here 👍
Is it bad to use it? I was trying to use a real value here instead of a static one.
| return nil, trace.Wrap(err) | ||
| } | ||
|
|
||
| extraLabels := make(map[string]string, len(req.ExtraLabels)) |
There was a problem hiding this comment.
Can't we use maps.Clone instead? Since maps.Copy is used I think it might make it more consistent.
There was a problem hiding this comment.
req.ExtraLabels format is not a map.
It's a []ui.Label where ui.Label is a struct with Name, Value.
So, I don't think we can use maps.Clone here
doggydogworld
left a comment
There was a problem hiding this comment.
Just some nits otherwise lgtm.
This PR allows the UI to send extra labels for setting up the EKS cluster.
9178e6c to
1c601d1
Compare
|
@marcoandredinis See the table below for backport results.
|
This PR allows the UI to send extra labels for setting up the EKS cluster.
This PR allows the UI to send extra labels for setting up the EKS cluster.
This PR allows the UI to send extra labels for setting up the EKS cluster.
This PR allows the UI to send extra labels for setting up the EKS cluster.
This PR allows the UI to send extra labels for setting up the EKS cluster.
Related #46976
Demo