Releases: cisco-open/operator-tools
v0.27.0
What's Changed
- Upgrade go, k8s dependencies and objectmatcher by @pepov in https://github.com/banzaicloud/operator-tools/pull/89
Full Changelog: banzaicloud/operator-tools@v0.26.3...v0.27.0
v0.26.3
What's Changed
- Skip inventory configmap if namespace is under deletion by @pepov in https://github.com/banzaicloud/operator-tools/pull/88
Requires RBAC get
for the namespace the inventory is located in.
Full Changelog: banzaicloud/operator-tools@v0.26.2...v0.26.3
v0.26.0
What's Changed
- add note to EnabledComponent's docstring about usage with controller-gen by @siliconbrain in https://github.com/banzaicloud/operator-tools/pull/83
- Separate license check to GHA for pull requests and on master builds by @pepov in https://github.com/banzaicloud/operator-tools/pull/84
- StatefulSet immutable field change detection by @kralicky in https://github.com/banzaicloud/operator-tools/pull/82
New Contributors
- @kralicky made their first contribution in https://github.com/banzaicloud/operator-tools/pull/82
Full Changelog: banzaicloud/operator-tools@v0.25.4...v0.26.0
Allow configurable propagation for Replacement delete
Replacing a StatefulSet because of immutable fields WITH propagation deletes all the pods.
It does not obey the UpdateStrategy or respect a PodDisruptionBudget, causing downtime.
For statefulsets the following ReconcilerOpts
of a GenericResourceReconciler
can be used to delete the resource without deleting underlying pods. Recreating the statefulset will adopt existing pods as long as the labels match.
o := ReconcilerOpts{}
recreateErrorMessageSubstring := "Forbidden: updates to statefulset spec for fields other than"
o.RecreateErrorMessageSubstring = &recreateErrorMessageSubstring
o.EnableRecreateWorkloadOnImmutableFieldChange = true
o.RecreatePropagationPolicy = client.PropagationPolicy(metav1.DeletePropagationOrphan)
Note: this only applies to statefulsets for now but will be individually configurable for different resource types in a future release.
Fix object key matching in overlay patching
Configurable recreate
- Recreate only services and workloads (sts, deploy, ds) by default, but make it and the delay fully configurable
- Optionally recreate resource immediately
- Guard to check that invalid status errors (HTTP 422) are immutable field update errors
Immediately failing precondition checks
Adds the ability to use custom error type, that the precondition check logic could implement to see if an error returned from the check is a fatal one or not and set the status to failed (instead of reconciling) and return without a requeue request immediately.
Helm template modifiers and embeddable yaml layers
Adds the ability to use custom modifiers and yaml layers for resources prepared by the helm template reconciler before applying them on the cluster.
Modifiers can be used to apply arbitrary transformations on runtime.Objects from client code, while yaml layers can also perform deletions and have the ability to be embedded into CRDs directly.
SMP merger and typeoverrides
New package: pkg/typeoverride
Types in this package are the structural equivalent of their original Kubernetes counterparts with the difference, that required fields are declared as optional using omitempty or in certain cases some fields are left off.
The purpose of this is that now these types can be embedded into CRDs and can be used to provide a convenient override mechanism for resources created inside an operator combined with the Merge function in pkg/merge
Breaking change
Changes the signature of the Merge function in pkg/merge
and Unmarshal results directly into base.
Depractions
Base types in the pkg/types
are now deprecated in favour of using pkg/typeoverride
with pkg/merge
Tooling
Upgrade controller-gen to v0.4.1 and fix makefile to always use locally installed version
SMP merger and workload base types
This release contains a new feature and some improvements for override types.
The strategic merge patch based merger utility that is capable of merging structs without overwriting array fields, instead recursively merge fields inside them. This merger uses the kubernetes k8s.io/apimachinery/pkg/util/strategicpatch
library which uses the patchStrategy
and patchMergeKey
struct tags to identify items in arrays. The intent is to use this for declaring default values for arbitrary kubernetes resources and simply merge it with another that contains only overrides over the defaults.
There are new structs introduced in the types
package that supports a similar problem, but can control the override mechanism using custom override methods for each type to extend the original resource in the argument. These types are a more lightweight alternative for base kubernetes types and can be used to be included in CRDs and be used for user defined overrides on top of internal settings.