* retrieval/discovery/kubernetes: fix cache state unknown behavior * retrieval/discovery/kubernetes: extract type casting * retrieval/discovery/kubernetes: add tests for possible regressions