update kubectl-pg plugin (#1264)

* update kubectl-pg plugin
* fix remaining build issues and update go modules
* some more README updates
This commit is contained in:
Felix Kunde
2021-02-15 17:13:07 +01:00
committed by GitHub
parent 17da6bc649
commit 837f845a1c
18 changed files with 837 additions and 313 deletions
+6 -4
View File
@@ -23,15 +23,17 @@ THE SOFTWARE.
package cmd
import (
"context"
"encoding/json"
"fmt"
"log"
"strconv"
"github.com/spf13/cobra"
PostgresqlLister "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"log"
"strconv"
)
// extVolumeCmd represents the extVolume command
@@ -63,7 +65,7 @@ func extVolume(increasedVolumeSize string, clusterName string) {
}
namespace := getCurrentNamespace()
postgresql, err := postgresConfig.Postgresqls(namespace).Get(clusterName, metav1.GetOptions{})
postgresql, err := postgresConfig.Postgresqls(namespace).Get(context.TODO(), clusterName, metav1.GetOptions{})
if err != nil {
log.Fatalf("hii %v", err)
}
@@ -86,7 +88,7 @@ func extVolume(increasedVolumeSize string, clusterName string) {
if newSize.Value() > oldSize.Value() {
patchInstances := volumePatch(newSize)
response, err := postgresConfig.Postgresqls(namespace).Patch(postgresql.Name, types.MergePatchType, patchInstances, "")
response, err := postgresConfig.Postgresqls(namespace).Patch(context.TODO(), postgresql.Name, types.MergePatchType, patchInstances, metav1.PatchOptions{})
if err != nil {
log.Fatal(err)
}