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

make sure facts for windows server 2025 is discovered as 2025 #2778

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/facter/util/facts/windows_release_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ def find_release(input)
def check_version_10_11(consumerrel, kernel_version)
build_number = kernel_version[/([^.]*)$/].to_i

return '11' if build_number >= 22_000
return '10' if consumerrel
return '11' if consumerrel && build_number >= 22_000
return '10' if consumerrel && build_number >= 20_348

if build_number >= 20_348
if build_number >= 26_100
'2025'
elsif build_number >= 20_348
'2022'
elsif build_number >= 17_623
'2019'
Expand Down
11 changes: 11 additions & 0 deletions spec/facter/util/facts/windows_release_finder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
end
end

describe '#find windows release when version is 2025' do
let(:cons) { false }
let(:desc) {}
let(:k_version) { '10.0.26100' }
let(:version) { '10.0' }

it 'returns 2025' do
expect(Facter::Util::Facts::WindowsReleaseFinder.find_release(input)).to eql('2025')
end
end

describe '#find windows release when version is 2022' do
let(:cons) { false }
let(:desc) {}
Expand Down
Loading