4. • Founded in 2014 by Google engineers
• 100% OpenSource, Apache license
• Governed by Cloud Native Computing Foundation (CNCF)
• > 100 companies contributing Go
5. Monorepo
+ makes testing easier
+ makes releases easier
+ makes global changes easier
+ is easy to implement
- is not how Golang works
- is not what 3rd-parties expect
- does not scale well
github.com/kubernetes/kubernetes
cmd
pkg
staging
src
k8s.io
api
apimachinery
apiserver
client-go
apiextensions-apiserver
kube-aggregator
sample-apiserver
sample-controller
6. Monorepo
+ makes testing easier
+ makes releases easier
+ makes global changes easier
+ is easy to implement
- is not how Golang works
- is not what 3rd-parties expect
- does not scale well
github.com/kubernetes/kubernetes
cmd
pkg
staging
src
k8s.io
api
apimachinery
apiserver
client-go
apiextensions-apiserver
kube-aggregator
sample-apiserver
sample-controller
vendor
...
symlinks
7. Monorepo
+ makes testing easier
+ makes releases easier
+ makes global changes easier
+ is easy to implement
- is not how Golang works
- is not what 3rd-parties expect
- does not scale well
😱
github.com/kubernetes/kubernetes
cmd
pkg
staging
src
k8s.io
api
apimachinery
apiserver
client-go
apiextensions-apiserver
kube-aggregator
sample-apiserver
sample-controller
vendor
...
symlinks
23. git filter-branch –subdirectory-filter staging/src/k8s.io/client-go
instead: custom filter-branch with https://github.com/src-d/go-git
„A highly extensible Git implementation in pure Go“
which prunes exactly the commits we want.
24. Lessons learnt
• Git data structures are no rocket science
• 500 custom Git code in Go
vs. 700 dense bash lines working around git filter-branch
• porcelain vs. plumbing
do not script the former, understand what they do!