Skip to content

Commit

Permalink
added comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SivaanandM committed Jul 26, 2024
1 parent 11e6edd commit e5a48f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
13 changes: 7 additions & 6 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,13 @@ func (h *V1Client) DownloadLogs(uid string, logFetcherUID string) (io.Writer, er
return logfile, nil
}

// 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)
//params = params.WithUID(clusterUID).WithBody(upgradeSetting)
//_, err := h.Client.V1SpectroClustersUIDUpgradeSettings(params)
//if err != nil {
// return err
//}
params := clientv1.NewV1SpectroClustersUIDUpgradeSettingsParamsWithContext(h.ctx)
params = params.WithUID(clusterUID).WithBody(upgradeSetting)
_, err := h.Client.V1SpectroClustersUIDUpgradeSettings(params)
if err != nil {
return err
}
return nil
}
1 change: 1 addition & 0 deletions client/cluster_host_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func (h *V1Client) UpdateClusterHostConfig(uid string, config *models.V1HostClus
return err
}

// ApplyClusterHostConfig applies the specified host configuration to the cluster identified by the given UID.
func (h *V1Client) ApplyClusterHostConfig(uid string, config *models.V1HostClusterConfigEntity) error {
policy, err := h.GetClusterScanConfig(uid)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions client/node_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/spectrocloud/palette-api-go/models"
)

// GetMaintenanceStatus defines a function type that retrieves the maintenance status of a machine.
type GetMaintenanceStatus func(string, string, string) (*models.V1MachineMaintenanceStatus, error)

// ToggleMaintenanceOnNode updates maintenance configuration for a node.
Expand All @@ -20,6 +21,7 @@ func (h *V1Client) ToggleMaintenanceOnNode(nodeMaintenance *models.V1MachineMain
return err
}

// GetNodeMaintenanceStatus retrieves the maintenance status of a specific node.
func (h *V1Client) GetNodeMaintenanceStatus(fn GetMaintenanceStatus, configUid, machineName, nodeId string) (*models.V1MachineMaintenanceStatus, error) {

Check failure on line 25 in client/node_actions.go

View workflow job for this annotation

GitHub Actions / build-with-coverage

var-naming: method parameter configUid should be configUID (revive)
return fn(configUid, machineName, nodeId)
}
Expand Down Expand Up @@ -165,6 +167,8 @@ func (h *V1Client) GetNodeMaintenanceStatusGke(configUID, machineName, nodeID st
return resp.Payload.Status.MaintenanceStatus, nil
}

// GetNodeMaintenanceStatusGke retrieves maintenance status for a Libvirt node.

Check failure on line 170 in client/node_actions.go

View workflow job for this annotation

GitHub Actions / build-with-coverage

exported: comment on exported method V1Client.GetNodeMaintenanceStatusLibvirt should be of the form "GetNodeMaintenanceStatusLibvirt ..." (revive)
// TODO: libevirt deprecation
func (h *V1Client) GetNodeMaintenanceStatusLibvirt(ConfigUID, MachineName, NodeId string) (*models.V1MachineMaintenanceStatus, error) {

Check failure on line 172 in client/node_actions.go

View workflow job for this annotation

GitHub Actions / build-with-coverage

unused-parameter: parameter 'ConfigUID' seems to be unused, consider removing or renaming it as _ (revive)

//params := clientv1.NewV1CloudConfigsLibvirtPoolMachinesUIDGetParamsWithContext(h.ctx).
Expand Down

0 comments on commit e5a48f1

Please sign in to comment.