client-go 使用restClient 访问deploy资源
看了网上很多博客都是在使用restclient访问pod资源,于是想使用他查询一些pod以外的资源,比如deployment,使用途中遇到了一个问题,不知道怎么选择config的APIPath,试了apps,api/apps,apps/v1发现都不行, 于是思考了一下这个APIPath到底指的是什么,与试了一下apis, 这下成功了。
所以这里的APIPath其实也就是资源的上一级url吧
config.APIPath = "apis"
config.NegotiatedSerializer = sch
原创
2022-03-28 15:42:13 ·
289 阅读 ·
0 评论