Move all private annotations to shared package and update code

This commit is contained in:
Yecheng Fu
2019-05-04 23:57:50 +08:00
parent d5245b9563
commit 2d0d226371
9 changed files with 209 additions and 224 deletions

View File

@@ -43,6 +43,7 @@ import (
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/controller"
pvtesting "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/testing"
pvutil "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util"
vol "k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/util/recyclerclient"
)
@@ -275,7 +276,7 @@ func newVolume(name, capacity, boundToClaimUID, boundToClaimName string, phase v
volume.Annotations = make(map[string]string)
for _, a := range annotations {
switch a {
case annDynamicallyProvisioned:
case pvutil.AnnDynamicallyProvisioned:
volume.Annotations[a] = mockPluginName
default:
volume.Annotations[a] = "yes"
@@ -380,7 +381,7 @@ func newClaim(name, claimUID, capacity, boundToVolume string, phase v1.Persisten
claim.Annotations = make(map[string]string)
for _, a := range annotations {
switch a {
case annStorageProvisioner:
case pvutil.AnnStorageProvisioner:
claim.Annotations[a] = mockPluginName
default:
claim.Annotations[a] = "yes"