@@ -70,10 +70,12 @@ func skipInvalidTest(ctx context.Context, c client.Client, invConfig invconfig.I
70
70
Identifiers : object.ObjMetadataSet {
71
71
object .UnstructuredToObjMetadata (invalidPodObj ),
72
72
},
73
- Error : testutil .EqualErrorString (validation .NewError (
74
- field .Required (field .NewPath ("metadata" , "name" ), "name is required" ),
75
- object .UnstructuredToObjMetadata (invalidPodObj ),
76
- ).Error ()),
73
+ Error : testutil .EqualError (
74
+ validation .NewError (
75
+ field .Required (field .NewPath ("metadata" , "name" ), "name is required" ),
76
+ object .UnstructuredToObjMetadata (invalidPodObj ),
77
+ ),
78
+ ),
77
79
},
78
80
},
79
81
{
@@ -83,22 +85,24 @@ func skipInvalidTest(ctx context.Context, c client.Client, invConfig invconfig.I
83
85
Identifiers : object.ObjMetadataSet {
84
86
object .UnstructuredToObjMetadata (pod3Obj ),
85
87
},
86
- Error : testutil .EqualErrorString (validation .NewError (
87
- object.InvalidAnnotationError {
88
- Annotation : dependson .Annotation ,
89
- Cause : graph.ExternalDependencyError {
90
- Edge : graph.Edge {
91
- From : object .UnstructuredToObjMetadata (pod3Obj ),
92
- To : object.ObjMetadata {
93
- GroupKind : schema.GroupKind {Kind : "Pod" },
94
- Name : "pod0" ,
95
- Namespace : namespaceName ,
88
+ Error : testutil .EqualError (
89
+ validation .NewError (
90
+ object.InvalidAnnotationError {
91
+ Annotation : dependson .Annotation ,
92
+ Cause : graph.ExternalDependencyError {
93
+ Edge : graph.Edge {
94
+ From : object .UnstructuredToObjMetadata (pod3Obj ),
95
+ To : object.ObjMetadata {
96
+ GroupKind : schema.GroupKind {Kind : "Pod" },
97
+ Name : "pod0" ,
98
+ Namespace : namespaceName ,
99
+ },
96
100
},
97
101
},
98
102
},
99
- } ,
100
- object . UnstructuredToObjMetadata ( pod3Obj ),
101
- ). Error ()) ,
103
+ object . UnstructuredToObjMetadata ( pod3Obj ) ,
104
+ ),
105
+ ),
102
106
},
103
107
},
104
108
{
@@ -108,21 +112,23 @@ func skipInvalidTest(ctx context.Context, c client.Client, invConfig invconfig.I
108
112
Identifiers : object.ObjMetadataSet {
109
113
object .UnstructuredToObjMetadata (podBObj ),
110
114
},
111
- Error : testutil .EqualErrorString (validation .NewError (
112
- object.InvalidAnnotationError {
113
- Annotation : mutation .Annotation ,
114
- Cause : graph.ExternalDependencyError {
115
- Edge : graph.Edge {
116
- From : object .UnstructuredToObjMetadata (podBObj ),
117
- To : object.ObjMetadata {
118
- GroupKind : schema.GroupKind {Kind : "Pod" },
119
- Name : "pod-a" ,
115
+ Error : testutil .EqualError (
116
+ validation .NewError (
117
+ object.InvalidAnnotationError {
118
+ Annotation : mutation .Annotation ,
119
+ Cause : graph.ExternalDependencyError {
120
+ Edge : graph.Edge {
121
+ From : object .UnstructuredToObjMetadata (podBObj ),
122
+ To : object.ObjMetadata {
123
+ GroupKind : schema.GroupKind {Kind : "Pod" },
124
+ Name : "pod-a" ,
125
+ },
120
126
},
121
127
},
122
128
},
123
- } ,
124
- object . UnstructuredToObjMetadata ( podBObj ),
125
- ). Error ()) ,
129
+ object . UnstructuredToObjMetadata ( podBObj ) ,
130
+ ),
131
+ ),
126
132
},
127
133
},
128
134
{
@@ -133,22 +139,24 @@ func skipInvalidTest(ctx context.Context, c client.Client, invConfig invconfig.I
133
139
object .UnstructuredToObjMetadata (podAObj ),
134
140
object .UnstructuredToObjMetadata (podBObj ),
135
141
},
136
- Error : testutil .EqualErrorString (validation .NewError (
137
- graph.CyclicDependencyError {
138
- Edges : []graph.Edge {
139
- {
140
- From : object .UnstructuredToObjMetadata (podAObj ),
141
- To : object .UnstructuredToObjMetadata (podBObj ),
142
- },
143
- {
144
- From : object .UnstructuredToObjMetadata (podBObj ),
145
- To : object .UnstructuredToObjMetadata (podAObj ),
142
+ Error : testutil .EqualError (
143
+ validation .NewError (
144
+ graph.CyclicDependencyError {
145
+ Edges : []graph.Edge {
146
+ {
147
+ From : object .UnstructuredToObjMetadata (podAObj ),
148
+ To : object .UnstructuredToObjMetadata (podBObj ),
149
+ },
150
+ {
151
+ From : object .UnstructuredToObjMetadata (podBObj ),
152
+ To : object .UnstructuredToObjMetadata (podAObj ),
153
+ },
146
154
},
147
155
},
148
- } ,
149
- object .UnstructuredToObjMetadata (podAObj ),
150
- object . UnstructuredToObjMetadata ( podBObj ),
151
- ). Error ()) ,
156
+ object . UnstructuredToObjMetadata ( podAObj ) ,
157
+ object .UnstructuredToObjMetadata (podBObj ),
158
+ ),
159
+ ),
152
160
},
153
161
},
154
162
{
@@ -359,8 +367,15 @@ func skipInvalidTest(ctx context.Context, c client.Client, invConfig invconfig.I
359
367
Identifiers : object.ObjMetadataSet {
360
368
object .UnstructuredToObjMetadata (deployment1Obj ),
361
369
},
362
- Error : testutil .EqualErrorType (
363
- validation .NewError (nil ), // TODO: be more specific
370
+ Error : testutil .EqualError (
371
+ validation .NewError (
372
+ object.InvalidAnnotationError {
373
+ Annotation : dependson .Annotation ,
374
+ Cause : fmt .Errorf ("failed to parse object reference (index: 0): %w" ,
375
+ fmt .Errorf ("expected 3 or 5 fields, found 1: %q" , "invalid" )),
376
+ },
377
+ object .UnstructuredToObjMetadata (deployment1Obj ),
378
+ ),
364
379
),
365
380
},
366
381
},
0 commit comments