Skip to content

Commit 51a5be6

Browse files
committed
Rename whitelist_file to allow_file
Note: This is a breaking change. Signed-off-by: Balasankar "Balu" C <[email protected]>
1 parent 4c84aff commit 51a5be6

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,19 @@ omnibus manifest PROJECT -l warn
310310

311311
This will output a JSON-formatted manifest containing the resolved version of every software definition.
312312

313-
## Whitelisting Libraries
313+
## Allowing/Ignoring Libraries
314314

315-
Sometimes a platform has libraries that need to be whitelisted so the healthcheck can pass. The whitelist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb) code comprises the minimal required for successful builds on supported platforms.
315+
Sometimes a platform has libraries that need to be allowed so the healthcheck can pass. The allowlist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb) code comprises the minimal required for successful builds on supported platforms.
316316

317-
To add your own whitelisted library, simply add a regex to your software definition in your omnibus project as follows:
317+
To add your own allowed library, simply add a regex to your software definition in your omnibus project as follows:
318318

319319
```
320-
whitelist_file /libpcrecpp\.so\..+/
320+
allow_file /libpcrecpp\.so\..+/
321321
```
322322

323-
It is typically a good idea to add a conditional to whitelist based on the specific platform that requires it.
323+
It is typically a good idea to add a conditional to allowlist based on the specific platform that requires it.
324324

325-
_Warning: You should only add libraries to the whitelist that are guaranteed to be on the system you install to; if a library comes from a non-default package you should instead build it into the package._
325+
_Warning: You should only add libraries to the allowlist that are guaranteed to be on the system you install to; if a library comes from a non-default package you should instead build it into the package._
326326

327327
## Changelog
328328

lib/omnibus/health_check.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ def hex
384384
#
385385
# @return [Array<String, Regexp>]
386386
#
387-
def whitelist_files
387+
def allow_files
388388
project.library.components.inject([]) do |array, component|
389-
array += component.whitelist_files
389+
array += component.allow_files
390390
array
391391
end
392392
end
@@ -446,7 +446,7 @@ def check_for_bad_library(bad_libs, current_library, name, linked)
446446
safe ||= true if reg.match(name)
447447
end
448448

449-
whitelist_files.each do |reg|
449+
allow_files.each do |reg|
450450
safe ||= true if reg.match(current_library)
451451
end
452452

lib/omnibus/software.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,20 +540,20 @@ def version(val = NULL, &block)
540540
# Add a file to the healthcheck allowlist.
541541
#
542542
# @example
543-
# whitelist_file '/path/to/file'
543+
# allow_file '/path/to/file'
544544
#
545545
# @param [String, Regexp] file
546546
# the name of a file to ignore in the healthcheck
547547
#
548548
# @return [Array<String>]
549549
# the list of currently allowed files
550550
#
551-
def whitelist_file(file)
551+
def allow_file(file)
552552
file = Regexp.new(file) unless file.is_a?(Regexp)
553-
whitelist_files << file
554-
whitelist_files.dup
553+
allow_files << file
554+
allow_files.dup
555555
end
556-
expose :whitelist_file
556+
expose :allow_file
557557

558558
#
559559
# The path relative to fetch_dir where relevant project files are
@@ -926,8 +926,8 @@ def dependencies
926926
#
927927
# @return [Array<String>]
928928
#
929-
def whitelist_files
930-
@whitelist_files ||= []
929+
def allow_files
930+
@allow_files ||= []
931931
end
932932

933933
#

spec/unit/software_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module Omnibus
4343
it_behaves_like "a cleanroom setter", :license_file, %{license_file 'LICENSES/artistic.txt'}
4444
it_behaves_like "a cleanroom setter", :skip_transitive_dependency_licensing, %{skip_transitive_dependency_licensing true}
4545
it_behaves_like "a cleanroom setter", :dependency_licenses, %{dependency_licenses [{license: "MIT"}]}
46-
it_behaves_like "a cleanroom setter", :whitelist_file, %{whitelist_file '/opt/whatever'}
46+
it_behaves_like "a cleanroom setter", :allow_file, %{allow_file '/opt/whatever'}
4747
it_behaves_like "a cleanroom setter", :relative_path, %{relative_path '/path/to/extracted'}
4848
it_behaves_like "a cleanroom setter", :build, %|build {}|
4949
it_behaves_like "a cleanroom getter", :project_dir
@@ -453,17 +453,17 @@ module Omnibus
453453
end
454454
end
455455

456-
describe "#whitelist_file" do
457-
it "appends to the whitelist_files array" do
458-
expect(subject.whitelist_files.size).to eq(0)
459-
subject.whitelist_file(%r{foo/bar})
460-
expect(subject.whitelist_files.size).to eq(1)
456+
describe "#allow_file" do
457+
it "appends to the allow_files array" do
458+
expect(subject.allow_files.size).to eq(0)
459+
subject.allow_file(%r{foo/bar})
460+
expect(subject.allow_files.size).to eq(1)
461461
end
462462

463463
it "converts Strings to Regexp instances" do
464-
subject.whitelist_file "foo/bar"
465-
expect(subject.whitelist_files.size).to eq(1)
466-
expect(subject.whitelist_files.first).to be_kind_of(Regexp)
464+
subject.allow_file "foo/bar"
465+
expect(subject.allow_files.size).to eq(1)
466+
expect(subject.allow_files.first).to be_kind_of(Regexp)
467467
end
468468
end
469469

0 commit comments

Comments
 (0)