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

chown dirs when migrating ephemeral_disk data #3723

Merged
merged 2 commits into from
Jan 9, 2018
Merged

Conversation

schmichael
Copy link
Member

@schmichael schmichael commented Jan 5, 2018

Fixes #3702

Added missing chown call and made it conditional on running as root and
not on Windows as we do with files.

50236f7 builds:
linux_amd64.zip
linux_386.zip

CHANGELOG.md Outdated
@@ -4,6 +4,7 @@ BUG FIXES:
* core: Fix search endpoint forwarding for multi-region clusters [[GH-3680](https://github.com/hashicorp/nomad/issues/3680)]
* core: Fix an issue in which batch jobs with queued placements and lost
allocations could result in improper placement counts [[GH-3717](https://github.com/hashicorp/nomad/issues/3717)]
* client: chown directories for migrated `ephemeral_disk`s [GH-3723]
Copy link
Contributor

Choose a reason for hiding this comment

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

Migrated ephemeral_disk's maintain directory permissions?

@@ -499,7 +499,15 @@ func (p *remotePrevAlloc) streamAllocDir(ctx context.Context, resp io.ReadCloser

// If the header is for a directory we create the directory
if hdr.Typeflag == tar.TypeDir {
os.MkdirAll(filepath.Join(dest, hdr.Name), os.FileMode(hdr.Mode))
name := filepath.Join(dest, hdr.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way to add a test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup! Added! Thanks for catching that.

Fixes #3702

Added missing chown call and made it conditional on running as root and
not on Windows as we do with files.
@schmichael schmichael merged commit 7e7c799 into master Jan 9, 2018
@schmichael schmichael deleted the b-3702-chown-dirs branch January 9, 2018 17:27
@pam9999
Copy link

pam9999 commented Jan 12, 2018

We have tested the patch successfully !
Many thanks.

@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 Mar 14, 2023
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