-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Common flag env metadata whitelist #2921
Common flag env metadata whitelist #2921
Conversation
Hi @Colstuwjx. Thanks for your PR. I'm waiting for a google member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -22,7 +22,6 @@ import ( | |||
containerlibcontainer "github.com/google/cadvisor/container/libcontainer" | |||
"github.com/google/cadvisor/fs" | |||
info "github.com/google/cadvisor/info/v1" | |||
"github.com/mesos/mesos-go/api/v1/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found CI error after removed this line:
Error: vet: internal/container/mesos/handler_test.go:31:21: undeclared name: mesos
Error: make: *** [Makefile:71: vet] Error 2
Error: Process completed with exit code 2.
But I have no idea about the reason. Does it only use by our tests?
/cc @dashpole @bobbypage It seems no meaningful message to debug :(
|
This is the actual problem:
As there's no output, this could be early at startup? |
I found an issue that the integration tests are still using the deprecated flag BTW, the integration tests should output the logs if there are errors, I'll try to propose another PR for fixing it. |
This looks good overall. One thing I'm a bit worried about is removing the existing |
What do you mean? The integration test-related changes in this PR just changed the flag
I've been considered this path, it's ok to me, I'll add these deprecated flags back soon. |
Ping @bobbypage I've been added the deprecated flags back! Please take a review :) |
/retest |
container/factory.go
Outdated
@@ -27,7 +27,7 @@ import ( | |||
|
|||
type ContainerHandlerFactory interface { | |||
// Create a new ContainerHandler using this factory. CanHandleAndAccept() must have returned true. | |||
NewContainerHandler(name string, inHostNamespace bool) (c ContainerHandler, err error) | |||
NewContainerHandler(name string, metadataEnvs []string, inHostNamespace bool) (c ContainerHandler, err error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename metadataEnvs
to metadataEnvAllowList
or something like that? From the name, it's not clear that we are only going envs in metadataEnvs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
metrics/prometheus.go
Outdated
@@ -1856,6 +1856,9 @@ func BaseContainerLabels(whiteList []string) func(container *info.ContainerInfo) | |||
set[ContainerLabelPrefix+k] = v | |||
} | |||
} | |||
for k, v := range container.Spec.Envs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed? It seems like this is change in behavior of adding env to Prometheus labels. I'm not sure how this change is relevant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this is change in behavior of adding env to Prometheus labels.
Yes. You could get to know the background from PR 2330 #issue-comment . PR #2330 is original to add container whitelisted envs to prom labels, and @dashpole think it'd better to unify the flags, so I proposed this PR righ now!
If you think it'd better to separate these changes, and make the env changes an individual PR, I'm ok with it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the explanation.
Thanks for updating @Colstuwjx. Overall LGTM, minor nit about naming and also question around why we need to change the labels provided in Prometheus (which seems unrelated to refactoring done here). Thanks! |
Please rebase to fix conflicts and update as per #2921 (comment). Thanks! |
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
44619ec
to
f448e00
Compare
Signed-off-by: colstuwjx <colstuwjx@gmail.com>
Hi @bobbypage Now I revised the PR changes according to your suggestions! Please take a look again. |
LGTM, thanks! |
/retest Waiting for |
The error logs shown below:
I'm not sure if it's related to this PR. |
I think CI was failing due to lack of go1.17 upgrade (since the pull-cadvisor-e2e runs in prow with k/k). It should be fixed now after #2929 |
/retest |
Thanks, LGTM! |
I'm not sure why this PR wasn't been squashed, maybe we could let bot merge the PR, just like k8s projects did? |
This is a follow-up PR for #2330, after I proposed that PR, I've seen a contributor submitted PR #2857 in order to introduce containerd whitelist env flag.
Now I merged the containerd and docker env whitelist flags, and just a simple common flag:
env_metadata_whitelist
, the other two are deprecated while this PR merged.BTW, I'm not sure about the state of the Mesos container, just keep the same interface signature as well :(