Skip to content

Commit

Permalink
Merge pull request #130 from ekohl/drop-deprecated
Browse files Browse the repository at this point in the history
Drop deprecated use_fqdn option and github_action_test_matrix output
  • Loading branch information
bastelfreak authored May 7, 2024
2 parents 31c4a81 + 38fd94f commit dd815b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 161 deletions.
2 changes: 0 additions & 2 deletions bin/metadata2gha
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require 'puppet_metadata'
PidfileWorkaround = Object.new

options = {
beaker_use_fqdn: false,
beaker_pidfile_workaround: false,
domain: nil,
minimum_major_puppet_version: nil,
Expand All @@ -28,7 +27,6 @@ OptionParser.new do |opts|

opts.banner = "Usage: #{$0} [options] metadata"

opts.on('--[no-]use-fqdn', 'Generate beaker setfiles with a FQDN') { |opt| options[:beaker_use_fqdn] = opt }
opts.on('--pidfile-workaround VALUE', 'Generate the systemd PIDFile workaround to work around a docker bug', PidfileWorkaround) { |opt| options[:beaker_pidfile_workaround] = opt }
opts.on('-d', '--domain VALUE', 'the domain for the box, only used when --use-fqdn is set to true') { |opt| options[:domain] = opt }
opts.on('--minimum-major-puppet-version VERSION', "Don't create actions for Puppet versions less than this major version") { |opt| options[:minimum_major_puppet_version] = opt }
Expand Down
5 changes: 1 addition & 4 deletions lib/puppet_metadata/beaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def adjusted_os(os)
# The Operating System string as metadata.json knows it, which in turn is
# based on Facter's operatingsystem fact.
# @param [String] release The OS release
# @param [Boolean] use_fqdn
# Whether or not to use a FQDN, ensuring a domain (deprecated, use domain)
# @param [Boolean, Array[String]] pidfile_workaround
# Whether or not to apply the systemd PIDFile workaround. This is only
# needed when the daemon uses PIDFile in its service file and using
Expand All @@ -63,13 +61,12 @@ def adjusted_os(os)
#
# @return [nil] If no setfile is available
# @return [Array<(String, String)>] The beaker setfile description with a readable name
def os_release_to_setfile(os, release, use_fqdn: false, pidfile_workaround: false, domain: nil, puppet_version: nil, hosts: nil)
def os_release_to_setfile(os, release, pidfile_workaround: false, domain: nil, puppet_version: nil, hosts: nil)
return unless os_supported?(os)

aos = adjusted_os(os)
name = "#{aos}#{release.tr('.', '')}-64"
human_name = "#{os} #{release}"
domain ||= 'example.com' if use_fqdn

hosts_settings = []
if hosts
Expand Down
25 changes: 0 additions & 25 deletions lib/puppet_metadata/github_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ def outputs
puppet_major_versions: puppet_major_versions,
puppet_unit_test_matrix: puppet_unit_test_matrix,
puppet_beaker_test_matrix: puppet_beaker_test_matrix,
# Deprecated
github_action_test_matrix: github_action_test_matrix,
}
end

Expand Down Expand Up @@ -108,28 +106,6 @@ def puppet_beaker_test_matrix
matrix_include
end

def github_action_test_matrix
matrix_include = []

beaker_os_releases do |os, release, puppet_version|
next if puppet_version_below_minimum?(puppet_version[:value])

setfile = os_release_to_beaker_setfile(os, release, puppet_version[:collection])
next unless setfile

matrix_include << {
name: "#{puppet_version[:name]} - #{setfile[1]}",
setfile: {
name: setfile[1],
value: setfile[0],
},
puppet: puppet_version,
}
end

matrix_include
end

def puppet_version_below_minimum?(version)
return false unless version && options[:minimum_major_puppet_version]

Expand All @@ -140,7 +116,6 @@ def os_release_to_beaker_setfile(os, release, puppet_collection)
PuppetMetadata::Beaker.os_release_to_setfile(
os,
release,
use_fqdn: options[:beaker_use_fqdn],
pidfile_workaround: options[:beaker_pidfile_workaround],
domain: options[:domain],
puppet_version: puppet_collection,
Expand Down
4 changes: 2 additions & 2 deletions spec/beaker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
it { expect(described_class.os_release_to_setfile(os, release, pidfile_workaround: true)).to eq(expected) }
end

describe 'use_fqdn' do
describe 'domain' do
it {
expect(described_class.os_release_to_setfile('CentOS', '7', pidfile_workaround: true,
use_fqdn: true)).to eq(['centos7-64{hostname=centos7-64.example.com,image=centos:7.6.1810}', 'CentOS 7'])
domain: 'example.com')).to eq(['centos7-64{hostname=centos7-64.example.com,image=centos:7.6.1810}', 'CentOS 7'])
}
end
end
Expand Down
Loading

0 comments on commit dd815b5

Please sign in to comment.