Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Workaround older versions of e2fsprogs #631

Merged
merged 2 commits into from
Oct 20, 2016

Conversation

brunotm
Copy link
Contributor

@brunotm brunotm commented Oct 18, 2016

Issue #629

This commit workaround the error of creating ext/2/3/4 filesystems when using older versions of e2fsprogs. Those versions had an broken check and asks for confirmation when creating a filesystem using the whole block device (eg. /dev/sdb)

It also Broaden search path for filesystem utilities. Some distributions place filesystem utilities outside /sbin.

Some distributions place filesystem utilities outside /sbin.
@brunotm
Copy link
Contributor Author

brunotm commented Oct 18, 2016

@kerneltime it is possible to have access to the CI logs? Once more i don't get any errors in my tests.
It's probably its a hassle for you to keep providing the logs, and makes much harder for me to track any issue.

Thanks!

@msterin
Copy link
Contributor

msterin commented Oct 19, 2016

@brunotm - this is CI issue, looks like password expiration. @kerneltime needs to take care of this as soon as sun rises in Palo Alto :)

The log says:

dpkg-query: no packages found matching docker-volume-vsphere
WARNING: Your password has expired.
Password change required but no TTY available.
WARNING: Your password has expired.
Password change required but no TTY available.

an all fails at this point.

@@ -37,6 +37,9 @@ const pciAddrLen = 10 // Length of PCI dev addr
// FstypeDefault contains the default FS when not specified by the user
const FstypeDefault = "ext4"

// BinSearchPaths contains search paths for host binaries
var BinSearchPaths = [4]string{"/bin", "/sbin", "/usr/bin", "/usr/sbin"}
Copy link
Contributor

@govint govint Oct 19, 2016

Choose a reason for hiding this comment

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

This may not be needed here, why not have a "default" search path in the default config used by the plugin and that can be used as the search path for all external executables that the plugin runs. The plugin behavior can be changed any time.

Copy link
Contributor

@govint govint Oct 19, 2016

Choose a reason for hiding this comment

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

Even if we want to have a list here maybe a slice can be used vs. an array - []string{"/bin", "/sbin", "/usr/bin", "/usr/sbin"}.

Copy link
Contributor Author

@brunotm brunotm Oct 19, 2016

Choose a reason for hiding this comment

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

This may not be needed here, why not have a "default" search path in the default config used by the plugin and that can be used as the search path for all external executables that the plugin runs. The plugin behavior can be changed any time.

I do think that is probably better to have it in the config file.

Please correct me if i am wrong, but we hold no reference from the config instance created in main.go (where the configfile can be other than the default), and from fs.go we would only be able to load it with config.DefaultConfigPath, this file can potentially be different from the user specified - If this is the case, IMO the required changes are beyond the scope of this PR.

Even if we want to have a list here maybe a slice can be used vs. an array - []string{"/bin", "/sbin", "/usr/bin", "/usr/sbin"}.

A slice is not really needed, but its not a problem :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please correct me if i am wrong

Or overcomplicating the issue! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about moving the BinSearchPath to the config package for now ?

Copy link
Contributor

Choose a reason for hiding this comment

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

it is nice to have it extensible but I think it's super low priority ,and to me it does not feel like a config item

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. But BinSearchPath also looks misplaced in fs.go.
So we keep it there for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes - Mkfs related stuff is ok in fs.go IMO

// Workaround older versions of e2fsprogs, issue 629.
var err error
var out []byte
if strings.Split(mkfscmd, ".")[1][0:3] == "ext" {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment with info on what pattern and where you are looking for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@msterin
Copy link
Contributor

msterin commented Oct 19, 2016

Looks good. One request for more comments , and it's good to go after CI is fixed and passes.

out, err = exec.Command(mkfscmd, "-F", "-L", label, device).CombinedOutput()
} else {
out, err = exec.Command(mkfscmd, "-L", label, device).CombinedOutput()
}
Copy link
Contributor

@govint govint Oct 19, 2016

Choose a reason for hiding this comment

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

Just asking, can we use "-F -L" always? Unless the different versions don't accept -F

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The -F is not normalized for the most common filesystem utilities (ext*, btrfs, xfs..) :(

Copy link
Contributor

@govint govint left a comment

Choose a reason for hiding this comment

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

Few comments, mostly changes look final.

…g ext2/3/4 filesystems.

Address @msterin comments.
Address @govint comments.
@brunotm
Copy link
Contributor Author

brunotm commented Oct 19, 2016

Rebased the commit to address the comments.
Thanks!

@msterin msterin merged commit ef3ff0f into vmware-archive:master Oct 20, 2016
brunotm added a commit to brunotm/docker-volume-vsphere that referenced this pull request Oct 26, 2016
* master: (25 commits)
  Update new ESX IP
  added forgotten .so file
  Install sqlite3 py libs on ESX and load for Python2
  Added py code and binaries for sqlite3 python libs
  Update drone security
  Removed accidental .pyc files
  Handle byte to string conversions for status command.
  Auth configuration and operation admission check (Auth.liping) (vmware-archive#603)
  Revert "Cli auth.liping"
  Cli auth.liping (vmware-archive#640)
  Handle missing or invalid fs type on mount. (vmware-archive#639)
  Updated Admin CLI commands to support tenants. (vmware-archive#620)
  Workaround older versions of e2fsprogs (vmware-archive#631)
  Add auth proposal
  Made handing of missing metafile less harsh. (vmware-archive#627)
  Fixed ACLs in payload bin dir (vmware-archive#624)
  Fixed error handling for set command. (vmware-archive#610)
  Use new error variables when rolling back volume creation to avoid nil reassignment. (vmware-archive#617)
  Change wording
  Fix broken link
  ...
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants