Blame internal/osbuild/selinux_stage.go

Packit 63bb0d
package osbuild
Packit 63bb0d
Packit 63bb0d
// The SELinuxStageOptions describe how to apply selinux labels.
Packit 63bb0d
//
Packit 63bb0d
// A file contexts configuration file is sepcified that describes
Packit 63bb0d
// the filesystem labels to apply to the image.
Packit 63bb0d
type SELinuxStageOptions struct {
Packit 63bb0d
	FileContexts string            `json:"file_contexts"`
Packit 63bb0d
	Labels       map[string]string `json:"labels,omitempty"`
Packit 63bb0d
}
Packit 63bb0d
Packit 63bb0d
func (SELinuxStageOptions) isStageOptions() {}
Packit 63bb0d
Packit 63bb0d
// NewSELinuxStageOptions creates a new SELinuxStaeOptions object, with
Packit 63bb0d
// the mandatory fields set.
Packit 63bb0d
func NewSELinuxStageOptions(fileContexts string) *SELinuxStageOptions {
Packit 63bb0d
	return &SELinuxStageOptions{
Packit 63bb0d
		FileContexts: fileContexts,
Packit 63bb0d
	}
Packit 63bb0d
}
Packit 63bb0d
Packit 63bb0d
// NewSELinuxStage creates a new SELinux Stage object.
Packit 63bb0d
func NewSELinuxStage(options *SELinuxStageOptions) *Stage {
Packit 63bb0d
	return &Stage{
Packit 63bb0d
		Name:    "org.osbuild.selinux",
Packit 63bb0d
		Options: options,
Packit 63bb0d
	}
Packit 63bb0d
}