-
Notifications
You must be signed in to change notification settings - Fork 83
distro: move rhel8 into a generic distro #1643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1f85214
distro: drop non-rhel10 tests from TestRH10DistroFactory
mvo5 3f700e8
distro: drop rhel-8.4 from TestDistroFactory
mvo5 31621ab
distro: fix hardcoded "IoT" variant and dbus-broker
mvo5 78609b6
loader: add support for platform conditionals
mvo5 f644c18
distro: move rhel8 to the generic distro
mvo5 08ace26
distro: add centos-8 to distros.yaml
mvo5 bb84231
distro: add new `transform_re` to the distro
mvo5 7df8e17
distro: port rhel8 tests into the generic distro tests
mvo5 fa4ab7a
distro: add edge-{commit,container} to skipTest for rhel8
mvo5 5890a0d
distro,distroidparser: implement defs.ParseID
mvo5 16f2ecc
distro: rm -rf rhel8
mvo5 06e2c5e
distro: describe new `platforms_override`
mvo5 5746618
distro: add missing bootstrap_containers for rhel8
mvo5 791769f
distro: fix bug in `customizations` for kernel options
mvo5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package defs | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "regexp" | ||
|
|
||
| "github.com/osbuild/images/pkg/distro" | ||
| ) | ||
|
|
||
| // ParseID parse the given nameVer into a distro.ID. It will also | ||
| // apply any matching `transform_re`. This is needed to support distro | ||
| // names like "rhel-810" without dots. | ||
| // | ||
| // If no transformations are needed it will return "nil" | ||
| func ParseID(nameVer string) (*distro.ID, error) { | ||
| distros, err := loadDistros() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| for _, d := range distros.Distros { | ||
| re, err := regexp.Compile(d.TransformRE) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if l := re.FindStringSubmatch(nameVer); len(l) == 4 { | ||
| transformed := fmt.Sprintf("%s-%s.%s", l[re.SubexpIndex("name")], l[re.SubexpIndex("major")], l[re.SubexpIndex("minor")]) | ||
| return distro.ParseID(transformed) | ||
| } | ||
| } | ||
| return nil, nil | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in backticks unlike the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put all into backticks now, my editor was making the distro part of not_distro_name italic, but maybe that is just an artifact and GH is rendering it fine I did not double check.