Skip to content

Commit 8c89ade

Browse files
balasankarctwk3
authored andcommitted
Support SELinux in Amazon Linux 2023
Signed-off-by: Balasankar "Balu" C <[email protected]>
1 parent be52c36 commit 8c89ade

File tree

7 files changed

+38
-33
lines changed

7 files changed

+38
-33
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ variables:
4242
# To be used for images that exist only on dev.gitlab.org
4343
DEV_BUILDER_IMAGE_REGISTRY: 'dev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder'
4444
PUBLIC_BUILDER_IMAGE_REGISTRY: "registry.gitlab.com/gitlab-org/gitlab-omnibus-builder"
45-
BUILDER_IMAGE_REVISION: "4.19.0"
45+
BUILDER_IMAGE_REVISION: "4.20.0"
4646
# The registry to pull the assets image from
4747
ASSET_REGISTRY: "${CI_REGISTRY}"
4848
ASSET_SYNC_EXISTING_REMOTE_FILES: "keep"

config/projects/gitlab.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,15 @@
7676
when '8', '9'
7777
runtime_dependency 'policycoreutils-python-utils'
7878
end
79+
elsif amazon?
80+
case OhaiHelper.get_amazon_version
81+
when '2'
82+
runtime_dependency 'policycoreutils-python'
83+
when '2023'
84+
runtime_dependency 'policycoreutils-python-utils'
85+
end
7986
end
8087

81-
runtime_dependency 'policycoreutils-python' if amazon? && OhaiHelper.get_amazon_version == '2'
82-
8388
# Arm targets need libatomic
8489
if OhaiHelper.arm?
8590
if rhel? || amazon?

config/software/python3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
(ohai['platform'] =~ /^ubuntu/ && ohai['platform_version'] =~ /^22/)
6464

6565
with_openssl = ''
66-
if (ohai['platform'] =~ /^amzn/ || ohai['platform'] =~ /^amazon/) && (ohai['platform_version'] == "2022")
66+
if (ohai['platform'] =~ /^amzn/ || ohai['platform'] =~ /^amazon/) && (ohai['platform_version'] == "2023")
6767
patch source: 'custom-openssl.patch'
6868
with_openssl = "--with-opensssl=/usr/local/openssl"
6969
end

files/gitlab-cookbooks/package/libraries/helpers/selinux_distro_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class SELinuxDistroHelper
33
OS_RELEASE_FILE = '/etc/os-release'.freeze
44

55
def self.selinux_supported?
6-
system_is_rhel7? || system_is_rhel8? || system_is_rhel9? || system_is_amazon_linux2? || system_is_amazon_linux2022?
6+
system_is_rhel7? || system_is_rhel8? || system_is_rhel9? || system_is_amazon_linux2? || system_is_amazon_linux2023?
77
end
88

99
def self.system_is_rhel7?
@@ -23,9 +23,9 @@ def self.system_is_amazon_linux2?
2323
platform_family == 'rhel' && %w[amazon amzn].include?(platform&.downcase) && platform_version == '2'
2424
end
2525

26-
def self.system_is_amazon_linux2022?
26+
def self.system_is_amazon_linux2023?
2727
# Extra platform check to ensure we don't enable RHEL 2
28-
platform_family == 'rhel' && %w[amazon amzn].include?(platform&.downcase) && platform_version == '2022'
28+
platform_family == 'rhel' && %w[amazon amzn].include?(platform&.downcase) && platform_version == '2023'
2929
end
3030

3131
def self.platform_family

gitlab-ci-config/check-packages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ AmazonLinux-2-arm64-check:
165165
extends: .yum-install
166166
tags:
167167
- docker-arm-builder
168-
AmazonLinux-2022-check:
169-
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2022:${BUILDER_IMAGE_REVISION}"
168+
AmazonLinux-2023-check:
169+
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2023:${BUILDER_IMAGE_REVISION}"
170170
extends: .yum-install
171-
AmazonLinux-2022-arm64-check:
172-
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2022_arm64:${BUILDER_IMAGE_REVISION}"
171+
AmazonLinux-2023-arm64-check:
172+
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2023_arm64:${BUILDER_IMAGE_REVISION}"
173173
extends: .yum-install
174174
tags:
175175
- docker-arm-builder

gitlab-ci-config/dev-gitlab-org.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,11 @@ AmazonLinux-2-arm64-branch:
353353
extends: .branch_template
354354
tags:
355355
- docker-arm-builder
356-
AmazonLinux-2022-branch:
357-
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2022:${BUILDER_IMAGE_REVISION}"
356+
AmazonLinux-2023-branch:
357+
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2023:${BUILDER_IMAGE_REVISION}"
358358
extends: .branch_template
359-
AmazonLinux-2022-arm64-branch:
360-
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2022_arm64:${BUILDER_IMAGE_REVISION}"
359+
AmazonLinux-2023-arm64-branch:
360+
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2023_arm64:${BUILDER_IMAGE_REVISION}"
361361
extends: .branch_template
362362
tags:
363363
- docker-arm-builder
@@ -656,11 +656,11 @@ AmazonLinux-2-arm64:
656656
extends: .tag_template
657657
tags:
658658
- docker-arm-builder
659-
AmazonLinux-2022:
660-
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2022:${BUILDER_IMAGE_REVISION}"
659+
AmazonLinux-2023:
660+
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2023:${BUILDER_IMAGE_REVISION}"
661661
extends: .tag_template
662-
AmazonLinux-2022-arm64:
663-
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2022_arm64:${BUILDER_IMAGE_REVISION}"
662+
AmazonLinux-2023-arm64:
663+
image: "${BUILDER_IMAGE_REGISTRY}/amazonlinux_2023_arm64:${BUILDER_IMAGE_REVISION}"
664664
extends: .tag_template
665665
tags:
666666
- docker-arm-builder
@@ -829,19 +829,19 @@ AmazonLinux-2-arm64-staging:
829829
optional: true
830830
- job: AmazonLinux-2-arm64-branch
831831
optional: true
832-
AmazonLinux-2022-staging:
832+
AmazonLinux-2023-staging:
833833
extends: .staging_upload_template
834834
needs:
835-
- job: AmazonLinux-2022
835+
- job: AmazonLinux-2023
836836
optional: true
837-
- job: AmazonLinux-2022-branch
837+
- job: AmazonLinux-2023-branch
838838
optional: true
839-
AmazonLinux-2022-arm64-staging:
839+
AmazonLinux-2023-arm64-staging:
840840
extends: .staging_upload_template
841841
needs:
842-
- job: AmazonLinux-2022-arm64
842+
- job: AmazonLinux-2023-arm64
843843
optional: true
844-
- job: AmazonLinux-2022-arm64-branch
844+
- job: AmazonLinux-2023-arm64-branch
845845
optional: true
846846
SLES-12.5-staging:
847847
extends: .staging_upload_template
@@ -973,14 +973,14 @@ AmazonLinux-2-arm64-release:
973973
extends: .production_release_template
974974
needs:
975975
- AmazonLinux-2-arm64
976-
AmazonLinux-2022-release:
976+
AmazonLinux-2023-release:
977977
extends: .production_release_template
978978
needs:
979-
- AmazonLinux-2022
980-
AmazonLinux-2022-arm64-release:
979+
- AmazonLinux-2023
980+
AmazonLinux-2023-arm64-release:
981981
extends: .production_release_template
982982
needs:
983-
- AmazonLinux-2022-arm64
983+
- AmazonLinux-2023-arm64
984984
SLES-12.5-release:
985985
extends: .production_release_template
986986
needs:

gitlab-ci-config/gitlab-com.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Ubuntu 18.04 knapsack: !reference [.knapsack]
401401
Ubuntu 20.04 knapsack: !reference [.knapsack]
402402
Ubuntu 22.04 knapsack: !reference [.knapsack]
403403
AmazonLinux 2 knapsack: !reference [.knapsack]
404-
AmazonLinux 2022 knapsack: !reference [.knapsack]
404+
AmazonLinux 2023 knapsack: !reference [.knapsack]
405405

406406
build library specs:
407407
image: "${PUBLIC_BUILDER_IMAGE_REGISTRY}/ubuntu_20.04-ruby:${BUILDER_IMAGE_REVISION}"
@@ -484,12 +484,12 @@ AmazonLinux 2 specs :
484484
parallel: 6
485485
needs:
486486
- AmazonLinux 2 knapsack
487-
AmazonLinux 2022 specs :
488-
image: "${PUBLIC_BUILDER_IMAGE_REGISTRY}/amazonlinux_2022-ruby:${BUILDER_IMAGE_REVISION}"
487+
AmazonLinux 2023 specs :
488+
image: "${PUBLIC_BUILDER_IMAGE_REGISTRY}/amazonlinux_2023-ruby:${BUILDER_IMAGE_REVISION}"
489489
extends: .chef_spec_template
490490
parallel: 6
491491
needs:
492-
- AmazonLinux 2022 knapsack
492+
- AmazonLinux 2023 knapsack
493493

494494

495495
update-knapsack:

0 commit comments

Comments
 (0)