client-go

module
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2023 License: EUPL-1.2

README

= kumori client-go

Go client for Kumori objects (informers, listers...) in Kubernetes

== Code-generator

From the type definitions included in `pkg/apis/kumori/v1` and `pkg/apis_ambassador/getambassador.io/v1`, it is necessary to generate code to implement different functionalities (informers, listers, deep-copy, ...).

The "code-generator" package (https://pkg.go.dev/k8s.io/code-generator) is used for this purpose:

- Install the package, executing `go install k8s.io/code-generator@v0.21.9`
- The package includes two scripts (only one is really used for us), to which execution permissions must be granted:
```
chmod +x $GOPATH/pkg/mod/k8s.io/code-generator@v0.21.9/generate-groups.sh
chmod +x $GOPATH/pkg/mod/k8s.io/code-generator@v0.21.9/generate-internal-groups.sh
```
- When the package will be used, some executables will be installed in the go bin path:
```
$ ls $GOPATH/bin/ | grep "\-gen"
client-gen
deepcopy-gen
defaulter-gen
informer-gen
lister-gen
```
- To generate the code, just use the script included in the client-go repository:
```
$ ./hack/update-codegen.sh
Generating clientset for kumori:v1 at gitlab.com/kumori-systems/community/libraries/client-go/pkg/generated/clientset
Generating listers for kumori:v1 at gitlab.com/kumori-systems/community/libraries/client-go/pkg/generated/listers
Generating informers for kumori:v1 at gitlab.com/kumori-systems/community/libraries/client-go/pkg/generated/informers
Generating deepcopy funcs
Generating clientset for getambassador.io:v1 at gitlab.com/kumori-systems/community/libraries/client-go/pkg/generated_ambassador/clientset
Generating listers for getambassador.io:v1 at gitlab.com/kumori-systems/community/libraries/client-go/pkg/generated_ambassador/listers
Generating informers for getambassador.io:v1 at gitlab.com/kumori-systems/community/libraries/client-go/pkg/generated_ambassador/informers
Generating deepcopy funcs
```

NOTE: The `update-codegen.sh` script contains a variable `CODEGEN_PKG` with the path to the code-generator package, that must be adjusted when a new version of the package is used.

WARNING: It might be necessary to run `go mod tidy` before generating the code (to avoid errors like `Hit an unsupported type invalid type for map[string]invalid type`).

Directories

Path Synopsis
pkg
apis/kumori/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
apis_ambassador/getambassador.io/v3alpha1
Package v3alpha1 is the v3alpha1 version of the API.
Package v3alpha1 is the v3alpha1 version of the API.
generated/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/kumori/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/kumori/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated_ambassador/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated_ambassador/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated_ambassador/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated_ambassador/clientset/versioned/typed/getambassador.io/v3alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated_ambassador/clientset/versioned/typed/getambassador.io/v3alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL