Documentation ¶
Index ¶
- func NewScanStatus(clusterScan *v1alpha1.ClusterScan, scans []v1alpha1.ClusterScan) (map[string]*PluginStatus, *int)
- func NewScanStatusWithIssues(clusterScan *v1alpha1.ClusterScan, scans []v1alpha1.ClusterScan, ...) map[string]*PluginStatus
- type Client
- type Cluster
- type ClusterHook
- type ClusterReference
- type ClusterScanHook
- type ConnectionStatus
- type Issue
- type NamespacedName
- type PluginStatus
- type Resource
- type ResourcedIssue
- type Resources
- type ScanStatus
- type ScanStatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewScanStatus ¶
func NewScanStatus(clusterScan *v1alpha1.ClusterScan, scans []v1alpha1.ClusterScan) (map[string]*PluginStatus, *int)
func NewScanStatusWithIssues ¶
func NewScanStatusWithIssues(clusterScan *v1alpha1.ClusterScan, scans []v1alpha1.ClusterScan, issues []v1alpha1.ClusterIssue) map[string]*PluginStatus
Types ¶
type Client ¶
type Client interface { PutCluster(ctx context.Context, cluster Cluster) error DeleteCluster(ctx context.Context, namespace, name string) error PutClusterScan(ctx context.Context, namespace, name string, pluginStatus map[string]*PluginStatus) error DeleteClusterScan(ctx context.Context, namespace, name string) error PutVulnerabilityReport(ctx context.Context, namespace, name string, vulnReport v1alpha1.VulnerabilityReport) error PutClusterStatus(ctx context.Context, namespace, name string, pluginStatus map[string]*PluginStatus) error }
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 ¶
NewCluster returns a Cluster without pluginStatus and issues
type ClusterHook ¶
func DeleteClusterHook ¶
func DeleteClusterHook(saasClient Client) ClusterHook
func UpdateClusterHook ¶
func UpdateClusterHook(saasClient Client) ClusterHook
type ClusterReference ¶
type ClusterScanHook ¶
type ClusterScanHook func(ctx context.Context, clusterScan *v1alpha1.ClusterScan) error
func DeleteClusterScanHook ¶
func DeleteClusterScanHook(saasClient Client, c ctrlClient.Client) ClusterScanHook
func UpdateClusterScanHook ¶
func UpdateClusterScanHook(saasClient Client, c ctrlClient.Client) ClusterScanHook
type ConnectionStatus ¶
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"` Url string `json:"url"` ClusterScoped bool `json:"clusterScoped"` Custom bool `json:"custom"` }
func NewIssue ¶
func NewIssue(clusterIssue v1alpha1.ClusterIssue) Issue
type NamespacedName ¶
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"` LastSuccessfulScanID string `json:"lastSuccessfulScanID"` }
type ResourcedIssue ¶
type ResourcedIssue struct { Issue `json:",inline"` Resources map[string][]NamespacedName `json:"resources"` }
func NewResourcedIssue ¶
func NewResourcedIssue(i v1alpha1.ClusterIssue) ResourcedIssue
type ScanStatus ¶
type ScanStatus struct { Status ScanStatusType `json:"status"` Message string `json:"message"` Suspend bool `json:"suspend"` ID string `json:"id"` }
type ScanStatusType ¶
type ScanStatusType string
const ( Failed ScanStatusType = "failed" Unknown ScanStatusType = "unknown" Scanned ScanStatusType = "scanned" )
Click to show internal directories.
Click to hide internal directories.