Revision 0eaa01ad
Added by Lukas Zapletal over 2 years ago
app/models/operatingsystems/coreos.rb | ||
---|---|---|
end
|
||
|
||
def pxedir(medium_provider = nil)
|
||
'$arch-usr/$version'
|
||
if medium_provider&.os_major&.to_s == "0"
|
||
'$arch-usr/current'
|
||
else
|
||
'$arch-usr/$version'
|
||
end
|
||
end
|
||
|
||
def boot_file_sources(medium_provider, &block)
|
||
... | ... | |
|
||
# Helper text shown next to major version (do not use i18n)
|
||
def major_version_help
|
||
'2512.3'
|
||
'2512.3 or set to 0 to use current'
|
||
end
|
||
|
||
# Helper text shown next to minor version (do not use i18n)
|
app/services/medium_providers/provider.rb | ||
---|---|---|
architecture.try(:name)
|
||
end
|
||
|
||
def os_major
|
||
entity.try(:operatingsystem).try(:major)
|
||
end
|
||
|
||
def os_minor
|
||
entity.try(:operatingsystem).try(:minor)
|
||
end
|
||
|
||
def interpolate_vars(pattern)
|
||
pattern
|
||
end
|
test/models/operatingsystems/coreos_test.rb | ||
---|---|---|
end
|
||
end
|
||
end
|
||
|
||
context 'Flatcar Container Linux current version' do
|
||
let(:operatingsystem) { FactoryBot.create(:flatcar, major: "0") }
|
||
let(:medium) { FactoryBot.create(:medium, :flatcar) }
|
||
|
||
describe '#bootfile' do
|
||
test 'returns the bootfile' do
|
||
assert_includes operatingsystem.bootfile(medium_provider, :kernel), 'flatcar_production_pxe.vmlinuz'
|
||
end
|
||
end
|
||
|
||
describe '#boot_file_sources' do
|
||
test 'returns all boot file sources' do
|
||
expected = {
|
||
kernel: 'http://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_pxe.vmlinuz',
|
||
initrd: 'http://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_pxe_image.cpio.gz',
|
||
}
|
||
assert_equal expected, operatingsystem.boot_file_sources(medium_provider)
|
||
end
|
||
end
|
||
|
||
describe '#url_for_boot' do
|
||
test 'generates kernel url' do
|
||
assert_equal 'http://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_pxe.vmlinuz', operatingsystem.url_for_boot(medium_provider, :kernel)
|
||
end
|
||
|
||
test 'generates initrd url' do
|
||
assert_equal 'http://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_pxe_image.cpio.gz', operatingsystem.url_for_boot(medium_provider, :initrd)
|
||
end
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #33469 - current stream for Flatcar