From 6c566f6dfa5b76d105ce24b3b0cb7f5e3d50d018 Mon Sep 17 00:00:00 2001 From: JUN YANG Date: Sun, 14 Mar 2021 00:17:58 +0800 Subject: [PATCH] Fix misspelling of condition. Signed-off-by: JUN YANG --- pkg/volume/util/resize_util_test.go | 28 +++++++++---------- .../apiserver/pkg/storage/interfaces.go | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkg/volume/util/resize_util_test.go b/pkg/volume/util/resize_util_test.go index ac637382f35..ee5fd46c9ed 100644 --- a/pkg/volume/util/resize_util_test.go +++ b/pkg/volume/util/resize_util_test.go @@ -28,10 +28,10 @@ import ( ) type conditionMergeTestCase struct { - description string - pvc *v1.PersistentVolumeClaim - newConditions []v1.PersistentVolumeClaimCondition - finalCondtions []v1.PersistentVolumeClaimCondition + description string + pvc *v1.PersistentVolumeClaim + newConditions []v1.PersistentVolumeClaimCondition + finalConditions []v1.PersistentVolumeClaimCondition } func TestMergeResizeCondition(t *testing.T) { @@ -52,10 +52,10 @@ func TestMergeResizeCondition(t *testing.T) { testCases := []conditionMergeTestCase{ { - description: "when removing all conditions", - pvc: pvc.DeepCopy(), - newConditions: []v1.PersistentVolumeClaimCondition{}, - finalCondtions: []v1.PersistentVolumeClaimCondition{}, + description: "when removing all conditions", + pvc: pvc.DeepCopy(), + newConditions: []v1.PersistentVolumeClaimCondition{}, + finalConditions: []v1.PersistentVolumeClaimCondition{}, }, { description: "adding new condition", @@ -66,7 +66,7 @@ func TestMergeResizeCondition(t *testing.T) { Status: v1.ConditionTrue, }, }, - finalCondtions: []v1.PersistentVolumeClaimCondition{ + finalConditions: []v1.PersistentVolumeClaimCondition{ { Type: v1.PersistentVolumeClaimFileSystemResizePending, Status: v1.ConditionTrue, @@ -83,7 +83,7 @@ func TestMergeResizeCondition(t *testing.T) { LastTransitionTime: newTime, }, }, - finalCondtions: []v1.PersistentVolumeClaimCondition{ + finalConditions: []v1.PersistentVolumeClaimCondition{ { Type: v1.PersistentVolumeClaimResizing, Status: v1.ConditionTrue, @@ -101,7 +101,7 @@ func TestMergeResizeCondition(t *testing.T) { LastTransitionTime: conditionFalseTime, }, }, - finalCondtions: []v1.PersistentVolumeClaimCondition{ + finalConditions: []v1.PersistentVolumeClaimCondition{ { Type: v1.PersistentVolumeClaimResizing, Status: v1.ConditionFalse, @@ -119,7 +119,7 @@ func TestMergeResizeCondition(t *testing.T) { LastTransitionTime: currentTime, }, }, - finalCondtions: []v1.PersistentVolumeClaimCondition{ + finalConditions: []v1.PersistentVolumeClaimCondition{ { Type: v1.PersistentVolumeClaimResizing, Status: v1.ConditionTrue, @@ -133,10 +133,10 @@ func TestMergeResizeCondition(t *testing.T) { updatePVC := MergeResizeConditionOnPVC(testcase.pvc, testcase.newConditions) updateConditions := updatePVC.Status.Conditions - if !reflect.DeepEqual(updateConditions, testcase.finalCondtions) { + if !reflect.DeepEqual(updateConditions, testcase.finalConditions) { t.Errorf("Expected updated conditions for test %s to be %v but got %v", testcase.description, - testcase.finalCondtions, updateConditions) + testcase.finalConditions, updateConditions) } } diff --git a/staging/src/k8s.io/apiserver/pkg/storage/interfaces.go b/staging/src/k8s.io/apiserver/pkg/storage/interfaces.go index ccfe98467e9..db72d915508 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/interfaces.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/interfaces.go @@ -244,7 +244,7 @@ type Interface interface { // ) GuaranteedUpdate( ctx context.Context, key string, ptrToType runtime.Object, ignoreNotFound bool, - precondtions *Preconditions, tryUpdate UpdateFunc, cachedExistingObject runtime.Object) error + preconditions *Preconditions, tryUpdate UpdateFunc, cachedExistingObject runtime.Object) error // Count returns number of different entries under the key (generally being path prefix). Count(key string) (int64, error)