File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
pkg/kstatus/polling/clusterreader Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -239,17 +239,13 @@ func (c *CachingClusterReader) Sync(ctx context.Context) error {
239
239
list .SetGroupVersionKind (mapping .GroupVersionKind )
240
240
err = c .reader .List (ctx , & list , listOptions ... )
241
241
if err != nil {
242
- // If we get an IsNotFound error here, it means the type
243
- // we are listing doesn't exist on the server. This is ok,
244
- // because it might be that a CRD is part of the set of
245
- // resources that are being applied.
246
- if errors .IsNotFound (err ) {
247
- cache [gn ] = cacheEntry {
248
- err : err ,
249
- }
250
- continue
242
+ // We continue even if there is an error. Whenever any pollers
243
+ // request a resource covered by this gns, we just return the
244
+ // error.
245
+ cache [gn ] = cacheEntry {
246
+ err : err ,
251
247
}
252
- return err
248
+ continue
253
249
}
254
250
cache [gn ] = cacheEntry {
255
251
resources : list ,
Original file line number Diff line number Diff line change @@ -138,9 +138,9 @@ func TestSync_Errors(t *testing.T) {
138
138
apiextv1 .SchemeGroupVersion .WithKind ("CustomResourceDefinition" ),
139
139
),
140
140
readerError : errors .NewInternalError (fmt .Errorf ("testing" )),
141
- expectSyncError : true ,
141
+ expectSyncError : false ,
142
142
cacheError : true ,
143
- cacheErrorText : "not found " ,
143
+ cacheErrorText : "Internal error occurred: testing " ,
144
144
},
145
145
"mapping not found" : {
146
146
mapper : testutil .NewFakeRESTMapper (),
You can’t perform that action at this time.
0 commit comments