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

e2e: Use metrics container when executing commands #1238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkowalski
Copy link
Member

This PR adds explicit -c nmstate-metrics to the command invocations that use kubectl.sh exec [...]. This should not change the current behaviour as by default we execture them in this container, however it's been noticed that the following stderr is produced

stderr: Defaulted container "nmstate-metrics" out of: nmstate-metrics, kube-rbac-proxy

so for being explict, we are defining where to execute the command.

Release note:

NONE

This PR adds explicit `-c nmstate-metrics` to the command invocations
that use `kubectl.sh exec [...]`. This should not change the current
behaviour as by default we execture them in this container, however it's
been noticed that the following stderr is produced

```
stderr: Defaulted container "nmstate-metrics" out of: nmstate-metrics, kube-rbac-proxy
```

so for being explict, we are defining where to execute the command.

Signed-off-by: Mat Kowalski <mko@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XS labels May 6, 2024
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from mkowalski. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot
Copy link
Collaborator

@mkowalski: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-nmstate-e2e-operator-k8s e8e0bfe link true /test pull-kubernetes-nmstate-e2e-operator-k8s
pull-kubernetes-nmstate-e2e-handler-k8s-future e8e0bfe link false /test pull-kubernetes-nmstate-e2e-handler-k8s-future
pull-kubernetes-nmstate-e2e-handler-k8s e8e0bfe link true /test pull-kubernetes-nmstate-e2e-handler-k8s

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. I understand the commands that are listed here.

@qinqon
Copy link
Member

qinqon commented May 7, 2024

@mkowalski looks like this is failing

ccurred failed [FAILED] Unexpected error:
    <*errors.errorString | 0xc000a27230>: 
    ./cluster/kubectl.shexec -n nmstate nmstate-metrics-68b4d6d87c-px6rg -- -c nmstate-metrics curl -s -k --header Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkJDR0hFZ3ppb0Z4NkI5TGFBSjZrZVVSWkF4RENLbFg1YUJVQlIyaUR6OWMifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNzQ2NTM0MDI4LCJpYXQiOjE3MTQ5OTgwMjgsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJtb25pdG9yaW5nIiwicG9kIjp7Im5hbWUiOiJwcm9tZXRoZXVzLWs4cy0wIiwidWlkIjoiZjRiZGQxNjItODk3ZS00NmQwLWE4ZGUtZTdiODhmMWNiOWVkIn0sInNlcnZpY2VhY2NvdW50Ijp7Im5hbWUiOiJwcm9tZXRoZXVzLWs4cyIsInVpZCI6ImFhMGE0NjYxLTIyMWItNDViMC05ZDU2LTM0ZTdkOGY0Yzk5NyJ9LCJ3YXJuYWZ0ZXIiOjE3MTUwMDE2MzV9LCJuYmYiOjE3MTQ5OTgwMjgsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptb25pdG9yaW5nOnByb21ldGhldXMtazhzIn0.PHPwPZOwgjWU0M6H910AAXgkL3hHyf2G5wFN5XdYIWXZCB419T6T-KeErx1SQVP4HVT9IJT4kr8v22JkOhI9IqVUu7awTJWsudFYIRlXXP1ZVfTCVKMMo7NeSmGdNXCbvTX1VpPZzMzLGJHYfjHjCviiAoW9ZY0OYDqcj9C_EtlFO29KRzLgj8n4NTYS5fw31tQGfEJ8_ooFkHB5gwweH6lsk11q_HNXtrHYqJsjw7yWWUiJm5ctl5qH8WUxA1mpUdUY19Sdjhz1kasl0is2598icKmD7jcUoqRCWDFhzKUbXlHug87X3RkwWzfCsrZAtuiyNEu1hkhTJ7IvRSyUAg :8089 https://127.0.0.1:8443/metrics : selecting podman as container runtime
    Defaulted container "nmstate-metrics" out of: nmstate-metrics, kube-rbac-proxy
    time="2024-05-06T12:54:23Z" level=error msg="exec failed: unable to start container process: exec: \"-c\": executable file not found in $PATH"
    command terminated with exit code 255
     exit status 255
    {

@mkowalski
Copy link
Member Author

/hold

Maybe we will not even need that. Error makes sense, I composed the command wrongly

 ./cluster/kubectl.shexec -n nmstate nmstate-metrics-68b4d6d87c-px6rg -- -c nmstate-metrics curl -s -k

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 7, 2024
@qinqon
Copy link
Member

qinqon commented May 8, 2024

/hold

Maybe we will not even need that. Error makes sense, I composed the command wrongly

 ./cluster/kubectl.shexec -n nmstate nmstate-metrics-68b4d6d87c-px6rg -- -c nmstate-metrics curl -s -k

Well this is not extra important since the default container is in the first one the list but it's true that the warning is bothering.

@mkowalski
Copy link
Member Author

It was purely for cosmetic reasons because when I parse output as a human I like to see empty stderr. I will try fixing this in a low-effort way and if I find that it's too hacky change, I will drop it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants