-
Notifications
You must be signed in to change notification settings - Fork 50
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
Path Enhancements #509
Conversation
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 Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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" |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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 nestedlibstorage
element. For example, while the default configuration directory is/etc/libstorage
, now ifLIBSTORAGE_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, ifLIBSTORAGE_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 ofLIBSTORAGE_HOME
. Available environment variables are:LIBSTORAGE_PATHS_ETC
LIBSTORAGE_PATHS_LIB
LIBSTORAGE_PATHS_LOG
LIBSTORAGE_PATHS_RUN
LIBSTORAGE_PATHS_TLS
LIBSTORAGE_PATHS_LSX