Skip to content

Commit 7072c9a

Browse files
committed
Fix dot import
1 parent 8b3fa67 commit 7072c9a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pkg/object/unstructured_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1313
"k8s.io/apimachinery/pkg/runtime/schema"
1414
cmdtesting "k8s.io/kubectl/pkg/cmd/testing"
15-
. "sigs.k8s.io/cli-utils/pkg/object" //nolint:revive
15+
"sigs.k8s.io/cli-utils/pkg/object"
1616
"sigs.k8s.io/cli-utils/pkg/testutil"
1717
)
1818

@@ -84,11 +84,11 @@ metadata:
8484
func TestUnstructuredToObjMeta(t *testing.T) {
8585
tests := map[string]struct {
8686
obj *unstructured.Unstructured
87-
expected ObjMetadata
87+
expected object.ObjMetadata
8888
}{
8989
"test RBAC translation": {
9090
obj: testutil.Unstructured(t, rbac),
91-
expected: ObjMetadata{
91+
expected: object.ObjMetadata{
9292
Name: "test-cluster-role",
9393
GroupKind: schema.GroupKind{
9494
Group: "rbac.authorization.k8s.io",
@@ -98,7 +98,7 @@ func TestUnstructuredToObjMeta(t *testing.T) {
9898
},
9999
"test CRD translation": {
100100
obj: testutil.Unstructured(t, testCRD),
101-
expected: ObjMetadata{
101+
expected: object.ObjMetadata{
102102
Name: "test-crd",
103103
GroupKind: schema.GroupKind{
104104
Group: "apiextensions.k8s.io",
@@ -108,7 +108,7 @@ func TestUnstructuredToObjMeta(t *testing.T) {
108108
},
109109
"test pod translation": {
110110
obj: testutil.Unstructured(t, testPod),
111-
expected: ObjMetadata{
111+
expected: object.ObjMetadata{
112112
Name: "test-pod",
113113
Namespace: "test-namespace",
114114
GroupKind: schema.GroupKind{
@@ -121,7 +121,7 @@ func TestUnstructuredToObjMeta(t *testing.T) {
121121

122122
for name, tc := range tests {
123123
t.Run(name, func(t *testing.T) {
124-
actual := UnstructuredToObjMetadata(tc.obj)
124+
actual := object.UnstructuredToObjMetadata(tc.obj)
125125
if tc.expected != actual {
126126
t.Errorf("expected ObjMetadata (%s), got (%s)", tc.expected, actual)
127127
}
@@ -154,7 +154,7 @@ func TestIsKindNamespace(t *testing.T) {
154154

155155
for name, tc := range tests {
156156
t.Run(name, func(t *testing.T) {
157-
actual := IsKindNamespace(tc.obj)
157+
actual := object.IsKindNamespace(tc.obj)
158158
if tc.isKindNamespace != actual {
159159
t.Errorf("expected IsKindNamespace (%t), got (%t) for (%s)",
160160
tc.isKindNamespace, actual, tc.obj)
@@ -188,7 +188,7 @@ func TestIsCRD(t *testing.T) {
188188

189189
for name, tc := range tests {
190190
t.Run(name, func(t *testing.T) {
191-
actual := IsCRD(tc.obj)
191+
actual := object.IsCRD(tc.obj)
192192
if tc.isCRD != actual {
193193
t.Errorf("expected IsCRD (%t), got (%t) for (%s)", tc.isCRD, actual, tc.obj)
194194
}
@@ -225,7 +225,7 @@ func TestIsNamespaced(t *testing.T) {
225225

226226
for name, tc := range tests {
227227
t.Run(name, func(t *testing.T) {
228-
actual := IsNamespaced(tc.obj)
228+
actual := object.IsNamespaced(tc.obj)
229229
if tc.isNamespaced != actual {
230230
t.Errorf("expected namespaced (%t), got (%t) for (%s)",
231231
tc.isNamespaced, actual, tc.obj)
@@ -259,7 +259,7 @@ func TestGetCRDGroupKind(t *testing.T) {
259259

260260
for name, tc := range tests {
261261
t.Run(name, func(t *testing.T) {
262-
actualGroupKind, actualIsCRD := GetCRDGroupKind(tc.obj)
262+
actualGroupKind, actualIsCRD := object.GetCRDGroupKind(tc.obj)
263263
if tc.isCRD != actualIsCRD {
264264
t.Errorf("expected IsCRD (%t), got (%t) for (%s)", tc.isCRD, actualIsCRD, tc.obj)
265265
}
@@ -284,7 +284,7 @@ func TestLookupResourceScope(t *testing.T) {
284284
},
285285
"CR not found in the RESTMapper or the provided CRDs": {
286286
resource: testutil.Unstructured(t, testCR),
287-
expectedErr: &UnknownTypeError{
287+
expectedErr: &object.UnknownTypeError{
288288
GroupVersionKind: schema.GroupVersionKind{
289289
Group: "example.com",
290290
Version: "v1",
@@ -297,7 +297,7 @@ func TestLookupResourceScope(t *testing.T) {
297297
crds: []*unstructured.Unstructured{
298298
testutil.Unstructured(t, testCRDv2),
299299
},
300-
expectedErr: &UnknownTypeError{
300+
expectedErr: &object.UnknownTypeError{
301301
GroupVersionKind: schema.GroupVersionKind{
302302
Group: "example.com",
303303
Version: "v1",
@@ -322,7 +322,7 @@ func TestLookupResourceScope(t *testing.T) {
322322
mapper, err := tf.ToRESTMapper()
323323
require.NoError(t, err)
324324

325-
scope, err := LookupResourceScope(tc.resource, tc.crds, mapper)
325+
scope, err := object.LookupResourceScope(tc.resource, tc.crds, mapper)
326326

327327
if tc.expectedErr != nil {
328328
require.Equal(t, tc.expectedErr, err)

0 commit comments

Comments
 (0)