clusterapi-client-go

module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: EUPL-1.2

README

= kumori clusterapi-client-go

Go-client for ClusterAPI and OpenStack.

== Prerequisites

`code-generator` package is able, using a set of GO definitions (structs), to generate
the elements that constitute a client-go library: "informers", "listers",...

The `code-generator` package (https://pkg.go.dev/k8s.io/code-generator) must
be installed. +
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
```

Currently, v0.25.6 version is used.

NOTE: To investigate: avoid installing the code-generator package, and simply
declare the dependency in this project.

== Source code

GO definitions are stored in these directories:
----
└── pkg
    ├── apis_bootstrap
    │   └── bootstrap
    │       └── v1beta1
    ├── apis_clusterapi
    │   └── clusterapi
    │       ├── errors
    │       ├── feature
    │       └── v1beta1
    ├── apis_controlplane
    │   └── controlplane
    │       └── v1beta1
    └── apis_openstack
        └── openstack
            └── v1alpha6
----

They are "more or less" a copy of certain directories of these repositories:

* https://pkg.go.dev/sigs.k8s.io/cluster-api@v1.6.1/api/v1beta1#Cluster
* https://pkg.go.dev/sigs.k8s.io/cluster-api@v1.6.1/api/v1beta1#MachineDeployment
* https://pkg.go.dev/sigs.k8s.io/cluster-api@v1.6.1/controlplane/kubeadm/api/v1beta1#KubeadmControlPlane
* https://pkg.go.dev/sigs.k8s.io/cluster-api@v1.6.1/bootstrap/kubeadm/api/v1beta1#KubeadmConfigTemplate
* https://pkg.go.dev/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6#OpenStackCluster
* https://pkg.go.dev/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6#OpenStackMachineTemplate

They are not exact copies, as directives have been added to instruct `code-generator`. +
Moreover, the OpenStack directories has been reduced to contain just the GO
definitions (original files contain a lot of logic).

== Generating the client-go libraries

Libraries can be re-generated executing the `update-codegen.sh` script:
----
$	go mod tidy // Required!

$ ./hack/update-codegen.sh
Generating clientset for clusterapi:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-clusterapi/clientset
Generating listers for clusterapi:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-clusterapi/listers
Generating informers for clusterapi:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-clusterapi/informers
Generating deepcopy funcs
Generating clientset for bootstrap:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-bootstrap/clientset
Generating listers for bootstrap:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-bootstrap/listers
Generating informers for bootstrap:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-bootstrap/informers
Generating deepcopy funcs
Generating clientset for controlplane:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-controlplane/clientset
Generating listers for controlplane:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-controlplane/listers
Generating informers for controlplane:v1beta1 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-controlplane/informers
Generating deepcopy funcs
Generating clientset for openstack:v1alpha6 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-openstack/clientset
Generating listers for openstack:v1alpha6 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-openstack/listers
Generating informers for openstack:v1alpha6 at gitlab.com/kumori-systems/community/libraries/clusterapi-client-go/pkg/generated-openstack/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.

Then, several `zz_generated.deepcopy.go` files will be created inside the source
directories, and several new directories (named `generated-xxx`) will be created.

Directories

Path Synopsis
pkg
apis_clusterapi/clusterapi/errors
Package errors makes a set of error message handlers available for use by Cluster API Providers.
Package errors makes a set of error message handlers available for use by Cluster API Providers.
apis_clusterapi/clusterapi/feature
Package feature implements feature functionality.
Package feature implements feature functionality.
apis_clusterapi/clusterapi/v1beta1
Package v1beta1 contains the v1beta1 API implementation.
Package v1beta1 contains the v1beta1 API implementation.
generated-bootstrap/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated-bootstrap/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated-bootstrap/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated-bootstrap/clientset/versioned/typed/bootstrap/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated-bootstrap/clientset/versioned/typed/bootstrap/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated-clusterapi/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated-clusterapi/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated-clusterapi/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated-clusterapi/clientset/versioned/typed/clusterapi/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated-clusterapi/clientset/versioned/typed/clusterapi/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated-controlplane/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated-controlplane/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated-controlplane/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated-controlplane/clientset/versioned/typed/controlplane/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated-controlplane/clientset/versioned/typed/controlplane/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated-openstack/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated-openstack/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated-openstack/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated-openstack/clientset/versioned/typed/openstack/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated-openstack/clientset/versioned/typed/openstack/v1beta1/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