Update osbuild/images v0.63.0

Pulling in (among others):
- https://github.com/osbuild/images/pull/700
    - Blueprint User customization change required.
- https://github.com/osbuild/images/pull/705
This commit is contained in:
Achilleas Koutsou 2024-05-23 14:15:56 +02:00
parent c1d56a50c2
commit a3a539abd1
9 changed files with 71 additions and 56 deletions

View file

@ -63,16 +63,17 @@ type SSHKeyCustomization struct {
}
type UserCustomization struct {
Name string `json:"name" toml:"name"`
Description *string `json:"description,omitempty" toml:"description,omitempty"`
Password *string `json:"password,omitempty" toml:"password,omitempty"`
Key *string `json:"key,omitempty" toml:"key,omitempty"`
Home *string `json:"home,omitempty" toml:"home,omitempty"`
Shell *string `json:"shell,omitempty" toml:"shell,omitempty"`
Groups []string `json:"groups,omitempty" toml:"groups,omitempty"`
UID *int `json:"uid,omitempty" toml:"uid,omitempty"`
GID *int `json:"gid,omitempty" toml:"gid,omitempty"`
ExpireDate *int `json:"expiredate,omitempty" toml:"expiredate,omitempty"`
Name string `json:"name" toml:"name"`
Description *string `json:"description,omitempty" toml:"description,omitempty"`
Password *string `json:"password,omitempty" toml:"password,omitempty"`
Key *string `json:"key,omitempty" toml:"key,omitempty"`
Home *string `json:"home,omitempty" toml:"home,omitempty"`
Shell *string `json:"shell,omitempty" toml:"shell,omitempty"`
Groups []string `json:"groups,omitempty" toml:"groups,omitempty"`
UID *int `json:"uid,omitempty" toml:"uid,omitempty"`
GID *int `json:"gid,omitempty" toml:"gid,omitempty"`
ExpireDate *int `json:"expiredate,omitempty" toml:"expiredate,omitempty"`
ForcePasswordReset *bool `json:"force_password_reset,omitempty" toml:"force_password_reset,omitempty"`
}
type GroupCustomization struct {

View file

@ -3,16 +3,17 @@ package users
import "github.com/osbuild/images/pkg/blueprint"
type User struct {
Name string
Description *string
Password *string
Key *string
Home *string
Shell *string
Groups []string
UID *int
GID *int
ExpireDate *int
Name string
Description *string
Password *string
Key *string
Home *string
Shell *string
Groups []string
UID *int
GID *int
ExpireDate *int
ForcePasswordReset *bool
}
type Group struct {

View file

@ -417,9 +417,14 @@ func rhelEc2HaPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
// Includes the common ec2 package set, the common SAP packages, and
// the amazon rhui sap package
func rhelEc2SapPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
rhuiPkg := "rh-amazon-rhui-client-sap-bundle-e4s"
if t.Arch().Distro().OsVersion() == "8.10" {
rhuiPkg = "rh-amazon-rhui-client-sap-bundle"
}
return rpmmd.PackageSet{
Include: []string{
"rh-amazon-rhui-client-sap-bundle-e4s",
rhuiPkg,
},
}.Append(rhelEc2CommonPackageSet(t)).Append(SapPackageSet(t))
}

View file

@ -10,7 +10,7 @@ import (
// sapImageConfig returns the SAP specific ImageConfig data
func sapImageConfig(rd distro.Distro) *distro.ImageConfig {
return &distro.ImageConfig{
ic := &distro.ImageConfig{
SELinuxConfig: &osbuild.SELinuxConfigStageOptions{
State: osbuild.SELinuxStatePermissive,
},
@ -105,8 +105,11 @@ func sapImageConfig(rd distro.Distro) *distro.ImageConfig {
},
),
},
}
if common.VersionLessThan(rd.OsVersion(), "8.10") {
// E4S/EUS
DNFConfig: []*osbuild.DNFConfigStageOptions{
ic.DNFConfig = []*osbuild.DNFConfigStageOptions{
osbuild.NewDNFConfigStageOptions(
[]osbuild.DNFVariable{
{
@ -116,8 +119,10 @@ func sapImageConfig(rd distro.Distro) *distro.ImageConfig {
},
nil,
),
},
}
}
return ic
}
func SapPackageSet(t *rhel.ImageType) rpmmd.PackageSet {

View file

@ -12,15 +12,16 @@ type UsersStageOptions struct {
func (UsersStageOptions) isStageOptions() {}
type UsersStageOptionsUser struct {
UID *int `json:"uid,omitempty"`
GID *int `json:"gid,omitempty"`
Groups []string `json:"groups,omitempty"`
Description *string `json:"description,omitempty"`
Home *string `json:"home,omitempty"`
Shell *string `json:"shell,omitempty"`
Password *string `json:"password,omitempty"`
Key *string `json:"key,omitempty"`
ExpireDate *int `json:"expiredate,omitempty"`
UID *int `json:"uid,omitempty"`
GID *int `json:"gid,omitempty"`
Groups []string `json:"groups,omitempty"`
Description *string `json:"description,omitempty"`
Home *string `json:"home,omitempty"`
Shell *string `json:"shell,omitempty"`
Password *string `json:"password,omitempty"`
Key *string `json:"key,omitempty"`
ExpireDate *int `json:"expiredate,omitempty"`
ForcePasswordReset *bool `json:"force_password_reset,omitempty"`
}
func NewUsersStage(options *UsersStageOptions) *Stage {
@ -53,15 +54,16 @@ func NewUsersStageOptions(userCustomizations []users.User, omitKey bool) (*Users
}
user := UsersStageOptionsUser{
UID: uc.UID,
GID: uc.GID,
Groups: uc.Groups,
Description: uc.Description,
Home: uc.Home,
Shell: uc.Shell,
Password: uc.Password,
Key: nil,
ExpireDate: uc.ExpireDate,
UID: uc.UID,
GID: uc.GID,
Groups: uc.Groups,
Description: uc.Description,
Home: uc.Home,
Shell: uc.Shell,
Password: uc.Password,
Key: nil,
ExpireDate: uc.ExpireDate,
ForcePasswordReset: uc.ForcePasswordReset,
}
if !omitKey {
user.Key = uc.Key