$ cd $GOPATH/src
$ git clone https://github.com/kubernetes/code-generator k8s.io/code-generator
$ mkdir $GOPATH/src/selfcrd
$ cd $GOPATH/src/selfcrd
$ mkdir -p example
$ mkdir -p pkg/apis/selfcrd/v1
$ cd example
$ cat crd.yaml selfcrd_example.yaml
cat doc.go
cat types.go
cat register.go
$GOPATH/src/k8s.io/code-generator/generate-groups.sh all "github.com/asdfsx/selfcrd/pkg/client" "github.com/asdfsx/selfcrd/pkg/apis" "selfcrd:v1"
${GOPATH}/bin/defaulter-gen --input-dirs github.com/asdfsx/selfcrd/pkg/apis/selfcrd/v1 -O zz_generated.defaults
复制workqueue-example到本地
修改相关的业务逻辑
go build -mod vendor .
./selfcrd --kubeconfig ~/.kube/config
可以通过使用git log
查看本项目的历史记录。来查看每一步发生的变更