Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/anchore/scan-action-6
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaffen authored Jan 30, 2025
2 parents b662f10 + 8815947 commit 80e94ed
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
uses: dependabot/fetch-metadata@v2.3.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

Expand Down
12 changes: 7 additions & 5 deletions app/models/hiera_data/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ def load_content
end

def initialize_hierarchies
@hierarchies = content['hierarchy'].map do |hierarchy|
Hierarchy.new(
raw_hash: content['defaults'].merge(hierarchy),
base_path: @base_path
)
@hierarchies = content['hierarchy'].filter_map do |hierarchy|
unless hierarchy['data_hash'] == 'classifier_data'
Hierarchy.new(
raw_hash: content['defaults'].merge(hierarchy),
base_path: @base_path
)
end
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/files/puppet/environments/enterprise/hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
version: 5

hierarchy:
- name: Classifier Configuration Data
data_hash: classifier_data
1 change: 1 addition & 0 deletions test/models/environment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class EnvironmentTest < ActiveSupport::TestCase
development
dynamic_datadir
empty_defaults
enterprise
eyaml
globs
hdm
Expand Down
9 changes: 9 additions & 0 deletions test/models/hiera_data/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,14 @@ def base_path
Pathname.new(Rails.configuration.hdm["config_dir"]).join("environments", "empty_defaults")
end
end

class ConfigWithClassifierDataHierarchyTest < ActiveSupport::TestCase
test "`classifier_data` hierarchy is being ignored" do
base_path = Pathname.new(Rails.configuration.hdm["config_dir"]).join("environments", "enterprise")
config = HieraData::Config.new(base_path.join("hiera.yaml"))

assert_equal [], config.hierarchies
end
end
end
end

0 comments on commit 80e94ed

Please sign in to comment.