开发者社区 问答 正文

Kubectl 的 apiVersions 命令是通过什么来实现的?

已解决

Kubectl 的 apiVersions 命令是通过什么来实现的?

展开
收起
与时俱进的探索者 2022-04-11 16:30:54 803 分享 版权
1 条回答
写回答
取消 提交回答
  • 推荐回答

    Kubectl 的 apiVersions 命令就是利用 CachedDiscoveryClient 来实现的, 如 API- VersionsOptions 结构体中 discoveryClient 变量是 CachedDiscoveryInterface 类型,而CachedDiscoveryClient 结构体实现了该接口,且在 APIVersionsOptions 的 Complete 方法中会将 CachedDiscoveryClient 客户端赋值到 discoveryClient 变量。

    以上摘自《云原生应用开发:Operator原理与实践》,下载地址:https://developer.aliyun.com/ebook/download/7464

    2022-04-11 22:17:38
    赞同 展开评论