Skip to content

Commit

Permalink
addressing comments from @ericpromislow
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrkefc committed Nov 11, 2024
1 parent 330f1b6 commit d4d2d21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions pkg/ext/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func InstallStore[T runtime.Object, TList runtime.Object](
apiGroup.VersionedResourcesStorageMap[gvk.Version] = make(map[string]rest.Storage)
}

delegate := &delegateError[T, TList]{
del := &delegateError[T, TList]{
inner: &delegate[T, TList]{
scheme: s.scheme,

Expand All @@ -257,7 +257,7 @@ func InstallStore[T runtime.Object, TList runtime.Object](
},
}

apiGroup.VersionedResourcesStorageMap[gvk.Version][resourceName] = delegate
apiGroup.VersionedResourcesStorageMap[gvk.Version][resourceName] = del
s.apiGroups[gvk.Group] = apiGroup
return nil
}
Expand Down
30 changes: 15 additions & 15 deletions pkg/ext/delegate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestDelegate_Watch(t *testing.T) {
input input
expected output
storeSetup func(*MockStore[*TestType, *TestTypeList])
simulateConvertionError bool
simulateConversionError bool
wantedErr bool
}

Expand All @@ -61,7 +61,7 @@ func TestDelegate_Watch(t *testing.T) {
}),
internaloptions: &metainternalversion.ListOptions{},
},
simulateConvertionError: true,
simulateConversionError: true,
wantedErr: true,
storeSetup: func(ms *MockStore[*TestType, *TestTypeList]) {},
},
Expand All @@ -71,7 +71,7 @@ func TestDelegate_Watch(t *testing.T) {
scheme := runtime.NewScheme()
addToSchemeTest(scheme)

if !tt.simulateConvertionError {
if !tt.simulateConversionError {
scheme.AddConversionFunc(&metainternalversion.ListOptions{}, &metav1.ListOptions{}, convert_internalversion_ListOptions_to_v1_ListOptions)
}

Expand All @@ -83,7 +83,7 @@ func TestDelegate_Watch(t *testing.T) {

mockStore := NewMockStore[*TestType, *TestTypeList](ctrl)

deleg4te := &delegate[*TestType, *TestTypeList]{
testDelegate := &delegate[*TestType, *TestTypeList]{
scheme: scheme,
t: &TestType{},
tList: &TestTypeList{},
Expand All @@ -92,7 +92,7 @@ func TestDelegate_Watch(t *testing.T) {
store: mockStore,
}

watch, err := deleg4te.Watch(tt.input.ctx, tt.input.internaloptions)
watch, err := testDelegate.Watch(tt.input.ctx, tt.input.internaloptions)
if tt.wantedErr {
assert.Error(t, err)
} else {
Expand Down Expand Up @@ -438,7 +438,7 @@ func TestDelegate_Update(t *testing.T) {
tt.input.objInfo = mockObjInfo
tt.setup(mockObjInfo, mockStore)

deleg4te := &delegate[*TestType, *TestTypeList]{
testDelegate := &delegate[*TestType, *TestTypeList]{
scheme: scheme,
t: &TestType{},
tList: &TestTypeList{},
Expand All @@ -447,7 +447,7 @@ func TestDelegate_Update(t *testing.T) {
store: mockStore,
}

obj, created, err := deleg4te.Update(tt.input.parentCtx, tt.input.name, tt.input.objInfo, tt.input.createValidation, tt.input.updateValidation, tt.input.forceAllowCreate, tt.input.options)
obj, created, err := testDelegate.Update(tt.input.parentCtx, tt.input.name, tt.input.objInfo, tt.input.createValidation, tt.input.updateValidation, tt.input.forceAllowCreate, tt.input.options)

if tt.wantErr {
assert.Error(t, err)
Expand Down Expand Up @@ -584,7 +584,7 @@ func TestDelegate_Create(t *testing.T) {
mockStore := NewMockStore[*TestType, *TestTypeList](ctrl)
tt.storeSetup(mockStore)

deleg4te := &delegate[*TestType, *TestTypeList]{
testDelegate := &delegate[*TestType, *TestTypeList]{
scheme: scheme,
t: &TestType{},
tList: &TestTypeList{},
Expand All @@ -593,7 +593,7 @@ func TestDelegate_Create(t *testing.T) {
store: mockStore,
}

result, err := deleg4te.Create(tt.input.ctx, tt.input.obj, tt.input.createValidation, tt.input.options)
result, err := testDelegate.Create(tt.input.ctx, tt.input.obj, tt.input.createValidation, tt.input.options)
if tt.wantErr {
assert.Error(t, err)
} else {
Expand Down Expand Up @@ -737,7 +737,7 @@ func TestDelegate_Delete(t *testing.T) {
mockStore := NewMockStore[*TestType, *TestTypeList](ctrl)
tt.storeSetup(mockStore)

deleg4te := &delegate[*TestType, *TestTypeList]{
testDelegate := &delegate[*TestType, *TestTypeList]{
scheme: scheme,
t: &TestType{},
tList: &TestTypeList{},
Expand All @@ -746,7 +746,7 @@ func TestDelegate_Delete(t *testing.T) {
store: mockStore,
}

result, completed, err := deleg4te.Delete(tt.input.ctx, tt.input.name, tt.input.deleteValidation, tt.input.options)
result, completed, err := testDelegate.Delete(tt.input.ctx, tt.input.name, tt.input.deleteValidation, tt.input.options)
if tt.wantErr {
assert.Error(t, err)
} else {
Expand Down Expand Up @@ -845,7 +845,7 @@ func TestDelegate_Get(t *testing.T) {
mockStore := NewMockStore[*TestType, *TestTypeList](ctrl)
tt.storeSetup(mockStore)

deleg4te := &delegate[*TestType, *TestTypeList]{
testDelegate := &delegate[*TestType, *TestTypeList]{
scheme: scheme,
t: &TestType{},
tList: &TestTypeList{},
Expand All @@ -854,7 +854,7 @@ func TestDelegate_Get(t *testing.T) {
store: mockStore,
}

result, err := deleg4te.Get(tt.input.ctx, tt.input.name, tt.input.options)
result, err := testDelegate.Get(tt.input.ctx, tt.input.name, tt.input.options)
if tt.wantErr {
assert.Error(t, err)
} else {
Expand Down Expand Up @@ -970,7 +970,7 @@ func TestDelegate_List(t *testing.T) {
mockStore := NewMockStore[*TestType, *TestTypeList](ctrl)
tt.storeSetup(mockStore)

deleg4te := &delegate[*TestType, *TestTypeList]{
testDelegate := &delegate[*TestType, *TestTypeList]{
scheme: scheme,
t: &TestType{},
tList: &TestTypeList{},
Expand All @@ -979,7 +979,7 @@ func TestDelegate_List(t *testing.T) {
store: mockStore,
}

result, err := deleg4te.List(tt.input.ctx, tt.input.listOptions)
result, err := testDelegate.List(tt.input.ctx, tt.input.listOptions)
if tt.wantErr {
assert.Error(t, err)
} else {
Expand Down

0 comments on commit d4d2d21

Please sign in to comment.