mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 19:28:16 +00:00
Implement external provisioning proposal
In other words, add "provisioned-by" annotation to all PVCs that should be provisioned dynamically.
This commit is contained in:
@@ -750,6 +750,8 @@ func newClaim(name, claimUID, capacity, boundToVolume string, phase api.Persiste
|
||||
switch a {
|
||||
case storageutil.StorageClassAnnotation:
|
||||
claim.Annotations[a] = "gold"
|
||||
case annStorageProvisioner:
|
||||
claim.Annotations[a] = mockPluginName
|
||||
default:
|
||||
claim.Annotations[a] = "yes"
|
||||
}
|
||||
@@ -786,6 +788,17 @@ func claimWithClass(className string, claims []*api.PersistentVolumeClaim) []*ap
|
||||
return claims
|
||||
}
|
||||
|
||||
// claimWithAnnotation saves given annotation into given claims.
|
||||
// Meant to be used to compose claims specified inline in a test.
|
||||
func claimWithAnnotation(name, value string, claims []*api.PersistentVolumeClaim) []*api.PersistentVolumeClaim {
|
||||
if claims[0].Annotations == nil {
|
||||
claims[0].Annotations = map[string]string{name: value}
|
||||
} else {
|
||||
claims[0].Annotations[name] = value
|
||||
}
|
||||
return claims
|
||||
}
|
||||
|
||||
func testSyncClaim(ctrl *PersistentVolumeController, reactor *volumeReactor, test controllerTest) error {
|
||||
return ctrl.syncClaim(test.initialClaims[0])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user