-
Notifications
You must be signed in to change notification settings - Fork 597
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
Adding mount path as env variable in container #7968
Conversation
Signed-off-by: babugeet <abhinandhbg@gmail.com>
Welcome @babugeet! It looks like this is your first PR to knative/eventing 🎉 |
Hi @babugeet. Thanks for your PR. I'm waiting for a knative 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-sigs/prow repository. |
cmd/jobsink/main.go
Outdated
job.Spec.Template.Spec.Containers[i].Env = append(job.Spec.Template.Spec.Containers[i].Env, corev1.EnvVar{ | ||
Name: "K_EVENT_PATH", | ||
Value: "/etc/jobsink-event", | ||
}) |
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.
The value you are using here isn't guaranteed to be correct. If you look at the logic above, a different volume mount may be chosen (which could have a different mount path)
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.
@Cali0707 : i have updated the logic,
If the Volume mount already exists, the code is taking the volume mount path from the job
If the Volume mount is not there, the code is taking the defined mount path
Signed-off-by: "babugeet <abhinandhbg@gmail.com>"
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.
/lgtm
Thanks @babugeet !
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: babugeet, Cali0707 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7968 +/- ##
==========================================
- Coverage 67.76% 67.73% -0.03%
==========================================
Files 354 354
Lines 16505 16512 +7
==========================================
Hits 11184 11184
- Misses 4632 4639 +7
Partials 689 689 ☔ View full report in Codecov by Sentry. |
Thanks @babugeet for this! would you mind updating the documentation page to mention this new feature too ? https://github.com/knative/docs/blob/main/docs/eventing/sinks/job-sink.md |
job.Spec.Template.Spec.Containers[i].Env = append(job.Spec.Template.Spec.Containers[i].Env, corev1.EnvVar{ | ||
Name: "K_EVENT_PATH", | ||
Value: mountPathName, | ||
}) |
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.
This is an edge case but we need to check if the env variable is already defined or not 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.
Actually it was not mentioned, when existing code was checked
Sure. Will raise a new PR for it. Can you pls share any similar sample release note PR, if you have handy |
@Cali0707 can you pls help me to get a sample relase not PR |
@babugeet the original docs for this feature comes from: knative/docs#6005 |
Signed-off-by: babugeet abhinandhbg@gmail.com
Fixes #
#7963
Proposed Changes
Adding the mount path as Environment variable for container of pod spawned by the Job