-
Notifications
You must be signed in to change notification settings - Fork 682
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
make postgres resource working in mock runner (for inspec check) #1961
Conversation
6873e66
to
34b691c
Compare
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.
The reason for the change makes sense, but why did you use empty strings as defaults instead of nil
? It makes it inconsistent with the way we treat non-set default variables in other resources.
Also, you've got some rubocop complaints to deal with.
lib/resources/postgres.rb
Outdated
@@ -11,6 +11,9 @@ class Postgres < Inspec.resource(1) | |||
|
|||
attr_reader :service, :data_dir, :conf_dir, :conf_path, :version, :cluster | |||
def initialize | |||
@conf_dir = '' |
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 empty strings and not nil?
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.
Agree on that one :-)
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
34b691c
to
89c25ed
Compare
89c25ed
to
9dc3829
Compare
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
9dc3829
to
6398660
Compare
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.
Great update, kudos Chris.
Also thank you Adam for your initial review.
This helps to use the postgres resources in mock environments with empty data better. Also, this is required to get inspec check for https://github.com/dev-sec/postgres-baseline green again