status

package
v0.0.0-...-10dfb09 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationOrderFieldStatus application.ApplicationOrderField = "STATUS"
	JobOrderFieldStatus         job.JobOrderField                 = "STATUS"
)

Variables

Functions

This section is empty.

Types

type Check

type Check interface {
	// Run the check for the given workload.
	// Returns a list of errors and the state of the workload.
	Run(ctx context.Context, w workload.Workload) ([]WorkloadStatusError, WorkloadState)
	// Supports returns true if the check supports the given workload.
	Supports(w workload.Workload) bool
}

Check is an interface for checking the status of a workload. The implementation should not keep any state.

type WorkloadState

type WorkloadState int
const (
	WorkloadStateUnknown WorkloadState = iota
	WorkloadStateNais
	WorkloadStateNotNais
	WorkloadStateFailing
)

func (WorkloadState) IsValid

func (e WorkloadState) IsValid() bool

func (WorkloadState) MarshalGQL

func (e WorkloadState) MarshalGQL(w io.Writer)

func (WorkloadState) String

func (e WorkloadState) String() string

func (*WorkloadState) UnmarshalGQL

func (e *WorkloadState) UnmarshalGQL(v interface{}) error

type WorkloadStatus

type WorkloadStatus struct {
	State  WorkloadState         `json:"state"`
	Errors []WorkloadStatusError `json:"errors"`
}

func ForWorkload

func ForWorkload(ctx context.Context, w workload.Workload) *WorkloadStatus

type WorkloadStatusDeprecatedIngress

type WorkloadStatusDeprecatedIngress struct {
	Level   WorkloadStatusErrorLevel `json:"level"`
	Ingress string                   `json:"ingress"`
}

func (WorkloadStatusDeprecatedIngress) GetLevel

type WorkloadStatusDeprecatedRegistry

type WorkloadStatusDeprecatedRegistry struct {
	Level      WorkloadStatusErrorLevel `json:"level"`
	Registry   string                   `json:"registry"`
	Repository string                   `json:"repository"`
	Name       string                   `json:"name"`
	Tag        string                   `json:"tag"`
}

func (WorkloadStatusDeprecatedRegistry) GetLevel

type WorkloadStatusError

type WorkloadStatusError interface {
	GetLevel() WorkloadStatusErrorLevel
}

func ForWorkloads

func ForWorkloads[T workload.Workload](ctx context.Context, workloads []T) []WorkloadStatusError

type WorkloadStatusErrorLevel

type WorkloadStatusErrorLevel int
const (
	WorkloadStatusErrorLevelUnknown WorkloadStatusErrorLevel = iota
	WorkloadStatusErrorLevelTodo
	WorkloadStatusErrorLevelWarning
	WorkloadStatusErrorLevelError
)

func (WorkloadStatusErrorLevel) IsValid

func (e WorkloadStatusErrorLevel) IsValid() bool

func (WorkloadStatusErrorLevel) MarshalGQL

func (e WorkloadStatusErrorLevel) MarshalGQL(w io.Writer)

func (WorkloadStatusErrorLevel) String

func (e WorkloadStatusErrorLevel) String() string

func (*WorkloadStatusErrorLevel) UnmarshalGQL

func (e *WorkloadStatusErrorLevel) UnmarshalGQL(v interface{}) error

type WorkloadStatusFailedRun

type WorkloadStatusFailedRun struct {
	Level  WorkloadStatusErrorLevel `json:"level"`
	Detail string                   `json:"message"`
	Name   string                   `json:"name"`
}

func (WorkloadStatusFailedRun) GetLevel

type WorkloadStatusInboundNetwork

type WorkloadStatusInboundNetwork struct {
	Level  WorkloadStatusErrorLevel  `json:"level"`
	Policy *netpol.NetworkPolicyRule `json:"policy"`
}

func (WorkloadStatusInboundNetwork) GetLevel

type WorkloadStatusInvalidNaisYaml

type WorkloadStatusInvalidNaisYaml struct {
	Level  WorkloadStatusErrorLevel `json:"level"`
	Detail string                   `json:"detail"`
}

func (WorkloadStatusInvalidNaisYaml) GetLevel

type WorkloadStatusMissingSBOM

type WorkloadStatusMissingSBOM struct {
	Level WorkloadStatusErrorLevel `json:"level"`
}

func (WorkloadStatusMissingSBOM) GetLevel

type WorkloadStatusNewInstancesFailing

type WorkloadStatusNewInstancesFailing struct {
	Level            WorkloadStatusErrorLevel `json:"level"`
	FailingInstances []string                 `json:"failingInstances"`
}

func (WorkloadStatusNewInstancesFailing) GetLevel

type WorkloadStatusNoRunningInstances

type WorkloadStatusNoRunningInstances struct {
	Level WorkloadStatusErrorLevel `json:"level"`
}

func (WorkloadStatusNoRunningInstances) GetLevel

type WorkloadStatusOutboundNetwork

type WorkloadStatusOutboundNetwork struct {
	Level  WorkloadStatusErrorLevel  `json:"level"`
	Policy *netpol.NetworkPolicyRule `json:"policy"`
}

func (WorkloadStatusOutboundNetwork) GetLevel

type WorkloadStatusSynchronizationFailing

type WorkloadStatusSynchronizationFailing struct {
	Level  WorkloadStatusErrorLevel `json:"level"`
	Detail string                   `json:"detail"`
}

func (WorkloadStatusSynchronizationFailing) GetLevel

type WorkloadStatusVulnerable

type WorkloadStatusVulnerable struct {
	Level   WorkloadStatusErrorLevel                 `json:"level"`
	Summary *vulnerability.ImageVulnerabilitySummary `json:"summary"`
}

func (WorkloadStatusVulnerable) GetLevel

Jump to

Keyboard shortcuts

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