Skip to content

Commit

Permalink
Merge branch 'main' into cz-golang-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
chipzoller authored May 21, 2024
2 parents 7a60111 + 56989d3 commit e5e334b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions cmd/diskautoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ func main() {

pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
viper.BindPFlags(pflag.CommandLine)

pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
viper.BindPFlags(pflag.CommandLine)
err := viper.BindPFlags(pflag.CommandLine)
if err != nil {
log.Error().Msgf("viper.BindPFlags(): unable to bing flags with err: %v", err)
}

zerolog.SetGlobalLevel(zerolog.InfoLevel)
if logLevelStr := viper.GetString(logLevelConf); len(logLevelStr) > 0 {
Expand Down
8 changes: 4 additions & 4 deletions pkg/diskscaler/diskscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,27 +631,27 @@ func (ds *DiskScaler) dataMoverTransientPod(ctx context.Context, namespace strin
Image: "ubuntu",
Command: []string{"/bin/bash", "-c", "sleep infinity"},
VolumeMounts: []v1.VolumeMount{
v1.VolumeMount{
{
Name: "orig-vol-mount",
MountPath: "/oldData",
},
v1.VolumeMount{
{
Name: "backup-vol-mount",
MountPath: "/newData",
},
},
},
},
Volumes: []v1.Volume{
v1.Volume{
{
Name: "orig-vol-mount",
VolumeSource: v1.VolumeSource{
PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{
ClaimName: originalPVC,
},
},
},
v1.Volume{
{
Name: "backup-vol-mount",
VolumeSource: v1.VolumeSource{
PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{
Expand Down
2 changes: 1 addition & 1 deletion pkg/diskscaler/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (dss *DiskScalerService) getDiskScalerDeploymentWorkload(ctx context.Contex
}

func (dss *DiskScalerService) run(diskAutoScalerRun string) (RunStatus, error) {
status := RunStatus{}
var status RunStatus
serviceCtx := context.Background()
getDeploymentContext, cancel := context.WithTimeout(context.WithValue(serviceCtx, diskScalerServiceContextKey, "getDeployment"), 60*time.Second)
defer cancel()
Expand Down
4 changes: 2 additions & 2 deletions pkg/pvsizingrecommendation/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"path"
Expand Down Expand Up @@ -183,7 +183,7 @@ func (krs *KubecostService) getFromCacheOrFetch(window string, overheadPercent s
return []byte{}, fmt.Errorf("executing query: %w", err)
}
defer resp.Body.Close()
respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return []byte{}, fmt.Errorf("reading response body: %s", err)
}
Expand Down

0 comments on commit e5e334b

Please sign in to comment.