1
0
Fork 0
mirror of https://github.com/kastenhq/kubestr.git synced 2024-12-14 11:57:56 +00:00

Updating kanister version (#51)

* updating kanister version

* scheme usage change
This commit is contained in:
Sirish Bathina 2021-02-23 14:36:54 -10:00 committed by GitHub
parent 203a6ad53b
commit 4c133b2a78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 421 additions and 17 deletions

39
go.mod
View file

@ -5,31 +5,42 @@ go 1.14
replace github.com/graymeta/stow => github.com/kastenhq/stow v0.1.2-kasten
require (
github.com/Azure/azure-amqp-common-go/v2 v2.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/aws/aws-sdk-go v1.31.6 // indirect
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 // indirect
github.com/briandowns/spinner v1.12.0
github.com/coreos/bbolt v1.3.3 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/go-openapi/validate v0.19.5 // indirect
github.com/golang/mock v1.4.4
github.com/google/go-cmp v0.4.1 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/imdario/mergo v0.3.9 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f // indirect
github.com/hashicorp/go-hclog v0.9.2 // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
github.com/jarcoal/httpmock v1.0.5 // indirect
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7 // indirect
github.com/kanisterio/kanister v0.0.0-20210112095936-bf04d6102c72
github.com/kanisterio/kanister v0.0.0-20210223000054-31e45569f543
github.com/kr/text v0.2.0 // indirect
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.0.0
github.com/mitchellh/mapstructure v1.3.1 // indirect
github.com/minio/hdfs/v3 v3.0.1 // indirect
github.com/minio/lsync v1.0.1 // indirect
github.com/minio/minio-go/v6 v6.0.55 // indirect
github.com/minio/parquet-go v0.0.0-20200414234858-838cfa8aae61 // indirect
github.com/nats-io/gnatsd v1.4.1 // indirect
github.com/nats-io/go-nats v1.7.2 // indirect
github.com/nats-io/go-nats-streaming v0.4.4 // indirect
github.com/nats-io/nats-server v1.4.1 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/onsi/ginkgo v1.12.0 // indirect
github.com/onsi/gomega v1.9.0 // indirect
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20190704165056-9c2d0518ed81 // indirect
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/spf13/cobra v1.0.0
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d // indirect
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect
github.com/spf13/cobra v1.1.1
github.com/ugorji/go v1.1.5-pre // indirect
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
honnef.co/go/tools v0.0.1-2020.1.5 // indirect
k8s.io/api v0.19.5
k8s.io/apimachinery v0.19.5
k8s.io/client-go v0.19.5
k8s.io/api v0.20.1
k8s.io/apimachinery v0.20.1
k8s.io/client-go v0.20.1
)

386
go.sum

File diff suppressed because it is too large Load diff

View file

@ -484,7 +484,7 @@ func (c *snapshotCreate) CreateSnapshot(ctx context.Context, snapshotter kansnap
if err := args.Validate(); err != nil {
return nil, err
}
err := snapshotter.Create(ctx, args.SnapshotName, args.Namespace, args.PVCName, &args.VolumeSnapshotClass, true)
err := snapshotter.Create(ctx, args.SnapshotName, args.Namespace, args.PVCName, &args.VolumeSnapshotClass, true, nil)
if err != nil {
return nil, errors.Wrapf(err, "CSI Driver failed to create snapshot for PVC (%s) in Namspace (%s)", args.PVCName, args.Namespace)
}

View file

@ -876,7 +876,7 @@ func (f *fakeSnapshotter) GetVolumeSnapshotClass(annotationKey, annotationValue,
func (f *fakeSnapshotter) CloneVolumeSnapshotClass(sourceClassName, targetClassName, newDeletionPolicy string, excludeAnnotations []string) error {
return f.cvsErr
}
func (f *fakeSnapshotter) Create(ctx context.Context, name, namespace, pvcName string, snapshotClass *string, waitForReady bool) error {
func (f *fakeSnapshotter) Create(ctx context.Context, name, namespace, pvcName string, snapshotClass *string, waitForReady bool, labels map[string]string) error {
return f.createErr
}
func (f *fakeSnapshotter) Get(ctx context.Context, name, namespace string) (*snapv1.VolumeSnapshot, error) {
@ -902,6 +902,10 @@ func (f *fakeSnapshotter) WaitOnReadyToUse(ctx context.Context, snapshotName, na
return nil
}
func (f *fakeSnapshotter) List(ctx context.Context, namespace string, labels map[string]string) (*snapv1.VolumeSnapshotList, error) {
return nil, nil
}
func (s *CSITestSuite) TestDeletePVC(c *C) {
ctx := context.Background()
for _, tc := range []struct {

View file

@ -11,6 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
version "k8s.io/apimachinery/pkg/version"
discoveryfake "k8s.io/client-go/discovery/fake"
fakedynamic "k8s.io/client-go/dynamic/fake"
@ -204,7 +205,9 @@ func (s *ProvisionerTestSuite) TestLoadStorageClassesAndProvisioners(c *C) {
func (s *ProvisionerTestSuite) TestLoadVolumeSnaphsotClasses(c *C) {
ctx := context.Background()
p := &Kubestr{dynCli: fakedynamic.NewSimpleDynamicClient(runtime.NewScheme(), &unstructured.Unstructured{
scheme := runtime.NewScheme()
scheme.AddKnownTypeWithName(schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeSnapshotClassList"}, &unstructured.UnstructuredList{})
p := &Kubestr{dynCli: fakedynamic.NewSimpleDynamicClient(scheme, &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": fmt.Sprintf("%s/%s", v1alpha1.GroupName, v1alpha1.Version),
"kind": "VolumeSnapshotClass",