The result is that kube.get(deployment="ns/myapp") maybe either of
GET /apis/apps/v1/namespaces/NS/deployments/myapp
or
GET /apis/extensions/v1beta1/namespaces/NS/deployments/myapp
but in the latter case, kube fake will return empty results (and fail the Starlark unit tests), because most users use the k8s.io.api.apps.v1 proto package to build a Deployment.
Previously the Deployment resource is registered in the kube_fake's discovery client under two API groups:
apps/v1
andextensions/v1beta1
. Apparently, this leads to non-deterministic GVK inference from RESTMapper (https://github.com/cruise-automation/isopod/blob/master/pkg/kube/api.go#L59-L74).The result is that
kube.get(deployment="ns/myapp")
maybe either ofor
but in the latter case, kube fake will return empty results (and fail the Starlark unit tests), because most users use the
k8s.io.api.apps.v1
proto package to build a Deployment.