Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PQA-2256: Added support for Download scan reports #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading