Skip to Content
Kubernetes编程
book

Kubernetes编程

by Michael Hausenblas, Stefan Schimanski
June 2021
Intermediate to advanced
335 pages
5h 50m
Chinese
China Electric Power Press Ltd.
Content preview from Kubernetes编程
client-go
基础
89
package: github.com/book/example
import:
- package: k8s.io/client-go
version: v10.0.0
...
有了这个文件,
glide install -v
就会下载
k8s.io/client-go
和其相关的依赖,
并放入本地的
vendor/
包中。命令中的
-v
是指删除从其他库中引入的
vendor/
包。在我们的用法中,这是必须的。
如果你通过修改
glide.yaml
更新了一个
client-go
版本,
glide update -v
会重新下载新的正确版本的依赖项。
3.6.2 dep
dep
glide
更强大、更高级。在很长的一段时间里,它都被看成是
Go
语言
生态中
glide
的继任者,并有成为
Go
语言
Vendor
工具事实标准的潜力。截
止本书撰写之时,前景还不是非常明朗,但
Go
模块看上去更像是未来的方向。
client-go
的场景下,需要注意
dep
的一些局限性:
dep
在第一次运行
dep init
时,不会去读取
Godeps/Godeps.json
文件。
dep
在后续的
dep ensure -update
调用中也不会去读取
Godeps/Godeps.
json
文件。
这就意味着,如果在
Godep.toml
中更新了
client-go
的版本,
dep
解析出来
client-go
的依赖可能是错误的。这是一件非常不幸的事情,因为这意味
着需要开发者显式地声明所有的依赖并需要手工维持更新。
下面是一个可用并包含正确版本依赖的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton

Publisher Resources

ISBN: 9787519854799