Documentation ¶
Index ¶
- Constants
- Variables
- type Check
- type WorkloadState
- type WorkloadStatus
- type WorkloadStatusDeprecatedIngress
- type WorkloadStatusDeprecatedRegistry
- type WorkloadStatusError
- type WorkloadStatusErrorLevel
- type WorkloadStatusFailedRun
- type WorkloadStatusInboundNetwork
- type WorkloadStatusInvalidNaisYaml
- type WorkloadStatusMissingSBOM
- type WorkloadStatusNewInstancesFailing
- type WorkloadStatusNoRunningInstances
- type WorkloadStatusOutboundNetwork
- type WorkloadStatusSynchronizationFailing
- type WorkloadStatusVulnerable
Constants ¶
View Source
const ( ApplicationOrderFieldStatus application.ApplicationOrderField = "STATUS" JobOrderFieldStatus job.JobOrderField = "STATUS" )
Variables ¶
View Source
var AllWorkloadStatusErrorLevel = []WorkloadStatusErrorLevel{ WorkloadStatusErrorLevelTodo, WorkloadStatusErrorLevelWarning, WorkloadStatusErrorLevelError, }
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 ¶
func (w WorkloadStatusDeprecatedIngress) GetLevel() WorkloadStatusErrorLevel
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 ¶
func (w WorkloadStatusDeprecatedRegistry) GetLevel() WorkloadStatusErrorLevel
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 ¶
func (w WorkloadStatusFailedRun) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusInboundNetwork ¶
type WorkloadStatusInboundNetwork struct { Level WorkloadStatusErrorLevel `json:"level"` Policy *netpol.NetworkPolicyRule `json:"policy"` }
func (WorkloadStatusInboundNetwork) GetLevel ¶
func (w WorkloadStatusInboundNetwork) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusInvalidNaisYaml ¶
type WorkloadStatusInvalidNaisYaml struct { Level WorkloadStatusErrorLevel `json:"level"` Detail string `json:"detail"` }
func (WorkloadStatusInvalidNaisYaml) GetLevel ¶
func (w WorkloadStatusInvalidNaisYaml) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusMissingSBOM ¶
type WorkloadStatusMissingSBOM struct {
Level WorkloadStatusErrorLevel `json:"level"`
}
func (WorkloadStatusMissingSBOM) GetLevel ¶
func (w WorkloadStatusMissingSBOM) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusNewInstancesFailing ¶
type WorkloadStatusNewInstancesFailing struct { Level WorkloadStatusErrorLevel `json:"level"` FailingInstances []string `json:"failingInstances"` }
func (WorkloadStatusNewInstancesFailing) GetLevel ¶
func (w WorkloadStatusNewInstancesFailing) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusNoRunningInstances ¶
type WorkloadStatusNoRunningInstances struct {
Level WorkloadStatusErrorLevel `json:"level"`
}
func (WorkloadStatusNoRunningInstances) GetLevel ¶
func (w WorkloadStatusNoRunningInstances) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusOutboundNetwork ¶
type WorkloadStatusOutboundNetwork struct { Level WorkloadStatusErrorLevel `json:"level"` Policy *netpol.NetworkPolicyRule `json:"policy"` }
func (WorkloadStatusOutboundNetwork) GetLevel ¶
func (w WorkloadStatusOutboundNetwork) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusSynchronizationFailing ¶
type WorkloadStatusSynchronizationFailing struct { Level WorkloadStatusErrorLevel `json:"level"` Detail string `json:"detail"` }
func (WorkloadStatusSynchronizationFailing) GetLevel ¶
func (w WorkloadStatusSynchronizationFailing) GetLevel() WorkloadStatusErrorLevel
type WorkloadStatusVulnerable ¶
type WorkloadStatusVulnerable struct { Level WorkloadStatusErrorLevel `json:"level"` Summary *vulnerability.ImageVulnerabilitySummary `json:"summary"` }
func (WorkloadStatusVulnerable) GetLevel ¶
func (w WorkloadStatusVulnerable) GetLevel() WorkloadStatusErrorLevel
Click to show internal directories.
Click to hide internal directories.