KKubernetes Publisheropenapi: Make file client more easy to re-use
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Add custom error struct for Group/Version not found Kubernetes-commit: dc83af0b44bd6432dea3ccd29a77ca3a0b6122a2 | 3 年前 | |
openapi: Make file client more easy to re-use A few notes about the change: 1. I need to initialize the fileclient once, in an init function, so I don't have access to testing.T yet. 2. I want to be able to configure the openapi files that I use 3. We already have a "cache" client that wraps another client, we don't need to re-implement caching here, one can just do: cache.NewClient(openapitest.NewFileClient("some/path")) to do a cached client. Or initialize it in an init/global var. Since there is still some value to use the embedded file, make an alternative constructor while using fs.FS interface to be able to manipulate both virtual and disk-based filesystems. Kubernetes-commit: 29503fd8d45bc2c9438e92936bf4111162529b40 | 3 年前 |