v1alpha1

package
v0.4.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScanStatus

func NewScanStatus(scans []v1alpha1.ClusterScan) (map[string]*PluginStatus, *int)

func NewScanStatusWithIssues

func NewScanStatusWithIssues(scans []v1alpha1.ClusterScan, issues []v1alpha1.ClusterIssue) map[string]*PluginStatus

Types

type Cluster

type Cluster struct {
	ApiVersion        string                   `json:"apiVersion"`
	Name              string                   `json:"name"`
	Namespace         string                   `json:"namespace"`
	Environment       string                   `json:"environment"`
	Provider          string                   `json:"provider"`
	Region            string                   `json:"region"`
	TotalNodes        *int                     `json:"totalNodes"`
	Version           string                   `json:"version"`
	Connection        *ConnectionStatus        `json:"connection"`
	Resources         *Resources               `json:"resources"`
	CreationTimestamp metav1.Time              `json:"creationTimestamp"`
	TotalIssues       *int                     `json:"totalIssues"`
	PluginStatus      map[string]*PluginStatus `json:"pluginStatus"`
}

func NewCluster

func NewCluster(cluster v1alpha1.Cluster) Cluster

NewCluster returns a Cluster without pluginStatus and issues

func NewClusterWithIssues

func NewClusterWithIssues(cluster v1alpha1.Cluster, scans []v1alpha1.ClusterScan, issues []v1alpha1.ClusterIssue) Cluster

NewClusterWithIssues returns a Cluster with pluginStatus and their issues

func NewClusterWithScans

func NewClusterWithScans(cluster v1alpha1.Cluster, scans []v1alpha1.ClusterScan) Cluster

NewClusterWithScans returns a Cluster with pluginStatus and without issues

type ClusterReference

type ClusterReference struct {
	Name           string `json:"name"`
	Namespace      string `json:"namespace"`
	TotalResources int    `json:"totalResources"`
}

type ConnectionStatus

type ConnectionStatus struct {
	Connected bool   `json:"connected"`
	Message   string `json:"message"`
}

type Issue

type Issue struct {
	ApiVersion string             `json:"apiVersion"`
	ID         string             `json:"id"`
	Message    string             `json:"message"`
	Severity   string             `json:"severity"`
	Category   string             `json:"category"`
	Plugin     string             `json:"plugin"`
	Clusters   []ClusterReference `json:"clusters"`
	Url        string             `json:"url"`
}

func NewIssue

func NewIssue(clusterIssue v1alpha1.ClusterIssue) Issue

func NewIssues

func NewIssues(clusterIssues []v1alpha1.ClusterIssue) []Issue

type NsName

type NsName struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type PluginStatus

type PluginStatus struct {
	Scan                   *ScanStatus      `json:"scan"`
	IssueCount             *int             `json:"issueCount"`
	Issues                 []ResourcedIssue `json:"issues"`
	LastSuccessfulScanTime *metav1.Time     `json:"lastSuccessfulScanTime"`
	LastFinishedScanTime   *metav1.Time     `json:"lastFinishedScanTime"`
	NextScheduleScanTime   *metav1.Time     `json:"nextScheduleScanTime"`
	Schedule               string           `json:"schedule"`
}

type Resource

type Resource struct {
	Available       string `json:"available"`
	Usage           string `json:"usage"`
	UsagePercentage int32  `json:"usagePercentage"`
}

type ResourcedIssue

type ResourcedIssue struct {
	Issue     `json:",inline"`
	Resources map[string][]NsName `json:"resources"`
}

func NewResourcedIssue

func NewResourcedIssue(i v1alpha1.ClusterIssue) ResourcedIssue

type Resources

type Resources struct {
	Discovered bool      `json:"discovered"`
	Message    string    `json:"message"`
	Memory     *Resource `json:"memory"`
	CPU        *Resource `json:"cpu"`
}

type ScanStatus

type ScanStatus struct {
	Status  ScanStatusType `json:"status"`
	Message string         `json:"message"`
	Suspend bool           `json:"suspend"`
}

type ScanStatusType

type ScanStatusType string
const (
	Failed  ScanStatusType = "failed"
	Unknown ScanStatusType = "unknown"
	Scanned ScanStatusType = "scanned"
)

Jump to

Keyboard shortcuts

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