mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #115109 from HirazawaUi/delte-pkg-volume-unused-functions
delete unused functions in pkg/volume directory
This commit is contained in:
commit
3d9b437df2
@ -43,11 +43,6 @@ type IdentityClient struct {
|
||||
nextErr error
|
||||
}
|
||||
|
||||
// NewIdentityClient returns a new IdentityClient
|
||||
func NewIdentityClient() *IdentityClient {
|
||||
return &IdentityClient{}
|
||||
}
|
||||
|
||||
// SetNextError injects expected error
|
||||
func (f *IdentityClient) SetNextError(err error) {
|
||||
f.nextErr = err
|
||||
@ -441,11 +436,6 @@ type ControllerClient struct {
|
||||
nextErr error
|
||||
}
|
||||
|
||||
// NewControllerClient returns a ControllerClient
|
||||
func NewControllerClient() *ControllerClient {
|
||||
return &ControllerClient{}
|
||||
}
|
||||
|
||||
// SetNextError injects next expected error
|
||||
func (f *ControllerClient) SetNextError(err error) {
|
||||
f.nextErr = err
|
||||
|
@ -1521,24 +1521,6 @@ func VerifyZeroDetachCallCount(fakeVolumePlugin *FakeVolumePlugin) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// VerifySetUpDeviceCallCount ensures that at least one of the Mappers for this
|
||||
// plugin has the expectedSetUpDeviceCallCount number of calls. Otherwise it
|
||||
// returns an error.
|
||||
func VerifySetUpDeviceCallCount(
|
||||
expectedSetUpDeviceCallCount int,
|
||||
fakeVolumePlugin *FakeVolumePlugin) error {
|
||||
for _, mapper := range fakeVolumePlugin.GetBlockVolumeMapper() {
|
||||
actualCallCount := mapper.GetSetUpDeviceCallCount()
|
||||
if actualCallCount >= expectedSetUpDeviceCallCount {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf(
|
||||
"No Mapper have expected SetUpDeviceCallCount. Expected: <%v>.",
|
||||
expectedSetUpDeviceCallCount)
|
||||
}
|
||||
|
||||
// VerifyTearDownDeviceCallCount ensures that at least one of the Unmappers for this
|
||||
// plugin has the expectedTearDownDeviceCallCount number of calls. Otherwise it
|
||||
// returns an error.
|
||||
|
@ -322,12 +322,6 @@ func NewFakeKubeletVolumeHostWithCloudProvider(t *testing.T, rootDir string, kub
|
||||
return newFakeKubeletVolumeHost(t, rootDir, kubeClient, plugins, cloud, nil, "", nil, nil)
|
||||
}
|
||||
|
||||
func NewFakeKubeletVolumeHostWithNodeLabels(t *testing.T, rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, labels map[string]string) *fakeKubeletVolumeHost {
|
||||
volHost := newFakeKubeletVolumeHost(t, rootDir, kubeClient, plugins, nil, nil, "", nil, nil)
|
||||
volHost.nodeLabels = labels
|
||||
return volHost
|
||||
}
|
||||
|
||||
func NewFakeKubeletVolumeHostWithCSINodeName(t *testing.T, rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, nodeName string, driverLister storagelistersv1.CSIDriverLister, volumeAttachLister storagelistersv1.VolumeAttachmentLister) *fakeKubeletVolumeHost {
|
||||
return newFakeKubeletVolumeHost(t, rootDir, kubeClient, plugins, nil, nil, nodeName, driverLister, volumeAttachLister)
|
||||
}
|
||||
|
@ -229,23 +229,6 @@ func MarkFSResizeFinished(
|
||||
return updatedPVC, err
|
||||
}
|
||||
|
||||
func MarkControllerExpansionFailed(pvc *v1.PersistentVolumeClaim, kubeClient clientset.Interface) (*v1.PersistentVolumeClaim, error) {
|
||||
expansionFailedOnController := v1.PersistentVolumeClaimControllerExpansionFailed
|
||||
newPVC := pvc.DeepCopy()
|
||||
newPVC.Status.ResizeStatus = &expansionFailedOnController
|
||||
patchBytes, err := createPVCPatch(pvc, newPVC, false /* addResourceVersionCheck */)
|
||||
if err != nil {
|
||||
return pvc, fmt.Errorf("patchPVCStatus failed to patch PVC %q: %v", pvc.Name, err)
|
||||
}
|
||||
|
||||
updatedClaim, updateErr := kubeClient.CoreV1().PersistentVolumeClaims(pvc.Namespace).
|
||||
Patch(context.TODO(), pvc.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}, "status")
|
||||
if updateErr != nil {
|
||||
return pvc, fmt.Errorf("patchPVCStatus failed to patch PVC %q: %v", pvc.Name, updateErr)
|
||||
}
|
||||
return updatedClaim, nil
|
||||
}
|
||||
|
||||
// MarkNodeExpansionFailed marks a PVC for node expansion as failed. Kubelet should not retry expansion
|
||||
// of volumes which are in failed state.
|
||||
func MarkNodeExpansionFailed(pvc *v1.PersistentVolumeClaim, kubeClient clientset.Interface) (*v1.PersistentVolumeClaim, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user