Experimental Kubernetes Operator kit written in Rust
Documentation:
This project is maintained by psFried
Once Roperator version 1.0 is released, it will strictly adhere to semantic versioning. For pre-1.0 releases (e.g. 0.1, 0.2) there will be breaking changes with each minor version change (e.g. from 0.1.x to 0.2.x). This guide will attempt to enumerate all of these breaking changes.
There were a number of breaking changes in the 0.2.0 release. Most of them were in the roperator::request
module, and were made in order to provide a nicer API for retrieving child resources from the SyncRequest
.
SyncRequest
:iter_children_with_type
function. Instead you can use `request.children().with_type(api_version, kind;raw_child
function. Instead, use request.children().of_type(k8s_type).get(namespace, name)
has_child
function. Instead use request.children().of_type(k8s_type).exists(namespace, name)
deserialize_child
function. Instead use request.children().with_type::<StructType>(k8s_type).get(namespace, name)
, where StructType
is the type that you want to deserialize toRequestChildren
:of_type
returns a RawView
and with_type
returns a TypedView
of_type
function has been renamed to with_type
, to make it more clear that it adds type informationof_type_raw
to just of_type
, which returns a RawView
Into<K8sTypeRef>
, which includes &K8sType
and (&str, &str)
exists
function. Use of_type(k8s_type).exists(namespace, name)
insteadTypedView
:get
and exists
functions to accept impl Into<ObjectIdRef<'a>>
instead of separate namespace
and name
arguments. Now you can pass &ObjectId
, ObjectIdRef
, or (&str, &str)
iter_raw
function. Use as_raw().iter()
insteadSyncRequest
and the K8sTypeRef
. This should not impact most usages, but may if you’re written out the full type on a variableRawView
:get
and exists
functions to accept impl Into<ObjectIdRef<'a>>
instead of separate namespace
and name
arguments. Now you can pass &ObjectId
, ObjectIdRef
, or (&str, &str)
SyncRequest
and the K8sTypeRef
. This should not impact most usages, but may if you’re written out the full type on a variableThere were also a number of breaking changes in the roperator::resource
module. These were mostly to simplify dealing with Kubernetes resources that are represented as plain JSON. Every resource has a type (represented by an apiVersion
and kind
) and an id
(represented by metadata.namespace
and metadata.name
). The representations of these have been simplified, and various things were added/changed to allow functions to accept a variety of representations of these.
roperator::resource::object_id
function was removed. Use the get_object_id
function from the ResourceJson
trait instead.roperator::resource::type_ref
function was removed. Use the get_type_ref
function from the ResourceJson
trait instead.roperator::resource::str_value
function was removed. Use Value::pointer(&str).and_then(Value::as_str)
instead.tokio
depencency:The tokio dependency has been updated to version 0.2
, which has a number of nice, but breaking,
changes. Most users will likely not be affected by this, but it does impact users who rely on the
function roperator::runner::start_operator_with_runtime
.