Skip to content

Commit 4af9a9e

Browse files
committed
remove panic
1 parent 8695d83 commit 4af9a9e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/xds/clients/xdsclient/ads_stream.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,7 @@ func (s *adsStreamImpl) sendNew(stream clients.Stream, typ ResourceType, names [
310310
return nil
311311
}
312312

313-
state, ok := s.resourceTypeState[typ]
314-
if !ok {
315-
// State is created when the first subscription for this type is made.
316-
panic(fmt.Sprintf("no state exists for resource type %v", typ))
317-
}
313+
state := s.resourceTypeState[typ]
318314
if err := s.sendMessageLocked(stream, names, typ.TypeURL, state.version, state.nonce, nil); err != nil {
319315
return err
320316
}

0 commit comments

Comments
 (0)