more linter hints
This commit is contained in:
parent
7d0ee30e58
commit
39e0b902c8
|
|
@ -23,6 +23,7 @@ THE SOFTWARE.
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
user "os/user"
|
user "os/user"
|
||||||
|
|
@ -121,7 +122,7 @@ func connect(clusterName string, master bool, replica string, psql bool, user st
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = exec.Stream(remotecommand.StreamOptions{
|
err = exec.StreamWithContext(context.TODO(), remotecommand.StreamOptions{
|
||||||
Stdin: os.Stdin,
|
Stdin: os.Stdin,
|
||||||
Stdout: os.Stdout,
|
Stdout: os.Stdout,
|
||||||
Stderr: os.Stderr,
|
Stderr: os.Stderr,
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ func version(namespace string) {
|
||||||
|
|
||||||
operatorDeployment := getPostgresOperator(client)
|
operatorDeployment := getPostgresOperator(client)
|
||||||
if operatorDeployment.Name == "" {
|
if operatorDeployment.Name == "" {
|
||||||
log.Fatal("make sure zalando's postgres operator is running")
|
log.Fatalf("make sure zalando's postgres operator is running in namespace %s", namespace)
|
||||||
}
|
}
|
||||||
operatorImage := operatorDeployment.Spec.Template.Spec.Containers[0].Image
|
operatorImage := operatorDeployment.Spec.Template.Spec.Containers[0].Image
|
||||||
imageDetails := strings.Split(operatorImage, ":")
|
imageDetails := strings.Split(operatorImage, ":")
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,13 @@ func (r *EBSVolumeResizer) DescribeVolumes(volumeIds []string) ([]VolumeProperti
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range volumeOutput.Volumes {
|
for _, v := range volumeOutput.Volumes {
|
||||||
if *v.VolumeType == "gp3" {
|
switch *v.VolumeType {
|
||||||
|
case "gp3":
|
||||||
p = append(p, VolumeProperties{VolumeID: *v.VolumeId, Size: *v.Size, VolumeType: *v.VolumeType, Iops: *v.Iops, Throughput: *v.Throughput})
|
p = append(p, VolumeProperties{VolumeID: *v.VolumeId, Size: *v.Size, VolumeType: *v.VolumeType, Iops: *v.Iops, Throughput: *v.Throughput})
|
||||||
} else if *v.VolumeType == "gp2" {
|
case "gp2":
|
||||||
p = append(p, VolumeProperties{VolumeID: *v.VolumeId, Size: *v.Size, VolumeType: *v.VolumeType})
|
p = append(p, VolumeProperties{VolumeID: *v.VolumeId, Size: *v.Size, VolumeType: *v.VolumeType})
|
||||||
} else {
|
default:
|
||||||
return nil, fmt.Errorf("Discovered unexpected volume type %s %s", *v.VolumeId, *v.VolumeType)
|
return nil, fmt.Errorf("discovered unexpected volume type %s %s", *v.VolumeId, *v.VolumeType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue