distro/rhel8+9: deprecate User/Group customi. on edge-commit/container

Signed-off-by: Irene Diez <idiez@redhat.com>
This commit is contained in:
Irene Diez 2023-02-10 14:42:31 +01:00 committed by Sanne Raymaekers
parent f5580b1f3e
commit dbadd42a01
2 changed files with 24 additions and 0 deletions

View file

@ -2,6 +2,7 @@ package rhel8
import (
"fmt"
"log"
"math/rand"
"strings"
@ -402,6 +403,17 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
return fmt.Errorf("edge raw images require specifying a URL from which to retrieve the OSTree commit")
}
// warn that user & group customizations on edge-commit, edge-container are deprecated
// TODO(edge): directly error if these options are provided when rhel-9.5's time arrives
if t.name == "edge-commit" || t.name == "edge-container" {
if customizations.GetUsers() != nil {
log.Printf("Please note that user customizations on %q image type are deprecated and will be removed in the near future\n", t.name)
}
if customizations.GetGroups() != nil {
log.Printf("Please note that group customizations on %q image type are deprecated and will be removed in the near future\n", t.name)
}
}
if kernelOpts := customizations.GetKernel(); kernelOpts.Append != "" && t.rpmOstree && (!t.bootable || t.bootISO) {
return fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
}

View file

@ -2,6 +2,7 @@ package rhel9
import (
"fmt"
"log"
"math/rand"
"strings"
@ -382,6 +383,17 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
return fmt.Errorf("edge raw images require specifying a URL from which to retrieve the OSTree commit")
}
// warn that user & group customizations on edge-commit, edge-container are deprecated
// TODO(edge): directly error if these options are provided when rhel-9.5's time arrives
if t.name == "edge-commit" || t.name == "edge-container" {
if customizations.GetUsers() != nil {
log.Printf("Please note that user customizations on %q image type are deprecated and will be removed in the near future\n", t.name)
}
if customizations.GetGroups() != nil {
log.Printf("Please note that group customizations on %q image type are deprecated and will be removed in the near future\n", t.name)
}
}
if kernelOpts := customizations.GetKernel(); kernelOpts.Append != "" && t.rpmOstree && t.name != "edge-raw-image" && t.name != "edge-simplified-installer" {
return fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
}