Skip to content

Commit

Permalink
Prepare for v1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
  • Loading branch information
slok committed Mar 27, 2024
1 parent 9a6a1a9 commit 02b4c7c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

## [Unreleased]

## [v0.1.0] - 2024-03-24

### Added

- CRD generator.
- Go code generator.
- Tested compatibility with Kubernetes v1.28.
- Tested compatibility with Kubernetes v1.27.
- Tested compatibility with Kubernetes v1.29.
- Docker image uses `kubernetes/code-generator` v1.30.0-beta.0.
- Docker image uses `kubernetes-sigs/controller-tools` v0.14.0.

[unreleased]: https://github.com/slok/kube-code-generator/compare/v0.1.0...HEAD
[v0.1.0]: https://github.com/slok/kube-code-generator/releases/tag/v0.1.0
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The easiest way is to use the provided Docker image as it has all the required u
Here is an example that mounts the current directory (a Go project) and generates the Go code and the CRDs by providing the APIs input directory and the generation output directories:

```bash
docker run -it --rm -v ${PWD}:/app ghcr.io/slok/kube-code-generator \
docker run -it --rm -v ${PWD}:/app ghcr.io/slok/kube-code-generator \
--apis-in ./apis \
--go-gen-out ./gen \
--crd-gen-out ./gen/manifests
Expand All @@ -46,10 +46,18 @@ However, the best way to know how to use it is with a full example, you have it

## Kubernetes versions

| Kubernetes | Docker image |
| ---------- | ------------------------------------------------------- |
| v1.29 | `docker pull ghcr.io/slok/kube-code-generator:v1.29.0` |
It's suggested that if you don't have an old Kubenretes version, you try the latest kube-code-generator
(`latest`), however the ones described on the table here are known to work correctly on the specific version.

### Versions <v1.29
| Kubernetes | Docker image |
| ---------- | ------------------------------------------------------ |
| v1.30 | `docker pull ghcr.io/slok/kube-code-generator:v1.0.0` |
| v1.29 | `docker pull ghcr.io/slok/kube-code-generator:v1.0.0` |
| v1.28 | `docker pull ghcr.io/slok/kube-code-generator:v1.0.0` |
| v1.27 | `docker pull ghcr.io/slok/kube-code-generator:v1.0.0` |

With the release of Kubernetes v1.30, this app was rewritten from bash hacky scripts into a proper Go application, that is easier, more extendable and safer to use. This new refactor of the app works with Kubernetes `>=v1.29` and changes the usage of the app, so for other versions you will need to check the previous implementation I would suggest that you check the [Readme of `<v1.27`](https://github.com/slok/kube-code-generator/tree/v1.27.0).
### Versions <=v1.27

With the release of Kubernetes v1.30, this app was rewritten from bash hacky scripts into a proper Go application, that is easier, more extendable and safer to use.

In case you tested this new refactor and isn't working for you, Inwould suggest to try the previous versions, check the previous [Readme](https://github.com/slok/kube-code-generator/tree/v1.27.0).
5 changes: 3 additions & 2 deletions _example/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMAGE := ghcr.io/slok/kube-code-generator:v1.27.0-2-g5239f0d-amd64
IMAGE := ghcr.io/slok/kube-code-generator:latest

DIRECTORY := $(PWD)
DEPS_CMD := go mod tidy
Expand All @@ -10,7 +10,8 @@ generate: generate-client

.PHONY: generate-client
generate-client:
docker run -it --rm -v $(DIRECTORY):/app $(IMAGE) \
@docker pull $(IMAGE)
@docker run -it --rm -v $(DIRECTORY):/app $(IMAGE) \
--apis-in ./apis \
--go-gen-out ./client \
--crd-gen-out ./manifests
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ require (
)

require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/sys v0.18.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs=
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -21,8 +21,9 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down

0 comments on commit 02b4c7c

Please sign in to comment.