Blame internal/osbuild2/selinux_stage.go

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