distro/*: move mount point allow list to disk
All distributions have exactly the same list of allowed mountpoint customization points. Therefore move it to `disk` and share it between all distros.
This commit is contained in:
parent
2b03a839f0
commit
1ca2efe6cf
5 changed files with 8 additions and 20 deletions
|
|
@ -46,10 +46,6 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
mountpointAllowList = []string{
|
||||
"/", "/var", "/opt", "/srv", "/usr", "/app", "/data", "/home", "/tmp",
|
||||
}
|
||||
|
||||
oscapProfileAllowList = []oscap.Profile{
|
||||
oscap.Ospp,
|
||||
oscap.PciDss,
|
||||
|
|
@ -700,7 +696,7 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
return fmt.Errorf("Custom mountpoints are not supported for ostree types")
|
||||
}
|
||||
|
||||
err := disk.CheckMountpoints(mountpoints, mountpointAllowList)
|
||||
err := disk.CheckMountpoints(mountpoints, disk.MountpointAllowList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ const (
|
|||
blueprintPkgsKey = "blueprint"
|
||||
)
|
||||
|
||||
var mountpointAllowList = []string{
|
||||
"/", "/var", "/opt", "/srv", "/usr", "/app", "/data", "/home", "/tmp",
|
||||
}
|
||||
|
||||
// RHEL-based OS image configuration defaults
|
||||
var defaultDistroImageConfig = &distro.ImageConfig{
|
||||
Timezone: "America/New_York",
|
||||
|
|
@ -437,7 +433,7 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
|
||||
mountpoints := customizations.GetFilesystems()
|
||||
|
||||
err := disk.CheckMountpoints(mountpoints, mountpointAllowList)
|
||||
err := disk.CheckMountpoints(mountpoints, disk.MountpointAllowList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,10 +69,6 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
mountpointAllowList = []string{
|
||||
"/", "/var", "/opt", "/srv", "/usr", "/app", "/data", "/home", "/tmp",
|
||||
}
|
||||
|
||||
// rhel8 allow all
|
||||
oscapProfileAllowList = []oscap.Profile{
|
||||
oscap.AnssiBp28Enhanced,
|
||||
|
|
@ -667,7 +663,7 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
return fmt.Errorf("Custom mountpoints are not supported for ostree types")
|
||||
}
|
||||
|
||||
err := disk.CheckMountpoints(mountpoints, mountpointAllowList)
|
||||
err := disk.CheckMountpoints(mountpoints, disk.MountpointAllowList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,10 +39,6 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
mountpointAllowList = []string{
|
||||
"/", "/var", "/opt", "/srv", "/usr", "/app", "/data", "/home", "/tmp",
|
||||
}
|
||||
|
||||
// rhel9 & cs9 share the same list
|
||||
// of allowed profiles so a single
|
||||
// allow list can be used
|
||||
|
|
@ -603,7 +599,7 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
return fmt.Errorf("Custom mountpoints are not supported for ostree types")
|
||||
}
|
||||
|
||||
err := disk.CheckMountpoints(mountpoints, mountpointAllowList)
|
||||
err := disk.CheckMountpoints(mountpoints, disk.MountpointAllowList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue