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

Path Enhancements #509

Merged
merged 1 commit into from
Apr 12, 2017
Merged

Conversation

akutz
Copy link
Collaborator

@akutz akutz commented Apr 12, 2017

This patch enhances the way libStorage manages its internal file path workflow.

  • There is a new path constant, TLS. It's default path is /etc/libstorage/tls.

  • When LIBSTORAGE_HOME is set the path structure removes the nested libstorage element. For example, while the default configuration directory is /etc/libstorage, now if LIBSTORAGE_HOME is set to /tmp/libstorage the new configuration directory path will be /tmp/libstorage/etc instead of /tmp/libstorage/etc/libstorage.

  • All path constants can now be explicitly specified via environment variables, independent of the value of LIBSTORAGE_HOME. For example, if LIBSTORAGE_HOME is set to /tmp/libstorage, LIBSTORAGE_PATHS_ETC can be set to /etc/libstorage to ensure that the configuration directory is not nested inside of LIBSTORAGE_HOME. Available environment variables are:

    • LIBSTORAGE_PATHS_ETC
    • LIBSTORAGE_PATHS_LIB
    • LIBSTORAGE_PATHS_LOG
    • LIBSTORAGE_PATHS_RUN
    • LIBSTORAGE_PATHS_TLS
    • LIBSTORAGE_PATHS_LSX

This patch enhances the way libStorage manages its internal file path
workflow.

* There is a new path constant, "TLS". It's default path is
  "/etc/libstorage/tls".

* When LIBSTORAGE_HOME is set the path structure removes the nested
  "libstorage" element. For example, while the default configuration
  directory is "/etc/libstorage", now if LIBSTORAGE_HOME is set to
  "/tmp/libstorage" the new configuration directory path will be
  "/tmp/libstorage/etc" instead of "/tmp/libstorage/etc/libstorage".

* All path constants can now be explicitly specified via environment
  variables, independent of the value of LIBSTORAGE_HOME. For example,
  if LIBSTORAGE_HOME is set to "/tmp/libstorage", LIBSTORAGE_PATHS_ETC
  can be set to "/etc/libstorage" to ensure that the configuration
  directory is not nested inside of LIBSTORAGE_HOME. Available
  environment variables are:

    * LIBSTORAGE_PATHS_ETC
    * LIBSTORAGE_PATHS_LIB
    * LIBSTORAGE_PATHS_LOG
    * LIBSTORAGE_PATHS_RUN
    * LIBSTORAGE_PATHS_TLS
    * LIBSTORAGE_PATHS_LSX
@codecov-io
Copy link

Codecov Report

Merging #509 into master will increase coverage by 0.6%.
The diff coverage is 68.65%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #509     +/-   ##
=========================================
+ Coverage   30.21%   30.82%   +0.6%     
=========================================
  Files          34       33      -1     
  Lines        1959     2008     +49     
=========================================
+ Hits          592      619     +27     
- Misses       1303     1317     +14     
- Partials       64       72      +8
Impacted Files Coverage Δ
api/types/types_paths.go 60.79% <68.65%> (-1.71%) ⬇️
api/types/types_localdevices.go 79.24% <0%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e858976...ac4fa0e. Read the comment docs.

Copy link
Contributor

@codenrhoden codenrhoden left a comment

Choose a reason for hiding this comment

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

Looks good. Just have the one question.

return "/var/run/libstorage"
case TLS:
return "tls"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is TLS different from the others, and not ever dependent on LIBSTORAGE_HOME ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @codenrhoden,

Because of the function parent:

func (k fileKey) parent() fileKey {
	switch k {
	case TLS:
		return Etc
	case LSX:
		return Lib
	default:
		return Home
	}
}

Unless specified by an env var, the TLS path is relative to the Etc path.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@akutz akutz merged commit b8f2b1b into thecodeteam:master Apr 12, 2017
@akutz akutz deleted the feature/path-enhancements branch April 12, 2017 19:12
@codenrhoden codenrhoden modified the milestone: 2017.04 May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants