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

Backport of Add stage_publish_dir field to csi_plugin stanza of a job into release/1.3.x #13965

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #13919 to be assessed for backporting due to the inclusion of the label backport/1.3.x.

The below text is copied from the body of the original PR.


Resolves #13263.

This PR adds a new field to the csi_plugin stanza of a job that determines the base (inside a CSI plugin's container) of CSI staging_target_path and target_path directories.

This is my first PR to Nomad. I have attempted to go through the bullets in the checklist below. Some of the bullets are (I think) not applicable. For the docs, I tried to find all locations within /docs where CSI is mentioned and add the field as appropriate.

I updated comments on a couple of fields that I found to be confusing while trying to figure out where and how to get this implemented. I'm obviously open to reverting anything that the maintainers think is not an improvement.

Code

  • Consider similar features in Consul, Kubernetes, and other tools. Is there prior art we should match? Terminology, structure, etc?
  • Add structs/fields to api/ package
    • api/ structs usually have Canonicalize and Copy methods
    • New fields should be added to existing Canonicalize, Copy methods
    • Test the structs/fields via methods mentioned above
  • Add structs/fields to nomad/structs package
    • structs/ structs usually have Copy, Equals, and Validate methods
    • Validation happens in this package and must be implemented
    • Note that analogous struct field names should match with api/ package
    • Test the structs/fields via methods mentioned above
    • Implement and test other logical methods
  • Add conversion between api/ and nomad/structs/ in command/agent/job_endpoint.go
    • Add test for conversion
  • Determine JSON encoding strategy for responses from RPC (see "JSON Encoding" below)
    • Write nomad/structs/ to api/ conversions if necessary and write tests
  • Implement diff logic for new structs/fields in nomad/structs/diff.go
    • Note that fields must be listed in alphabetical order in FieldDiff slices in nomad/structs/diff_test.go
    • Add test for diff of new structs/fields
  • Add change detection for new structs/fields in scheduler/util.go/tasksUpdated
    • Might be covered by .Equals but might not be, check.
    • Should return true if the task must be replaced as a result of the change.

Docs

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/webere-stage-publish-path/internally-precious-wallaby branch from 525501a to 94c97c6 Compare August 2, 2022 13:46
@hc-github-team-nomad-core hc-github-team-nomad-core merged commit aaae273 into release/1.3.x Aug 2, 2022
@hc-github-team-nomad-core hc-github-team-nomad-core deleted the backport/webere-stage-publish-path/internally-precious-wallaby branch August 2, 2022 13:46
@github-actions
Copy link

github-actions bot commented Dec 1, 2022

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 1, 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.

None yet

3 participants