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 NOMAD_JOB_ID and NOMAD_JOB_PARENT_ID env variables #8967

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

02strich
Copy link
Contributor

@02strich 02strich commented Sep 26, 2020

[Updated] Beforehand tasks and field replacements did not have access to the
unique ID of their job or information about its parent. This adds this information
as new environment variables.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Hi @02strich! Thank you for this PR! But I don't think we want to accept the NOMAD_JOB_VERSION change. See my comments.

website/pages/partials/envvars.mdx Show resolved Hide resolved
client/taskenv/env.go Outdated Show resolved Hide resolved
@02strich 02strich changed the title Add NOMAD_JOB_ID and NOMAD_JOB_VERSION env variables Add NOMAD_JOB_ID, NOMAD_JOB_PARENT_ID and NOMAD_DEPLOYMENT_ID env variables Oct 19, 2020
@02strich
Copy link
Contributor Author

@tgross thank you for the feedback. I have updated this PR to remove the version and will take a different route for the version part. Would be great to get the remaining envs in (assuming they are safe).

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Hi @02strich! So it looks like in this update, you've added the NOMAD_DEPLOYMENT_ID and NOMAD_JOB_PARENT_ID. The deployment ID isn't fixed; see my note below. I think the NOMAD_JOB_PARENT_ID is ok given that we're only setting the env var if there's info available.

client/taskenv/env.go Outdated Show resolved Hide resolved
@02strich 02strich changed the title Add NOMAD_JOB_ID, NOMAD_JOB_PARENT_ID and NOMAD_DEPLOYMENT_ID env variables Add NOMAD_JOB_ID and NOMAD_JOB_PARENT_ID env variables Oct 22, 2020
client/taskenv/env.go Outdated Show resolved Hide resolved
client/taskenv/env.go Outdated Show resolved Hide resolved
Beforehand tasks and field replacements did not have access to the
unique ID of their job or its parent. This adds this information as
new environment variables.
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for being patient with the review process here @02strich!

@tgross tgross merged commit 55d00d7 into hashicorp:master Oct 23, 2020
@tgross tgross added this to the 1.0 milestone Oct 23, 2020
tgross added a commit that referenced this pull request Oct 23, 2020
@tgross
Copy link
Member

tgross commented Oct 23, 2020

This will get shipped with the upcoming 1.0-beta next week.

tgross added a commit that referenced this pull request Oct 23, 2020
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants