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

Add MIRRORD_IMPERSONATED_CONTAINER_NAME var #182

Merged
merged 2 commits into from
Jul 3, 2022
Merged

Add MIRRORD_IMPERSONATED_CONTAINER_NAME var #182

merged 2 commits into from
Jul 3, 2022

Conversation

camerondurham
Copy link
Contributor

Details

This CR adds an optional MIRRORD_IMPERSONATED_CONTAINER_NAME to specify container name within pod for #100.

This doesn't implement ignoring linkerd/envoy pods yet. Can iterate on this draft based on feedback. I suppose the best way to ignore containers like this is to filter out common container names for linkerd/envoy within a pod?

A couple things that are missing, I'll convert to draft if these are blockers.

  1. add ability to set this variable in VSCode extension
  2. Ignore linkerd/envoy container names

Testing

These are low effort tests and not really best practice since they won't be in CI. I can try this weekend adding a mock failure run to sanity.rs.

  1. local GH action run manually setting MIRRORD_IMPERSONATED_CONTAINER_NAME=test (link)
  2. local GH action run not setting MIRRORD_IMPERSONATED_CONTAINER_NAME (link)
  3. local GH action sanity check failed when setting MIRRORD_IMPERSONATED_CONTAINER_NAME=testgarbage (link)

Example failure:

https://github.com/camerondurham/mirrord/runs/7167505799?check_suite_focus=true#step:15:76

stderr 7282: thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: no container named testgarbage found in namespace=default, pod=http-echo-gw7u7b2-59cdf9cf46-pfqwp', mirrord-layer/src/pod_api.rs:49:18

Thanks!

Copy link
Member

@aviramha aviramha left a comment

Choose a reason for hiding this comment

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

Awesome! This looks great. I left two comments, one I consider a nitpick and the other is UX but small so would be required to get merged.

mirrord-layer/src/pod_api.rs Outdated Show resolved Hide resolved
mirrord-layer/src/pod_api.rs Outdated Show resolved Hide resolved
Copy link
Member

@aviramha aviramha left a comment

Choose a reason for hiding this comment

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

Great, Thank you.

@aviramha aviramha merged commit 78a5c36 into metalbear-co:main Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants