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 env variable to Job created by JobSink for the file path to the event #7963

Closed
Cali0707 opened this issue Jun 4, 2024 · 6 comments
Closed
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature-request triage/accepted Issues which should be fixed (post-triage)

Comments

@Cali0707
Copy link
Member

Cali0707 commented Jun 4, 2024

Problem
With the current way that a Job is created in the JobSink, there is some logic that chooses which VolumeMount to use to mount the event. As such, the path that the event is mounted at is not guaranteed to be the same for every Job created by a JobSink.

The JobSink should add an env variable K_EVENT_PATH into the container that points to the mount path of the volume which is chosen, making it easier to consume the event within the code of the job.

Here, we can inject the env variable before creating the job based on where the jobsink-event volume directory points to

job := js.Spec.Job.DeepCopy()
job.Name = jobName
if job.Labels == nil {
job.Labels = make(map[string]string, 4)
}
job.Labels[sinks.JobSinkIDLabel] = id
job.Labels[sinks.JobSinkNameLabel] = ref.Name
job.OwnerReferences = append(job.OwnerReferences, or)

Persona:
Which persona is this feature for? Developers

Exit Criteria
A measurable (binary) test that would indicate that the problem has been resolved.

Time Estimate (optional):
How many developer-days do you think this may take to resolve? 1

@Cali0707
Copy link
Member Author

Cali0707 commented Jun 4, 2024

cc @pierDipi - thoughts?

@Cali0707
Copy link
Member Author

Cali0707 commented Jun 6, 2024

/good-first-issue

Copy link

knative-prow bot commented Jun 6, 2024

@Cali0707:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue

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.

@knative-prow knative-prow bot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jun 6, 2024
@pierDipi pierDipi added the triage/accepted Issues which should be fixed (post-triage) label Jun 6, 2024
@babugeet
Copy link
Contributor

babugeet commented Jun 7, 2024

/assign

@babugeet
Copy link
Contributor

babugeet commented Jun 7, 2024

@Cali0707 , @pierDipi I would like to work on this issue

@Cali0707
Copy link
Member Author

Cali0707 commented Jul 4, 2024

Closing as #7968 is merged

@Cali0707 Cali0707 closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature-request triage/accepted Issues which should be fixed (post-triage)
Projects
None yet
Development

No branches or pull requests

3 participants