runtime

package
v0.0.0-...-24a1412 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package runtime contains the structs and definitions consumed by Preflight at runtime.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCSVTimeout          = 180 * time.Second
	DefaultSubscriptionTimeout = 180 * time.Second
	DefaultScorecardWaitTime   = "240"
)

Functions

func PyxisHostLookup

func PyxisHostLookup(pyxisEnv, hostOverride string) string

func ScorecardImage

func ScorecardImage(ctx context.Context, userProvidedScorecardImage string) string

ScorecardImage returns the container image used for OperatorSDK Scorecard based checks. If userProvidedScorecardImage is set, it is returned, otherwise, the default is returned.

Types

type AssetData

type AssetData struct {
	Images []string `json:"images"`
}

Assets is the publicly accessible representation of Preflight's used assets. This struct will be serialized to JSON and presented to the end-user when requested.

func Assets

func Assets(ctx context.Context) AssetData

Assets returns a full collection of assets used in Preflight.

type Config

type Config struct {
	Image          string
	Policy         policy.Policy
	ResponseFormat string
	Bundle         bool
	Scratch        bool
	LogFile        string
	Artifacts      string
	WriteJUnit     bool
	// Container-Specific Fields
	CertificationProjectID string
	PyxisHost              string
	PyxisAPIToken          string
	DockerConfig           string
	Submit                 bool
	Platform               string
	Insecure               bool
	Offline                bool
	ManifestListDigest     string
	// Operator-Specific Fields
	Namespace           string
	ServiceAccount      string
	ScorecardImage      string
	ScorecardWaitTime   string
	Channel             string
	IndexImage          string
	Kubeconfig          string
	CSVTimeout          time.Duration
	SubscriptionTimeout time.Duration
}

Config contains configuration details for running preflight.

func NewConfigFrom

func NewConfigFrom(vcfg viper.Viper) (*Config, error)

NewConfigFrom will return a runtime.Config based on the stored inputs in the provided viper.Viper. Note that shared configuration should be set in this function, and not in policy-specific functions. Defaults, should also be set after this function has been called.

func (*Config) CraneDockerConfig

func (c *Config) CraneDockerConfig() string

This is to satisfy the CraneConfig interface

func (*Config) CraneInsecure

func (c *Config) CraneInsecure() bool

func (*Config) CranePlatform

func (c *Config) CranePlatform() string

func (*Config) ReadOnly

func (c *Config) ReadOnly() *ReadOnlyConfig

ReadOnly returns an uneditably configuration.

type OpenshiftClusterVersion

type OpenshiftClusterVersion struct {
	Name    string
	Version string
}

func UnknownOpenshiftClusterVersion

func UnknownOpenshiftClusterVersion() OpenshiftClusterVersion

type ReadOnlyConfig

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

ReadOnlyConfig is a Config that cannot be modified. It implements certification.Configurable.

func (*ReadOnlyConfig) Artifacts

func (ro *ReadOnlyConfig) Artifacts() string

func (*ReadOnlyConfig) CSVTimeout

func (ro *ReadOnlyConfig) CSVTimeout() time.Duration

func (*ReadOnlyConfig) CertificationProjectID

func (ro *ReadOnlyConfig) CertificationProjectID() string

func (*ReadOnlyConfig) Channel

func (ro *ReadOnlyConfig) Channel() string

func (*ReadOnlyConfig) DockerConfig

func (ro *ReadOnlyConfig) DockerConfig() string

func (*ReadOnlyConfig) Image

func (ro *ReadOnlyConfig) Image() string

func (*ReadOnlyConfig) IndexImage

func (ro *ReadOnlyConfig) IndexImage() string

func (*ReadOnlyConfig) Insecure

func (ro *ReadOnlyConfig) Insecure() bool

func (*ReadOnlyConfig) IsBundle

func (ro *ReadOnlyConfig) IsBundle() bool

func (*ReadOnlyConfig) IsScratch

func (ro *ReadOnlyConfig) IsScratch() bool

func (*ReadOnlyConfig) Kubeconfig

func (ro *ReadOnlyConfig) Kubeconfig() string

func (*ReadOnlyConfig) LogFile

func (ro *ReadOnlyConfig) LogFile() string

func (*ReadOnlyConfig) Namespace

func (ro *ReadOnlyConfig) Namespace() string

func (*ReadOnlyConfig) Platform

func (ro *ReadOnlyConfig) Platform() string

func (*ReadOnlyConfig) Policy

func (ro *ReadOnlyConfig) Policy() policy.Policy

func (*ReadOnlyConfig) PyxisAPIToken

func (ro *ReadOnlyConfig) PyxisAPIToken() string

func (*ReadOnlyConfig) PyxisHost

func (ro *ReadOnlyConfig) PyxisHost() string

func (*ReadOnlyConfig) ResponseFormat

func (ro *ReadOnlyConfig) ResponseFormat() string

func (*ReadOnlyConfig) ScorecardImage

func (ro *ReadOnlyConfig) ScorecardImage() string

func (*ReadOnlyConfig) ScorecardWaitTime

func (ro *ReadOnlyConfig) ScorecardWaitTime() string

func (*ReadOnlyConfig) ServiceAccount

func (ro *ReadOnlyConfig) ServiceAccount() string

func (*ReadOnlyConfig) Submit

func (ro *ReadOnlyConfig) Submit() bool

func (*ReadOnlyConfig) WriteJUnit

func (ro *ReadOnlyConfig) WriteJUnit() bool

type ResultWriterFile

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

ResultWriterFile implements a ResultWriter for use at preflight runtime.

func (*ResultWriterFile) Close

func (f *ResultWriterFile) Close() error

func (*ResultWriterFile) OpenFile

func (f *ResultWriterFile) OpenFile(name string) (io.WriteCloser, error)

OpenFile will open the expected file for writing.

func (*ResultWriterFile) Write

func (f *ResultWriterFile) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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