Skip to content

Commit e6d6aad

Browse files
committed
fix: Extend fakeNSClient interface with additional methods.
1 parent 2e4f1be commit e6d6aad

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/objects/validator_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ type fakeNSClient struct {
681681
}
682682

683683
// Get decodes given client.Object as corev1.Namespace that might contains deletionTimestamp
684-
func (c fakeNSClient) Get(_ context.Context, key client.ObjectKey, obj client.Object) error {
684+
func (c fakeNSClient) Get(_ context.Context, key client.ObjectKey, obj client.Object, _ ...client.GetOption) error {
685685
nsObj := obj.(*corev1.Namespace)
686686
if c.isDeleting {
687687
nsObj.DeletionTimestamp = &metav1.Time{Time: time.Now()}
@@ -717,6 +717,15 @@ func (fakeNSClient) RESTMapper() meta.RESTMapper {
717717
func (fakeNSClient) Scheme() *runtime.Scheme {
718718
return nil
719719
}
720+
func (fakeNSClient) GroupVersionKindFor(_ runtime.Object) (schema.GroupVersionKind, error) {
721+
return schema.GroupVersionKind{}, nil
722+
}
723+
func (fakeNSClient) IsObjectNamespaced(_ runtime.Object) (bool, error) {
724+
return false, nil
725+
}
726+
func (fakeNSClient) SubResource(_ string) client.SubResourceClient {
727+
return nil
728+
}
720729

721730
func TestCreatingConflictSource(t *testing.T) {
722731
tests := []struct {

0 commit comments

Comments
 (0)