Commit Graph

35 Commits (2cf91576a11a72aab3d00ca2ae2e9b7e1108675f)

Author SHA1 Message Date
Jan Safranek 6088369227 Delete provisioned volumes without claim.
There is a race in dynamic provisioning:

1. User creates a claim to dynamically provision a volume.
2. Kubernetes start provisioning the volume.
3. User deletes the claim before 2. is finished.
4. Kubernetes finished provisioning the volume.

The volume is in Pending state. This volume should be deleted instead of
moving to Available state.
2016-02-15 16:38:35 +01:00
k8s-merge-robot ad7ed67904 Merge pull request #20213 from jsafrane/devel/pv-reload
Auto commit by PR queue bot
2016-02-12 06:49:29 -08:00
k8s-merge-robot 678958a706 Merge pull request #19868 from jsafrane/devel/syncclaim-twice
Auto commit by PR queue bot
2016-02-12 06:21:21 -08:00
k8s-merge-robot e3c58293b9 Merge pull request #20197 from markturansky/check_pv_by_pvc_uid
Auto commit by PR queue bot
2016-02-05 21:06:16 -08:00
Chao Xu 184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
Chao Xu 1b047f8e67 rename legacy to core 2016-02-04 14:26:56 -08:00
Chao Xu f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
Jan Safranek 1edf34a4e5 Fixed persistent volume claim controllers processing an old claim.
Fixes #19860 (it may be easier to look at the issue to see exact sequence
to reproduce the bug and understand the fix).

When PersistentVolumeProvisionerController.reconcileClaim() is called with the
same claim in short succession (e.g. the claim is created by an user and
at the same time periodic check of all claims is scheduled), the second
reconcileClaim() call gets an old copy of the claim as its parameter.

The method should always reload the claim to get a fresh copy with all
annotations, possibly added by previous reconcileClaim() call.


The same applies to PersistentVolumeClaimBinder.syncClaim().


Also update all the test to store claims in "fake" API server before calling
syncClaim and reconcileClaim.
2016-02-02 13:52:07 +01:00
Jan Safranek e2826626b1 Fixed persistent volume claim controllers processing an old volume
We should always load the newest version of the volume from APIserver before
processing it.

When PersistentVolumeProvisionerController.reconcileVolume() is called with the
same volume in short succession (e.g. the volume is created by a provisioner
and at the same time periodic check of all volumes is scheduled), the second
reconcileVolume() call gets an old copy of the volume as its parameter and
it does not see annotations updated by the previous call.

This may result in one volume being provisioned several times, creating orphan
volumes in the cloud.

The same error is in PersistentVolumeClaimBinder.syncVolume().
2016-02-01 10:44:31 +01:00
Chao Xu c72d234bbf replacing handwritten client in several controllers 2016-01-31 15:42:02 -08:00
markturansky 1ad2df6b61 verify UID when releasing and binding volumes 2016-01-27 08:43:18 -05:00
Alex Mohr 12845ba9a5 Merge pull request #18877 from markturansky/fix_18830
Trigger syncClaim after PV provisioning to reduce wait
2016-01-21 15:06:46 -08:00
markturansky 50d83f3851 added missing return statements 2016-01-03 13:54:09 -05:00
markturansky 66b5844841 trigger syncClaim after pv provisioning to reduce wait 2015-12-17 21:35:10 -05:00
markturansky 4aacb76149 added cast checks to controllers to prevent nil panics 2015-12-15 11:34:03 -05:00
Wojciech Tyczynski 960808bf08 Switch to versioned ListOptions in client. 2015-12-14 14:26:09 +01:00
markturansky 4fc1bf1f23 Added PersistentVolumeController 2015-12-11 10:33:30 -05:00
Wojciech Tyczynski b0fcb5adef Pass ListOptions to List in ListWatch. 2015-12-07 11:53:53 +01:00
Wojciech Tyczynski 6dcb689d4e Simplify List() signature in clients. 2015-12-03 09:54:07 +01:00
k8s-merge-robot 8a8639d7af Merge pull request #17863 from wojtek-t/only_list_options_in_watch
Auto commit by PR queue bot
2015-12-02 06:28:28 -08:00
Wojciech Tyczynski 8343c8ce6c Pass ListOptions to List() methods. 2015-12-01 15:00:36 +01:00
Wojciech Tyczynski d2dfc912e6 Simplify Watch() signature in clients. 2015-12-01 14:19:26 +01:00
k8s-merge-robot 7f2f7aa091 Merge pull request #16432 from markturansky/recycler_race
Auto commit by PR queue bot
2015-11-25 11:54:06 -08:00
Wojciech Tyczynski b6ef62af24 Use unversioned.ListOptions in clients. 2015-11-24 16:52:09 +01:00
markturansky b9b8cf7fff Fixed race condition in pv binder 2015-11-12 13:55:09 -05:00
Wojciech Tyczynski d47e21f19f Reuse TCP connections in Reflector between resync periods. 2015-10-26 19:35:25 +01:00
Wojciech Tyczynski f4d75e0a0a Support timeout in watch requests 2015-10-24 13:12:49 +02:00
eulerzgy 4ed5f9d240 adjust package name for pkg/controller directory 2015-10-12 09:51:27 +08:00
Wojciech Tyczynski df79026b79 Extend resyncPeriods in controllers in production. 2015-10-08 09:10:09 +02:00
markturansky c2de9e9647 Added volume.Deleter interface and simple HostPath implementation 2015-09-17 12:08:58 -04:00
Daniel Smith b225c1d47a Run gofmt (separate commit for easy rebases) 2015-09-10 17:17:59 -07:00
Daniel Smith 15b30b8b09 Move version agnostic parts of client
pkg/client/unversioned/cache -> pkg/client/cache
pkg/client/unversioned/record -> pkg/client/record
2015-09-10 17:17:59 -07:00
Kris Rousey ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
markturansky 8e0d391b1e Refactored persistent volume controllers to new packaging structure 2015-08-10 23:18:48 -04:00