Skip to content

Commit

Permalink
PQA-2256: Added Download scan reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragavi916 committed Oct 29, 2024
1 parent 3782615 commit 8de9797
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,39 @@ func (h *V1Client) DownloadLogs(uid string, logFetcherUID string) (io.Writer, er
return logfile, nil
}

// DownloadKubeBenchReport downloads the KubeBench report for the specified cluster.
func (h *V1Client) DownloadKubeBenchReport(uid, logUID string, writer io.Writer) error {
params := clientv1.NewV1ClusterFeatureDriverLogDownloadParams().
WithUID(uid).
WithLogUID(logUID).
WithDriver("KubeBench")

_, err := h.Client.V1ClusterFeatureDriverLogDownload(params, writer)
return err
}

// DownloadKubeHunterReport downloads the KubeHunter report for the specified cluster.
func (h *V1Client) DownloadKubeHunterReport(uid, logUID string, writer io.Writer) error {
params := clientv1.NewV1ClusterFeatureDriverLogDownloadParams().
WithUID(uid).
WithLogUID(logUID).
WithDriver("KubeHunter")

_, err := h.Client.V1ClusterFeatureDriverLogDownload(params, writer)
return err
}

// DownloadSonobuoyReport downloads the Sonobuoy report for the specified cluster.
func (h *V1Client) DownloadSonobuoyReport(uid, logUID string, writer io.Writer) error {
params := clientv1.NewV1ClusterFeatureDriverLogDownloadParams().
WithUID(uid).
WithLogUID(logUID).
WithDriver("Sonobuoy")

_, err := h.Client.V1ClusterFeatureDriverLogDownload(params, writer)
return err
}

// UpdatePauseAgentUpgradeSettingCluster updates the upgrade settings of a specific cluster to pause the agent upgrade process.
func (h *V1Client) UpdatePauseAgentUpgradeSettingCluster(upgradeSetting *models.V1ClusterUpgradeSettingsEntity, clusterUID string) error {
params := clientv1.NewV1SpectroClustersUIDUpgradeSettingsParamsWithContext(h.ctx).WithUID(clusterUID).WithBody(upgradeSetting)
Expand Down

0 comments on commit 8de9797

Please sign in to comment.