slim/

directory
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0

README

Slim Kubernetes structures

This package is intended to be a slim copy of the structures used in k8s watchers.

The most common structures are under vendor/k8s.io/api/core/v1/types.go, or vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go.

tag=v1.25.0
url="https://raw.githubusercontent.com/kubernetes/kubernetes/${tag}"

curl "${url}/staging/src/k8s.io/api/core/v1/doc.go" > pkg/k8s/slim/k8s/api/core/v1/doc.go
curl "${url}/staging/src/k8s.io/api/core/v1/register.go" > pkg/k8s/slim/k8s/api/core/v1/register.go
curl "${url}/staging/src/k8s.io/api/core/v1/taint.go" > pkg/k8s/slim/k8s/api/core/v1/taint.go
curl "${url}/staging/src/k8s.io/api/core/v1/types.go" > pkg/k8s/slim/k8s/api/core/v1/types.go

curl "${url}/staging/src/k8s.io/api/discovery/v1beta1/doc.go" > pkg/k8s/slim/k8s/api/discovery/v1beta1/doc.go
curl "${url}/staging/src/k8s.io/api/discovery/v1beta1/register.go" > pkg/k8s/slim/k8s/api/discovery/v1beta1/register.go
curl "${url}/staging/src/k8s.io/api/discovery/v1beta1/types.go" > pkg/k8s/slim/k8s/api/discovery/v1beta1/types.go
curl "${url}/staging/src/k8s.io/api/discovery/v1beta1/well_known_labels.go" > pkg/k8s/slim/k8s/api/discovery/v1beta1/well_known_labels.go

curl "${url}/staging/src/k8s.io/api/discovery/v1/doc.go" > pkg/k8s/slim/k8s/api/discovery/v1/doc.go
curl "${url}/staging/src/k8s.io/api/discovery/v1/register.go" > pkg/k8s/slim/k8s/api/discovery/v1/register.go
curl "${url}/staging/src/k8s.io/api/discovery/v1/types.go" > pkg/k8s/slim/k8s/api/discovery/v1/types.go
curl "${url}/staging/src/k8s.io/api/discovery/v1/well_known_labels.go" > pkg/k8s/slim/k8s/api/discovery/v1/well_known_labels.go

curl "${url}/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/doc.go" > pkg/k8s/slim/k8s/apis/apiextensions/v1/doc.go
curl "${url}/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/register.go" > pkg/k8s/slim/k8s/apis/apiextensions/v1/register.go
curl "${url}/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go" > pkg/k8s/slim/k8s/apis/apiextensions/v1/types.go

curl "${url}/staging/src/k8s.io/apimachinery/pkg/labels/doc.go" > pkg/k8s/slim/k8s/apis/labels/doc.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/labels/labels.go" > pkg/k8s/slim/k8s/apis/labels/labels.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/labels/selector.go" > pkg/k8s/slim/k8s/apis/labels/selector.go

curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go" > pkg/k8s/slim/k8s/apis/meta/v1/validation/validation.go

curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/doc.go" > pkg/k8s/slim/k8s/apis/meta/v1/doc.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go" > pkg/k8s/slim/k8s/apis/meta/v1/helpers.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go" > pkg/k8s/slim/k8s/apis/meta/v1/meta.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/register.go" > pkg/k8s/slim/k8s/apis/meta/v1/register.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go" > pkg/k8s/slim/k8s/apis/meta/v1/time.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_proto.go" > pkg/k8s/slim/k8s/apis/meta/v1/time_proto.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go" > pkg/k8s/slim/k8s/apis/meta/v1/types.go

curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1/doc.go" > pkg/k8s/slim/k8s/apis/meta/v1beta1/doc.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1/register.go" > pkg/k8s/slim/k8s/apis/meta/v1beta1/register.go
curl "${url}/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1beta1/types.go" > pkg/k8s/slim/k8s/apis/meta/v1beta1/types.go

curl "${url}/staging/src/k8s.io/api/networking/v1/doc.go" > pkg/k8s/slim/k8s/api/networking/v1/doc.go
curl "${url}/staging/src/k8s.io/api/networking/v1/register.go" > pkg/k8s/slim/k8s/api/networking/v1/register.go
curl "${url}/staging/src/k8s.io/api/networking/v1/types.go" > pkg/k8s/slim/k8s/api/networking/v1/types.go
curl "${url}/staging/src/k8s.io/api/networking/v1/well_known_annotations.go" > pkg/k8s/slim/k8s/api/networking/v1/well_known_annotations.go

curl "${url}/staging/src/k8s.io/apimachinery/pkg/selection/operator.go" > pkg/k8s/slim/k8s/apis/selection/operator.go

curl "${url}/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go" > pkg/k8s/slim/k8s/apis/util/intstr/intstr.go

All fields of the copied structures are exactly the same as the ones available in the official k8s source code. To keep a slimmer version of these structures make sure the unused fields by Cilium are removed from the slimmer versions.

If new fields need to be added or removed to these structures, some files need to be regenerated with make generate-k8s-api in the root directory of this repository.

The directory ./k8s/client is entirely auto-generated. This directory has the source code of an optimized Kubernetes client.

With this optimized Kubernetes client we can wrap some official and non-optimized Kubernetes interfaces with the ones built for the slimmer versions. So make sure you are correctly wrapping the interfaces with our implementations. If this client is used a structure that is not registered under "register.go" of that package or if the client is being used for a type that is not optimized yet, you will hit the error: Failed to list ... no kind "..." is registered for version "v1". To fix this make sure the package is registered and the client is supposed to be used for that structure.

Directories

Path Synopsis
k8s
api/core/v1
Package v1 contains slimmer versions of k8s core types.
Package v1 contains slimmer versions of k8s core types.
api/discovery/v1
Package v1 contains slimmer versions of k8s discovery types.
Package v1 contains slimmer versions of k8s discovery types.
api/discovery/v1beta1
Package v1beta1 contains slimmer versions of k8s discovery types.
Package v1beta1 contains slimmer versions of k8s discovery types.
api/networking/v1
Package v1 contains slimmer versions of k8s networking types.
Package v1 contains slimmer versions of k8s networking types.
apiextensions-client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
apiextensions-client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
apiextensions-client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
apiextensions-client/clientset/versioned/typed/apiextensions/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
apiextensions-client/clientset/versioned/typed/apiextensions/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
apis/apiextensions/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
apis/labels
Package labels implements a simple label system, parsing and matching selectors with sets of labels.
Package labels implements a simple label system, parsing and matching selectors with sets of labels.
apis/meta/v1
Package types contains slimmer versions of k8s types.
Package types contains slimmer versions of k8s types.
apis/meta/v1beta1
package v1beta1 is alpha objects from meta that will be introduced.
package v1beta1 is alpha objects from meta that will be introduced.
apis/util/intstr
Package types contains slimmer versions of k8s types.
Package types contains slimmer versions of k8s types.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/core/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/core/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/discovery/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/discovery/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/discovery/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/discovery/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/networking/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/networking/v1/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