Crate core

Source
Expand description

Types and traits necessary for interacting with the Kubernetes API

This crate provides the minimal apimachinery necessary to make requests to the kubernetes API.

It does not export export a client, but it also has almost no dependencies.

Everything in this crate is re-exported from kube (even with zero features) under kube::core.

Modules§

admission
Contains types for implementing admission controllers.
cel
CEL validation for CRDs
conversion
Contains types useful for implementing custom resource conversion webhooks.
crd
Traits and tyes for CustomResources
discovery
Type information structs for API discovery
duration
Kubernetes Durations.
dynamic
Contains types for using resource kinds not known at compile-time.
error_boundary
Types for isolating deserialization failures. See DeserializeGuard.
gvk
Type information structs for dynamic resources.
labels
Type safe label selector logic
metadata
Metadata structs used in traits, lists, and dynamic objects.
object
Generic object and objectlist wrappers.
params
A port of request parameter *Optionals from apimachinery/types.go
request
Request builder type for arbitrary api types
response
Generic api response types
schema
Utilities for managing CustomResourceDefinition schemas
subresource
Request builder types and parameters for subresources
util
Utils and helpers
watch
Types for the watch api

Structs§

ApiResource
Information about a Kubernetes API resource
ClusterResourceScope
Indicates that a Resource is cluster-scoped.
DeserializeGuard
A wrapper type for K that lets deserializing the parent object succeed, even if the K is invalid.
Duration
A Kubernetes duration.
DynamicObject
A dynamic representation of a kubernetes object
DynamicResourceScope
Indicates that a Resource is of an indeterminate dynamic scope.
ErrorResponse
An error response from the API.
GroupVersion
Core information about a family of API Resources
GroupVersionKind
Core information about an API Resource.
GroupVersionResource
Represents a type-erased object resource.
ListMeta
ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
NamespaceResourceScope
Indicates that a Resource is namespace-scoped.
NotUsed
Empty struct for when data should be discarded
Object
A standard Kubernetes object with .spec and .status.
ObjectList
A generic Kubernetes object list
ObjectMeta
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
ParseExpressionError
Indicates failure of conversion to Expression
PartialObjectMeta
A generic representation of any object with ObjectMeta.
Request
A Kubernetes request builder
Rule
Rule is a CEL validation rule for the CRD field
Selector
Perform selection on a list of expressions
Status
A Kubernetes status object
SubResourceScope
Indicates that a Resource is neither cluster-scoped nor namespace-scoped.
TypeMeta
Type information that is flattened into every kubernetes object

Enums§

Expression
A selector expression with existing operations
ListMerge
ListType represents x-kubernetes merge strategy for list.
MapMerge
MapMerge represents x-kubernetes merge strategy for map.
Message
Message represents CEL validation message for the provided type
Reason
Reason is a machine-readable value providing more detail about why a field failed the validation.
StructMerge
StructMerge represents x-kubernetes merge strategy for struct.
Version
Version parser for Kubernetes version patterns
WatchEvent
A raw event returned from a watch query

Traits§

CustomResourceExt
Extension trait that is implemented by kube-derive
PartialObjectMetaExt
Helper trait for converting ObjectMeta into useful PartialObjectMeta variants
Resource
An accessor trait for a kubernetes Resource.
ResourceExt
Helper methods for resources.
ResourceScope
The scope of a Resource.
SelectorExt
Selector extension trait for querying selector-like objects

Functions§

api_version_from_group_version
Helper function that creates the apiVersion field from the group and version strings.
merge_properties
Merge schema properties in order to pass overrides or extension properties from the other schema.
merge_strategy
Merge strategy takes schema and applies a set of merge strategy x-kubernetes rules to it, such as “x-kubernetes-list-type” and “x-kubernetes-list-map-keys”.
merge_strategy_property
Merge strategy property mutates property under property_index of the schema with the provided set of merge strategy rules.
validate
Validate takes schema and applies a set of validation rules to it. The rules are stored on the top level under the “x-kubernetes-validations”.
validate_property
Validate property mutates property under property_index of the schema with the provided set of validation rules.