artifact

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDecodeYAML = errors.New("unable to decode YAML into seccomp, selinux or apparmor profile")

ErrDecodeYAML is the error returned if no matching type could be decoded on artifact pull.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	// contains filtered or unexported fields
}

Artifact is the main structure of this package.

func New

func New(logger logr.Logger) *Artifact

New returns a new Artifact instance.

func (*Artifact) Pull

func (a *Artifact) Pull(c context.Context, from, username, password string) (*PullResult, error)

Pull a profile from a remote location.

func (*Artifact) Push

func (a *Artifact) Push(file, to, username, password string, annotations map[string]string) error

Push a profile to a remote location.

type PullResult

type PullResult struct {
	// contains filtered or unexported fields
}

PullResult is the type returned by Pull.

func (*PullResult) ApparmorProfile

func (p *PullResult) ApparmorProfile() *apparmorprofileapi.AppArmorProfile

ApparmorProfile returns the apparmor profile of the PullResult.

func (*PullResult) Content

func (p *PullResult) Content() []byte

Content returns the raw byte content of the profile.

func (*PullResult) SeccompProfile

func (p *PullResult) SeccompProfile() *seccompprofileapi.SeccompProfile

SeccompProfile returns the seccomp profile of the PullResult.

func (*PullResult) SelinuxProfile

func (p *PullResult) SelinuxProfile() *selinuxprofileapi.SelinuxProfile

SelinuxProfile returns the selinux profile of the PullResult.

func (*PullResult) Type

func (p *PullResult) Type() PullResultType

Type returns the PullResultType of the PullResult.

type PullResultType

type PullResultType string

PullResultType are the different types returned for a PullResult.

const (
	// PullResultTypeSeccompProfile is referencing a seccomp profile.
	PullResultTypeSeccompProfile PullResultType = "SeccompProfile"

	// PullResultTypeSelinuxProfile is referencing a SELinux profile.
	PullResultTypeSelinuxProfile PullResultType = "SelinuxProfile"

	// PullResultTypeApparmorProfile is referencing a AppArmor profile.
	PullResultTypeApparmorProfile PullResultType = "ApparmorProfile"
)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL