diff --git a/Gopkg.lock b/Gopkg.lock index 5b9b00c5bb..cd5edc8ca7 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,80 +3,103 @@ [[projects]] branch = "master" + digest = "1:81f8c061c3d18ed1710957910542bc17d2b789c6cd19e0f654c30b35fd255ca5" name = "github.com/Azure/go-ansiterm" packages = [ ".", - "winterm" + "winterm", ] + pruneopts = "NUT" revision = "d6e3b3328b783f23731bc4d058875b0371ff8109" [[projects]] + digest = "1:d848e2bdc690ea54c4b49894b67a05db318a97ee6561879b814c2c1f82f61406" name = "github.com/Sirupsen/logrus" packages = ["."] + pruneopts = "NUT" revision = "bcd833dfe83d3cebad139e4a29ed79cb2318bf95" version = "v1.2.0" [[projects]] branch = "master" + digest = "1:707ebe952a8b3d00b343c01536c79c73771d100f63ec6babeaed5c79e2b8a8dd" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "NUT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] + digest = "1:94ffc0947c337d618b6ff5ed9abaddc1217b090c1b3a1ae4739b35b7b25851d5" name = "github.com/container-storage-interface/spec" packages = ["lib/go/csi"] + pruneopts = "NUT" revision = "ed0bb0e1557548aa028307f48728767cfe8f6345" version = "v1.0.0" [[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "NUT" revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" [[projects]] + digest = "1:53e99d883df3e940f5f0223795f300eb32b8c044f226132bfc0e74930f24ea4b" name = "github.com/docker/docker" packages = [ "pkg/term", - "pkg/term/windows" + "pkg/term/windows", ] + pruneopts = "NUT" revision = "092cba3727bb9b4a2f0e922cd6c0f93ea270e363" version = "v1.13.1" [[projects]] + digest = "1:32598368f409bbee79deb9d43569fcd92b9fb27f39155f5e166b3371217f051f" name = "github.com/evanphx/json-patch" packages = ["."] + pruneopts = "NUT" revision = "72bf35d0ff611848c1dc9df0f976c81192392fa5" version = "v4.1.0" [[projects]] + digest = "1:8679b8a64f3613e9749c5640c3535c83399b8e69f67ce54d91dc73f6d77373af" name = "github.com/gogo/protobuf" packages = [ "proto", - "sortkeys" + "sortkeys", ] + pruneopts = "NUT" revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] branch = "master" + digest = "1:e2b86e41f3d669fc36b50d31d32d22c8ac656c75aa5ea89717ce7177e134ff2a" name = "github.com/golang/glog" packages = ["."] + pruneopts = "NUT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] branch = "master" + digest = "1:3fb07f8e222402962fa190eb060608b34eddfb64562a18e2167df2de0ece85d8" name = "github.com/golang/groupcache" packages = ["lru"] + pruneopts = "NUT" revision = "c65c006176ff7ff98bb916961c7abbc6b0afc0aa" [[projects]] + digest = "1:bc38c7c481812e178d85160472e231c5e1c9a7f5845d67e23ee4e706933c10d8" name = "github.com/golang/mock" packages = ["gomock"] + pruneopts = "NUT" revision = "c34cdb4725f4c3844d095133c6e40e448b86589b" version = "v1.1.1" [[projects]] + digest = "1:bff0ce7c8e3d6357fa5a8549bbe4bdb620bddc13c11ae569aa7248ea92e2139f" name = "github.com/golang/protobuf" packages = [ "descriptor", @@ -86,91 +109,115 @@ "ptypes/any", "ptypes/duration", "ptypes/timestamp", - "ptypes/wrappers" + "ptypes/wrappers", ] + pruneopts = "NUT" revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" version = "v1.2.0" [[projects]] branch = "master" + digest = "1:05f95ffdfcf651bdb0f05b40b69e7f5663047f8da75c72d58728acb59b5cc107" name = "github.com/google/btree" packages = ["."] + pruneopts = "NUT" revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306" [[projects]] branch = "master" + digest = "1:52c5834e2bebac9030c97cc0798ac11c3aa8a39f098aeb419f142533da6cd3cc" name = "github.com/google/gofuzz" packages = ["."] + pruneopts = "NUT" revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] + digest = "1:56a1f3949ebb7fa22fa6b4e4ac0fe0f77cc4faee5b57413e6fa9199a8458faf1" name = "github.com/google/uuid" packages = ["."] + pruneopts = "NUT" revision = "9b3b1e0f5f99ae461456d768e7d301a7acdaa2d8" version = "v1.1.0" [[projects]] + digest = "1:06a7dadb7b760767341ffb6c8d377238d68a1226f2b21b5d497d2e3f6ecf6b4e" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", "compiler", - "extensions" + "extensions", ] + pruneopts = "NUT" revision = "7c663266750e7d82587642f65e60bc4083f1f84e" version = "v0.2.0" [[projects]] branch = "master" + digest = "1:7fdf3223c7372d1ced0b98bf53457c5e89d89aecbad9a77ba9fcc6e01f9e5621" name = "github.com/gregjones/httpcache" packages = [ ".", - "diskcache" + "diskcache", ] + pruneopts = "NUT" revision = "c63ab54fda8f77302f8d414e19933f2b6026a089" [[projects]] + digest = "1:b42cde0e1f3c816dd57f57f7bbcf05ca40263ad96f168714c130c611fc0856a6" name = "github.com/hashicorp/golang-lru" packages = [ ".", - "simplelru" + "simplelru", ] + pruneopts = "NUT" revision = "20f1fb78b0740ba8c3cb143a61e86ba5c8669768" version = "v0.5.0" [[projects]] + digest = "1:9a52adf44086cead3b384e5d0dbf7a1c1cce65e67552ee3383a8561c42a18cd3" name = "github.com/imdario/mergo" packages = ["."] + pruneopts = "NUT" revision = "9f23e2d6bd2a77f959b2bf6acdbefd708a83a4a4" version = "v0.3.6" [[projects]] + digest = "1:8e36686e8b139f8fe240c1d5cf3a145bc675c22ff8e707857cdd3ae17b00d728" name = "github.com/json-iterator/go" packages = ["."] + pruneopts = "NUT" revision = "1624edc4454b8682399def8740d46db5e4362ba4" version = "v1.1.5" [[projects]] + digest = "1:4059c14e87a2de3a434430340521b5feece186c1469eff0834c29a63870de3ed" name = "github.com/konsorten/go-windows-terminal-sequences" packages = ["."] + pruneopts = "NUT" revision = "5c8c8bd35d3832f5d134ae1e1e375b69a4d25242" version = "v1.0.1" [[projects]] + digest = "1:610f50d23ee3e0fa37d77fc23bf2c3b6897d2dc1c934739f13cdf551e9fc57d9" name = "github.com/kubernetes-csi/csi-lib-utils" packages = ["protosanitizer"] + pruneopts = "NUT" revision = "1628ab5351eafa4fc89a96862a08a891e601e03a" version = "v0.1.0" [[projects]] + digest = "1:cab5d1fe86e273b35887f707dbec779d77d87613d9f2f14ea23002912197ce81" name = "github.com/kubernetes-csi/csi-test" packages = [ "driver", - "utils" + "utils", ] + pruneopts = "NUT" revision = "619da6853e10bef67ddcc8f1c2b68b73154bf11d" version = "v1.0.0-rc2" [[projects]] + digest = "1:70e121796a8b5b538b08bf54c8d34245069a82300d8f6e8476874e4dfa450bf6" name = "github.com/kubernetes-csi/external-snapshotter" packages = [ "pkg/apis/volumesnapshot/v1alpha1", @@ -178,118 +225,148 @@ "pkg/client/clientset/versioned/fake", "pkg/client/clientset/versioned/scheme", "pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1", - "pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake" + "pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake", ] + pruneopts = "NUT" revision = "7f0070ed917ebab6e931cfa403e7e3e0e4490138" version = "v1.0.0-rc4" [[projects]] + digest = "1:62ae8171b490b175ddc0c1ef6fa0433ff7521f56c338a2e297678c997fb0e716" name = "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner" packages = [ "controller", "controller/metrics", - "util" + "util", ] - revision = "5cc6f1a2e9555b70c13b6036a7c52a4722e9493c" - version = "v2.0.0-alpha" + pruneopts = "NUT" + revision = "05ed9a38505973ea4f1c269bdf3d1dc9e44b777c" + version = "v2.0.0" [[projects]] + digest = "1:5985ef4caf91ece5d54817c11ea25f182697534f8ae6521eadcd628c142ac4b6" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "NUT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] + digest = "1:c56487cd684ec90714710940143f021e5866ccda72b872d74ac579f45b7fa3d3" name = "github.com/miekg/dns" packages = ["."] + pruneopts = "NUT" revision = "7064f7248f5fa5fd79382a76328b4e200b79e4ae" version = "v1.0.15" [[projects]] + digest = "1:2f42fa12d6911c7b7659738758631bec870b7e9b4c6be5444f963cdcfccc191f" name = "github.com/modern-go/concurrent" packages = ["."] + pruneopts = "NUT" revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" version = "1.0.3" [[projects]] + digest = "1:c6aca19413b13dc59c220ad7430329e2ec454cc310bc6d8de2c7e2b93c18a0f6" name = "github.com/modern-go/reflect2" packages = ["."] + pruneopts = "NUT" revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" [[projects]] + digest = "1:93b1d84c5fa6d1ea52f4114c37714cddd84d5b78f151b62bb101128dd51399bf" name = "github.com/pborman/uuid" packages = ["."] + pruneopts = "NUT" revision = "adf5a7427709b9deb95d29d3fa8a2bf9cfd388f1" version = "v1.2" [[projects]] branch = "master" + digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2" name = "github.com/petar/GoLLRB" packages = ["llrb"] + pruneopts = "NUT" revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" [[projects]] + digest = "1:6c6d91dc326ed6778783cff869c49fb2f61303cdd2ebbcf90abe53505793f3b6" name = "github.com/peterbourgon/diskv" packages = ["."] + pruneopts = "NUT" revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" version = "v2.0.1" [[projects]] + digest = "1:a8512715947d49f24e6aa2d0fdd06f46bdd8d2e792517ba0ac95a2c089eaae28" name = "github.com/prometheus/client_golang" packages = [ "prometheus", "prometheus/internal", - "prometheus/promhttp" + "prometheus/promhttp", ] + pruneopts = "NUT" revision = "abad2d1bd44235a26707c172eab6bca5bf2dbad3" version = "v0.9.1" [[projects]] branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "NUT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" + digest = "1:06375f3b602de9c99fa99b8484f0e949fd5273e6e9c6592b5a0dd4cd9085f3ea" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "NUT" revision = "aeab699e26f4d4089dba5e522e5d9babd2adbaf7" [[projects]] branch = "master" + digest = "1:102dea0c03a915acfc634b7c67f2662012b5483b56d9025e33f5188e112759b6" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs" + "xfs", ] + pruneopts = "NUT" revision = "185b4288413d2a0dd0806f78c90dde719829e5ae" [[projects]] + digest = "1:9d8420bbf131d1618bde6530af37c3799340d3762cc47210c1d9532a4c3a2779" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "NUT" revision = "298182f68c66c05229eb03ac171abe6e309ee79a" version = "v1.0.3" [[projects]] branch = "master" + digest = "1:583f2f436bab7b59a7bd3e759f1375b06f460760ed1f9235604d143eaab83009" name = "golang.org/x/crypto" packages = [ "ed25519", "ed25519/internal/edwards25519", - "ssh/terminal" + "ssh/terminal", ] + pruneopts = "NUT" revision = "3d3f9f413869b949e48070b5bc593aa22cc2b8f2" [[projects]] branch = "master" + digest = "1:c1117b8501c7d848516d1db06f1375cd0913b353763d5a40982344f3d5bb3dc6" name = "golang.org/x/net" packages = [ "bpf", @@ -304,29 +381,35 @@ "internal/timeseries", "ipv4", "ipv6", - "trace" + "trace", ] + pruneopts = "NUT" revision = "adae6a3d119ae4890b46832a2e88a95adc62b8e7" [[projects]] branch = "master" + digest = "1:eaed6885bd08c25f569dea6ced07a0730623466e27e6c41639fa4a3e1cbaaa76" name = "golang.org/x/oauth2" packages = [ ".", - "internal" + "internal", ] + pruneopts = "NUT" revision = "8f65e3013ebad444f13bc19536f7865efc793816" [[projects]] branch = "master" + digest = "1:1435bb97e37d0ba44239bcaf413539d3bcfc37098c24f1c795c49d654af5e956" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] + pruneopts = "NUT" revision = "ec83556a53fe16b65c452a104ea9d1e86a671852" [[projects]] + digest = "1:e7071ed636b5422cc51c0e3a6cebc229d6c9fffc528814b519a980641422d619" name = "golang.org/x/text" packages = [ "collate", @@ -342,18 +425,22 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable" + "unicode/rangetable", ] + pruneopts = "NUT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] branch = "master" + digest = "1:9fdc2b55e8e0fafe4b41884091e51e77344f7dc511c5acedcfd98200003bff90" name = "golang.org/x/time" packages = ["rate"] + pruneopts = "NUT" revision = "85acf8d2951cb2a3bde7632f9ff273ef0379bcbd" [[projects]] + digest = "1:655acbef8faad33db29b6a35655341fb4a594e87e56635f05a3e70ed0bd7bd95" name = "google.golang.org/appengine" packages = [ "internal", @@ -362,18 +449,22 @@ "internal/log", "internal/remote_api", "internal/urlfetch", - "urlfetch" + "urlfetch", ] + pruneopts = "NUT" revision = "4a4468ece617fc8205e99368fa2200e9d1fad421" version = "v1.3.0" [[projects]] branch = "master" + digest = "1:56b0bca90b7e5d1facf5fbdacba23e4e0ce069d25381b8e2f70ef1e7ebfb9c1a" name = "google.golang.org/genproto" packages = ["googleapis/rpc/status"] + pruneopts = "NUT" revision = "b5d43981345bdb2c233eb4bf3277847b48c6fdc6" [[projects]] + digest = "1:d0b680e0e10bfbcbf2e3fed13f7e2ba52096518341a176cce93400e23f427b0d" name = "google.golang.org/grpc" packages = [ ".", @@ -403,24 +494,30 @@ "resolver/passthrough", "stats", "status", - "tap" + "tap", ] + pruneopts = "NUT" revision = "2e463a05d100327ca47ac218281906921038fd95" version = "v1.16.0" [[projects]] + digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" packages = ["."] + pruneopts = "NUT" revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" version = "v0.9.1" [[projects]] + digest = "1:7c95b35057a0ff2e19f707173cc1a947fa43a6eb5c4d300d196ece0334046082" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "NUT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [[projects]] + digest = "1:c453ddc26bdab1e4267683a588ad9046e48d803a73f124fe2927adbab6ff02a5" name = "k8s.io/api" packages = [ "admissionregistration/v1alpha1", @@ -454,12 +551,14 @@ "settings/v1alpha1", "storage/v1", "storage/v1alpha1", - "storage/v1beta1" + "storage/v1beta1", ] + pruneopts = "NUT" revision = "d01564359763a39d310efc27866b63d4f5c92f1d" version = "kubernetes-1.13.0-beta.1" [[projects]] + digest = "1:b81d0fe2db41d154077527c004654d59d4f5bfd45d79aa159e777a2d44c336f0" name = "k8s.io/apimachinery" packages = [ "pkg/api/errors", @@ -505,22 +604,26 @@ "pkg/version", "pkg/watch", "third_party/forked/golang/json", - "third_party/forked/golang/reflect" + "third_party/forked/golang/reflect", ] + pruneopts = "NUT" revision = "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" version = "kubernetes-1.13.0-beta.1" [[projects]] + digest = "1:fd571a0b0a945e8f8cddda7a33b600cc4d0328be52dc9420b758324d217fca31" name = "k8s.io/apiserver" packages = [ "pkg/util/feature", "pkg/util/feature/testing", - "pkg/util/flag" + "pkg/util/flag", ] + pruneopts = "NUT" revision = "6b360527ed84a1a6bb3883faef76c71cc17499ba" version = "kubernetes-1.13.0-beta.1" [[projects]] + digest = "1:f6a1f2ac66fd4a03e9dda70c91b42c18db4830c262b41a2c6a537852e792af89" name = "k8s.io/client-go" packages = [ "discovery", @@ -694,12 +797,14 @@ "util/homedir", "util/integer", "util/retry", - "util/workqueue" + "util/workqueue", ] + pruneopts = "NUT" revision = "46a8dc78ec29761d6cb89a9eb50ddde947c84030" version = "kubernetes-1.13.0-beta.1" [[projects]] + digest = "1:2a675cf943e6dc6375162a5c7bdb35ddced6dc04a2f84f82faee7817ea46a97c" name = "k8s.io/csi-api" packages = [ "pkg/apis/csi/v1alpha1", @@ -707,41 +812,88 @@ "pkg/client/clientset/versioned/fake", "pkg/client/clientset/versioned/scheme", "pkg/client/clientset/versioned/typed/csi/v1alpha1", - "pkg/client/clientset/versioned/typed/csi/v1alpha1/fake" + "pkg/client/clientset/versioned/typed/csi/v1alpha1/fake", ] + pruneopts = "NUT" revision = "504ff913b8b7b6ee9cca269105b6c4a4c7923655" version = "kubernetes-1.13.0-beta.1" [[projects]] + digest = "1:9cc257b3c9ff6a0158c9c661ab6eebda1fe8a4a4453cd5c4044dc9a2ebfb992b" name = "k8s.io/klog" packages = ["."] + pruneopts = "NUT" revision = "a5bc97fbc634d635061f3146511332c7e313a55a" version = "v0.1.0" [[projects]] branch = "master" + digest = "1:03a96603922fc1f6895ae083e1e16d943b55ef0656b56965351bd87e7d90485f" name = "k8s.io/kube-openapi" packages = ["pkg/util/proto"] + pruneopts = "NUT" revision = "0317810137be915b9cf888946c6e115c1bfac693" [[projects]] + digest = "1:c7b9c8307ce2aa9f3d067c6d03e811b3a1c54bc42257f75a92a59f449d31679f" name = "k8s.io/kubernetes" packages = [ "pkg/apis/core", - "pkg/apis/core/helper" + "pkg/apis/core/helper", ] + pruneopts = "NUT" revision = "17c77c7898218073f14c8d573582e8d2313dc740" version = "v1.12.2" [[projects]] + digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" name = "sigs.k8s.io/yaml" packages = ["."] + pruneopts = "NUT" revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" version = "v1.1.0" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "4d77320cc7d1846c8da824a993e74b6b3a5921cf3221b856e9114e31e6a783ba" + input-imports = [ + "github.com/container-storage-interface/spec/lib/go/csi", + "github.com/golang/glog", + "github.com/golang/mock/gomock", + "github.com/kubernetes-csi/csi-lib-utils/protosanitizer", + "github.com/kubernetes-csi/csi-test/driver", + "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1", + "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned", + "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/fake", + "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller", + "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/util", + "github.com/spf13/pflag", + "google.golang.org/grpc", + "google.golang.org/grpc/codes", + "google.golang.org/grpc/connectivity", + "google.golang.org/grpc/status", + "k8s.io/api/core/v1", + "k8s.io/api/storage/v1beta1", + "k8s.io/apimachinery/pkg/api/resource", + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/runtime", + "k8s.io/apimachinery/pkg/types", + "k8s.io/apimachinery/pkg/util/json", + "k8s.io/apimachinery/pkg/util/sets", + "k8s.io/apimachinery/pkg/util/validation", + "k8s.io/apimachinery/pkg/util/wait", + "k8s.io/apiserver/pkg/util/feature", + "k8s.io/apiserver/pkg/util/feature/testing", + "k8s.io/apiserver/pkg/util/flag", + "k8s.io/client-go/kubernetes", + "k8s.io/client-go/kubernetes/fake", + "k8s.io/client-go/rest", + "k8s.io/client-go/testing", + "k8s.io/client-go/tools/clientcmd", + "k8s.io/csi-api/pkg/apis/csi/v1alpha1", + "k8s.io/csi-api/pkg/client/clientset/versioned", + "k8s.io/csi-api/pkg/client/clientset/versioned/fake", + "k8s.io/kubernetes/pkg/apis/core/helper", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index f916e175e9..113a9bba26 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -38,7 +38,7 @@ [[constraint]] name = "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner" - version = "v2.0.0-alpha" + version = "v2.0.0" [[constraint]] name = "google.golang.org/grpc" diff --git a/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/controller.go b/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/controller.go index 0878c51e19..0b5b866585 100644 --- a/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/controller.go +++ b/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/controller.go @@ -77,6 +77,9 @@ const annStorageProvisioner = "volume.beta.kubernetes.io/storage-provisioner" // be dynamically provisioned. Its value is the name of the selected node. const annSelectedNode = "volume.kubernetes.io/selected-node" +// Finalizer for PVs so we know to clean them up +const finalizerPV = "external-provisioner.volume.kubernetes.io/finalizer" + // ProvisionController is a controller that provisions PersistentVolumes for // PersistentVolumeClaims. type ProvisionController struct { @@ -848,10 +851,16 @@ func (ctrl *ProvisionController) shouldProvision(claim *v1.PersistentVolumeClaim // shouldDelete returns whether a volume should have its backing volume // deleted, i.e. whether a Delete is "desired" func (ctrl *ProvisionController) shouldDelete(volume *v1.PersistentVolume) bool { + if deletionGuard, ok := ctrl.provisioner.(DeletionGuard); ok { + if !deletionGuard.ShouldDelete(volume) { + return false + } + } + // In 1.9+ PV protection means the object will exist briefly with a // deletion timestamp even after our successful Delete. Ignore it. if ctrl.kubeVersion.AtLeast(utilversion.MustParseSemantic("v1.9.0")) { - if volume.ObjectMeta.DeletionTimestamp != nil { + if !ctrl.checkFinalizer(volume, finalizerPV) && volume.ObjectMeta.DeletionTimestamp != nil { return false } } @@ -893,6 +902,15 @@ func (ctrl *ProvisionController) canProvision(claim *v1.PersistentVolumeClaim) e return nil } +func (ctrl *ProvisionController) checkFinalizer(volume *v1.PersistentVolume, finalizer string) bool { + for _, f := range volume.ObjectMeta.Finalizers { + if f == finalizer { + return true + } + } + return false +} + func (ctrl *ProvisionController) updateProvisionStats(claim *v1.PersistentVolumeClaim, err error, startTime time.Time) { class := "" if claim.Spec.StorageClassName != nil { @@ -1028,6 +1046,11 @@ func (ctrl *ProvisionController) provisionClaimOperation(claim *v1.PersistentVol // Set ClaimRef and the PV controller will bind and set annBoundByController for us volume.Spec.ClaimRef = claimRef + // Add external provisioner finalizer if it doesn't already have it + if !ctrl.checkFinalizer(volume, finalizerPV) { + volume.ObjectMeta.Finalizers = append(volume.ObjectMeta.Finalizers, finalizerPV) + } + metav1.SetMetaDataAnnotation(&volume.ObjectMeta, annDynamicallyProvisioned, ctrl.provisionerName) if ctrl.kubeVersion.AtLeast(utilversion.MustParseSemantic("v1.6.0")) { volume.Spec.StorageClassName = claimClass @@ -1132,6 +1155,40 @@ func (ctrl *ProvisionController) deleteVolumeOperation(volume *v1.PersistentVolu return err } + if len(newVolume.ObjectMeta.Finalizers) > 0 { + // Remove external-provisioner finalizer + + // need to get the pv again because the delete has updated the object with a deletion timestamp + newVolume, err := ctrl.client.CoreV1().PersistentVolumes().Get(volume.Name, metav1.GetOptions{}) + if err != nil { + // If the volume is not found return, otherwise error + if !apierrs.IsNotFound(err) { + glog.Info(logOperation(operation, "failed to get persistentvolume to update finalizer: %v", err)) + return err + } + return nil + } + finalizers := make([]string, 0) + for _, finalizer := range newVolume.ObjectMeta.Finalizers { + if finalizer != finalizerPV { + finalizers = append(finalizers, finalizer) + } + } + + // Only update the finalizers if we actually removed something + if len(finalizers) != len(newVolume.ObjectMeta.Finalizers) { + newVolume.ObjectMeta.Finalizers = finalizers + if _, err = ctrl.client.CoreV1().PersistentVolumes().Update(newVolume); err != nil { + if !apierrs.IsNotFound(err) { + // Couldn't remove finalizer and the object still exists, the controller may + // try to remove the finalizer again on the next update + glog.Info(logOperation(operation, "failed to remove finalizer for persistentvolume: %v", err)) + return err + } + } + } + } + glog.Info(logOperation(operation, "persistentvolume deleted")) glog.Info(logOperation(operation, "succeeded")) diff --git a/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/volume.go b/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/volume.go index 92db4103ab..f1d42b7fce 100644 --- a/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/volume.go +++ b/vendor/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller/volume.go @@ -47,6 +47,13 @@ type Qualifier interface { ShouldProvision(*v1.PersistentVolumeClaim) bool } +// DeletionGuard is an optional interface implemented by provisioners to determine +// whether a PV should be deleted. +type DeletionGuard interface { + // ShouldDelete returns whether deleting the PV should be attempted. + ShouldDelete(volume *v1.PersistentVolume) bool +} + // BlockProvisioner is an optional interface implemented by provisioners to determine // whether it supports block volume. type BlockProvisioner interface {