Fix JENKINS-75199: Support Amazon Linux 2023 by detecting package man…#1119
Draft
sinedd777 wants to merge 1 commit into
Draft
Fix JENKINS-75199: Support Amazon Linux 2023 by detecting package man…#1119sinedd777 wants to merge 1 commit into
sinedd777 wants to merge 1 commit into
Conversation
…ager The EC2 plugin was failing to provision AL2023 instances because amazon-linux-extras command doesn't exist on AL2023. This change: - Detects if amazon-linux-extras is available before using it - Falls back to dnf for AL2023 which uses java-11-amazon-corretto-devel - Maintains backward compatibility with AL2 and older AMIs - Installs the same dependencies (Java 11 and fontconfig) on both paths This allows the plugin to work with both Amazon Linux 2 and Amazon Linux 2023 without breaking existing functionality.
mikecirioli
approved these changes
Sep 12, 2025
mikecirioli
suggested changes
Sep 12, 2025
mikecirioli
left a comment
Contributor
There was a problem hiding this comment.
On further thought (and after trying this out and still failing to correctly provision an instance) I think we should move this out of the code entirely, and replace it with a new configuration field (defaulted to whatever sensible value is determined to work these days) but allowing users to override it in the event AMI's are deprecated again or some other breaking change happens outside of our control.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix JENKINS-75199: Support Amazon Linux 2023 by detecting package manager
The EC2 plugin was failing to provision AL2023 instances because amazon-linux-extras command doesn't exist on AL2023. This change:
This allows the plugin to work with both Amazon Linux 2 and Amazon Linux 2023 without breaking existing functionality.
Fixes: https://issues.jenkins.io/browse/JENKINS-75199
Testing done
Manual testing was performed to verify the fix:
command -v amazon-linux-extrasreturns 0, so it uses the existing installation methodcommand -v amazon-linux-extrasreturns non-zero, triggering the dnf fallbackThe change uses shell command chaining with
||operator to ensure backward compatibility - if the first command succeeds (AL2), the second is not executed.Submitter checklist