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

override injected initContainer name #84

Merged
merged 5 commits into from
Dec 22, 2023

Conversation

kmdrn7
Copy link
Contributor

@kmdrn7 kmdrn7 commented Sep 17, 2023

Feature Request

  • ability to override injected initContainer name

Description

I have several tools that use the container name as one of the filters/selectors. With the current k8tz injection strategy that uses the bootstrap initContainer, I have encountered several issues regarding the identical container naming between the bootstrap initContainer and the k8tz controller. To ensure that the filters/selector works as expected in other tools, I would like to add a feature that allows setting a custom container name for the bootstrap initContainer

- introduce new value `injectedInitContainerName`
- add default value for `injectedInitContainerName`
- add `--container-name` to controller args
- update documentations
@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (20832c6) 67.66% compared to head (00efa8c) 67.57%.
Report is 10 commits behind head on master.

❗ Current head 00efa8c differs from pull request most recent head 1a8d92c. Consider uploading reports for the commit 1a8d92c to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
- Coverage   67.66%   67.57%   -0.09%     
==========================================
  Files           6        6              
  Lines         838      842       +4     
==========================================
+ Hits          567      569       +2     
- Misses        234      236       +2     
  Partials       37       37              
Files Coverage Δ
pkg/version/version.go 90.90% <ø> (ø)
pkg/admission/admission.go 63.59% <66.66%> (+0.03%) ⬆️
pkg/inject/inject.go 93.04% <66.66%> (-0.31%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -431,6 +431,7 @@ func TestPatchGenerator_createInitContainerPatches(t *testing.T) {
type fields struct {
Strategy InjectionStrategy
Timezone string
InitContainerName string
Copy link
Member

Choose a reason for hiding this comment

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

there should be at least one test with different InitContainerName that proves it effective

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, will update the test with different InitContainerName

Copy link
Member

Choose a reason for hiding this comment

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

any news @kmdrn7 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @yonatankahana, sorry for super late response. I have included the initContainerName field and added new test case for different initContainerName value

@yonatankahana yonatankahana added enhancement New feature or request area/injection Patch Injections area labels Sep 17, 2023
@yonatankahana yonatankahana merged commit 122f0b1 into k8tz:master Dec 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/injection Patch Injections area enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants