Skip to content

Commit fecc124

Browse files
committed
Make package info methods take fips as argument
Package related information can have different values for FIPS packages and regular packages. For builds, USE_SYSTEM_SSL variable controls if the FIPS specific information should be used. However, while generating facts, we need to specifically retreive FIPS specific information too, in addition to regular one. So, accept fips as an argument to the relevant methods that can be specified while generating facts. Signed-off-by: Balasankar 'Balu' C <[email protected]>
1 parent 8264314 commit fecc124

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/gitlab/build/info/package.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Package
1010
PACKAGE_GLOB = "pkg/**/*.{deb,rpm}".freeze
1111

1212
class << self
13-
def name
14-
return "gitlab-fips" if Check.use_system_ssl?
13+
def name(fips: Check.use_system_ssl?)
14+
return "gitlab-fips" if fips
1515
return "gitlab-ee" if Check.is_ee?
1616

1717
"gitlab-ce"
@@ -32,7 +32,7 @@ def edition
3232
# package version will remain the same but contents of the package will be
3333
# different.
3434
# To resolve this, we append a PIPELINE_ID to change the name of the package
35-
def semver_version
35+
def semver_version(fips: Build::Check.use_system_ssl?)
3636
if Build::Check.on_tag?
3737
# timestamp is disabled in omnibus configuration
3838
Omnibus.load_configuration('omnibus.rb')
@@ -42,13 +42,13 @@ def semver_version
4242
latest_version = latest_git_tag && !latest_git_tag.empty? ? latest_git_tag[0, latest_git_tag.match("[+]").begin(0)] : '0.0.1'
4343
commit_sha = Build::Info::Git.commit_sha
4444
ver_tag = "#{latest_version}+" + (Build::Check.is_nightly? ? "rnightly" : "rfbranch")
45-
ver_tag += ".fips" if Build::Check.use_system_ssl?
45+
ver_tag += ".fips" if fips
4646
[ver_tag, Gitlab::Util.get_env('CI_PIPELINE_ID'), commit_sha].compact.join('.')
4747
end
4848
end
4949

50-
def release_version
51-
semver = Info::Package.semver_version
50+
def release_version(fips: Build::Check.use_system_ssl?)
51+
semver = Info::Package.semver_version(fips: fips)
5252
"#{semver}-#{Gitlab::BuildIteration.new.build_iteration}"
5353
end
5454

0 commit comments

Comments
 (0)