envoyproxy / envoyproxy/gateway
Potential unused condition check in internal/xds/server/runner/runner.go
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
*Description*:
>Describe the issue.
There is a nil check in the
https://github.com/envoyproxy/gateway/blob/9036533c88ac786428ff6b173770875fc78c0de7/internal/xds/server/runner/runner.go#L137-L139
However, `r.cache` is initialized in https://github.com/envoyproxy/gateway/blob/9036533c88ac786428ff6b173770875fc78c0de7/internal/xds/server/runner/runner.go#L80 and `NewSnapshotCache` never returns a nil from it:
https://github.com/envoyproxy/gateway/blob/9036533c88ac786428ff6b173770875fc78c0de7/internal/xds/cache/snapshotcache.go#L108-L117
IMHO, the logger message is suspicious because the code around doesn't `init snapshot cache`. It could be a remnant of a previous refactor.
[optional *Relevant Links*:]
>Any extra documentation required to understand the issue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.