@@ -285,7 +285,7 @@ func NewProvisionController(
285285) * ProvisionController {
286286 identity := uuid .NewUUID ()
287287 broadcaster := record .NewBroadcaster ()
288- broadcaster .StartRecordingToSink (& corev1.EventSinkImpl {Interface : client .Core ().Events (v1 .NamespaceAll )})
288+ broadcaster .StartRecordingToSink (& corev1.EventSinkImpl {Interface : client .CoreV1 ().Events (v1 .NamespaceAll )})
289289 var eventRecorder record.EventRecorder
290290 out , err := exec .Command ("hostname" ).Output ()
291291 if err != nil {
@@ -330,10 +330,10 @@ func NewProvisionController(
330330
331331 controller .claimSource = & cache.ListWatch {
332332 ListFunc : func (options metav1.ListOptions ) (runtime.Object , error ) {
333- return client .Core ().PersistentVolumeClaims (v1 .NamespaceAll ).List (options )
333+ return client .CoreV1 ().PersistentVolumeClaims (v1 .NamespaceAll ).List (options )
334334 },
335335 WatchFunc : func (options metav1.ListOptions ) (watch.Interface , error ) {
336- return client .Core ().PersistentVolumeClaims (v1 .NamespaceAll ).Watch (options )
336+ return client .CoreV1 ().PersistentVolumeClaims (v1 .NamespaceAll ).Watch (options )
337337 },
338338 }
339339 controller .claims , controller .claimController = cache .NewInformer (
@@ -349,10 +349,10 @@ func NewProvisionController(
349349
350350 controller .volumeSource = & cache.ListWatch {
351351 ListFunc : func (options metav1.ListOptions ) (runtime.Object , error ) {
352- return client .Core ().PersistentVolumes ().List (options )
352+ return client .CoreV1 ().PersistentVolumes ().List (options )
353353 },
354354 WatchFunc : func (options metav1.ListOptions ) (watch.Interface , error ) {
355- return client .Core ().PersistentVolumes ().Watch (options )
355+ return client .CoreV1 ().PersistentVolumes ().Watch (options )
356356 },
357357 }
358358 controller .volumes , controller .volumeController = cache .NewInformer (
@@ -756,7 +756,7 @@ func (ctrl *ProvisionController) provisionClaimOperation(claim *v1.PersistentVol
756756 // the locks. Check that PV (with deterministic name) hasn't been provisioned
757757 // yet.
758758 pvName := ctrl .getProvisionedVolumeNameForClaim (claim )
759- volume , err := ctrl .client .Core ().PersistentVolumes ().Get (pvName , metav1.GetOptions {})
759+ volume , err := ctrl .client .CoreV1 ().PersistentVolumes ().Get (pvName , metav1.GetOptions {})
760760 if err == nil && volume != nil {
761761 // Volume has been already provisioned, nothing to do.
762762 glog .V (4 ).Infof ("provisionClaimOperation [%s]: volume already exists, skipping" , claimToClaimKey (claim ))
@@ -829,7 +829,7 @@ func (ctrl *ProvisionController) provisionClaimOperation(claim *v1.PersistentVol
829829 // Try to create the PV object several times
830830 for i := 0 ; i < ctrl .createProvisionedPVRetryCount ; i ++ {
831831 glog .V (4 ).Infof ("provisionClaimOperation [%s]: trying to save volume %s" , claimToClaimKey (claim ), volume .Name )
832- if _ , err = ctrl .client .Core ().PersistentVolumes ().Create (volume ); err == nil {
832+ if _ , err = ctrl .client .CoreV1 ().PersistentVolumes ().Create (volume ); err == nil {
833833 // Save succeeded.
834834 glog .Infof ("volume %q for claim %q saved" , volume .Name , claimToClaimKey (claim ))
835835 break
@@ -1007,9 +1007,9 @@ func (ctrl *ProvisionController) watchPVC(claim *v1.PersistentVolumeClaim, stopC
10071007func (ctrl * ProvisionController ) getPVCEventWatch (claim * v1.PersistentVolumeClaim , eventType , reason string ) (watch.Interface , error ) {
10081008 claimKind := "PersistentVolumeClaim"
10091009 claimUID := string (claim .UID )
1010- fieldSelector := ctrl .client .Core ().Events (claim .Namespace ).GetFieldSelector (& claim .Name , & claim .Namespace , & claimKind , & claimUID ).String () + ",type=" + eventType + ",reason=" + reason
1010+ fieldSelector := ctrl .client .CoreV1 ().Events (claim .Namespace ).GetFieldSelector (& claim .Name , & claim .Namespace , & claimKind , & claimUID ).String () + ",type=" + eventType + ",reason=" + reason
10111011
1012- list , err := ctrl .client .Core ().Events (claim .Namespace ).List (metav1.ListOptions {
1012+ list , err := ctrl .client .CoreV1 ().Events (claim .Namespace ).List (metav1.ListOptions {
10131013 FieldSelector : fieldSelector ,
10141014 })
10151015 if err != nil {
@@ -1021,7 +1021,7 @@ func (ctrl *ProvisionController) getPVCEventWatch(claim *v1.PersistentVolumeClai
10211021 resourceVersion = list .Items [len (list .Items )- 1 ].ResourceVersion
10221022 }
10231023
1024- return ctrl .client .Core ().Events (claim .Namespace ).Watch (metav1.ListOptions {
1024+ return ctrl .client .CoreV1 ().Events (claim .Namespace ).Watch (metav1.ListOptions {
10251025 FieldSelector : fieldSelector ,
10261026 Watch : true ,
10271027 ResourceVersion : resourceVersion ,
@@ -1035,7 +1035,7 @@ func (ctrl *ProvisionController) deleteVolumeOperation(volume *v1.PersistentVolu
10351035 // Our check does not have to be as sophisticated as PV controller's, we can
10361036 // trust that the PV controller has set the PV to Released/Failed and it's
10371037 // ours to delete
1038- newVolume , err := ctrl .client .Core ().PersistentVolumes ().Get (volume .Name , metav1.GetOptions {})
1038+ newVolume , err := ctrl .client .CoreV1 ().PersistentVolumes ().Get (volume .Name , metav1.GetOptions {})
10391039 if err != nil {
10401040 return nil
10411041 }
@@ -1061,7 +1061,7 @@ func (ctrl *ProvisionController) deleteVolumeOperation(volume *v1.PersistentVolu
10611061
10621062 glog .V (4 ).Infof ("deleteVolumeOperation [%s]: success" , volume .Name )
10631063 // Delete the volume
1064- if err = ctrl .client .Core ().PersistentVolumes ().Delete (volume .Name , nil ); err != nil {
1064+ if err = ctrl .client .CoreV1 ().PersistentVolumes ().Delete (volume .Name , nil ); err != nil {
10651065 // Oops, could not delete the volume and therefore the controller will
10661066 // try to delete the volume again on next update.
10671067 glog .Infof ("failed to delete volume %q from database: %v" , volume .Name , err )
0 commit comments