Releases: SAP/component-operator-runtime
v0.3.73: fix(deps): update module github.com/spf13/cobra to v1.9.1 (#232)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
v0.3.72
Incompatible changes
Background: values passed to the built-in generators and transformers
are of type map[string]any. Of course, templates are rendered with the missingkey=zero option.
But still, if a key is missing in the values, the empty value of any (returned in this case)
makes the go templating engine return <no value> in that case.
Helm decided to override that by replacing all occurrences of the string <no value> in any template output.
Starting with this PR we adopt the helm approach, and do the same.
v0.3.71
Incompatible changes
- The semantics of deletion policy
Orphanis slightly changed; previouslyOrphanhad no effect if a dependent object became redundant during apply (that is, it was part of the component manifest before, and is no longer now). Now, if an object has an effective deletion policyOrphan, then it will be always orphaned if- the object becomes redundant during apply or
- the component itself is deleted.
Enhancements
- To allow more fine-granular control over the orphan behaviour, there are two new deletion policy values:
OrphanOnApplyandOrphanOnDelete, with the obvious meaning. - A new parameterless template function
apiResourcesis added forKustomizeGenerator. It returns[]*metav1.APIResourceList, as returned by the discovery client's methodServerGroupsAndResources, see https://pkg.go.dev/k8s.io/client-go@v0.32.1/discovery#ServerResourcesInterface.ServerGroupsAndResources.
v0.3.70
Changes
This release finalizes the reworking of the force-reapply logic started in https://github.com/SAP/component-operator-runtime/releases/tag/v0.3.62.
So far, a dependent object was applied to the cluster if
- it does not exist or
- it exists and is out of sync (that is the annotated digest does not match) or
- it exists and its
status.inventory[].lastAppliedAttimestamp is set and is more than 60m in the past.
The third condition is now changed to
- it exists and its
status.inventory[].lastAppliedAttimestamp is not set, or is set and is more than 60m in the past.
As a consequence, the component CRD now must contain the status.inventory[].lastAppliedAt field, that is the consumers must have regenerated their CRD to reflect the current component-operator-runtime API types, as already stated in the release notes of v0.3.62.
v0.3.69
Enhancements
Starting with this release, the deletion of dependent objects will fail unless the existing value of the owner-id label of the dependent object matches the component that wants to delete it. If the owner-id label is missing, or the value does not match, the deletion will be rejected.
v0.3.68: fix(deps): update node.js to v23.7.0 (#215)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
v0.3.67
(Potentially) incompatible changes
-
The type
reconciler.ReconcilerOptionsis changed:- The boolean attribute
CreateMissingNamespacesis replaced with a new attributeMissingNamespacesPolicythat can have the valuesCreate(default) orDoNotCreate. The default behavior is backwards compatible; only people who explicitly have set the old attribute have to adopt the new notation in the obvious way. - Finalizer and field owner used by the reconciler can now explicitly be configured by setting the attributes
FinalizerandFieldOwnerin the reconciler options. If unset it defaults to the reconciler name passed toreconciler.NewReconciler(), which makes that change backwards compatible.
- The boolean attribute
-
The interface
component.PolicyConfigurationwas enhanced by an additional methodGetMissingNamespacesPolicy() reconciler.MissingNamespacesPolicy. People who implemented that interface explicitly have to add this method to their implementation. Most people however probably just includecomponent.PolicySpecinto their component's spec type. They don't have to react, but should regenerate their CRD manifest, in order to expose the new fieldspec.missingNamespacesPolicywhich is now contained incomponent.PolicySpec. -
The type
component.ReconcilerOptionsis changed in a way similar toreconciler.ReconcilerOptions(that is, the attributeCreateMissingNamespacesis replaced byMissingNamespacesPolicyand new attributesFinalizerandFieldOwnerare added). In addition, there is a new optionDefaultServiceAccountwhich allows the name of a service account that can be used during the reconciliation of a component to impersonate the client used to reconcile the dependent objects, as long as the component does not explicitly specify an impersonation or kubeconfig (by implementing theImpersonationConfigurationorClientConfigurationinterfaces); note that the specifiedDefaultServiceAccountalways refers to themetadata.namespaceor the component. -
When a component resource is reconciled, two Kubernetes API clients are constructed:
- The local client; it always points to the cluster where the component resides. If the component implements impersonation (that is, the component type or its spec implements the
ImpersonationConfigurationinterface), and an impersonation user or groups are specified by the component resource, then the specified user and groups are used to impersonate the controller's kubeconfig. Otherwise, if aDefaultServiceAccountis defined in the reconciler's options, then that service account (relative to the componentsmetadata.namespace) is used to impersonate the controller's kubeconfig. Otherwise, the controller's kubeconfig itself is used to build the local client. The local client is passed to generators via their context. For example, theHelmGeneratorandKustomizeGeneratorprovided by component-operator-runtime use the local client to realize thelocalLookupandmustLocalLookuptemplate functions. - The target client; if the component specifies a kubeconfig (by implementing the
ClientConfigurationinterface), then that kubeconfig is used to build the target client. Otherwise, a local client is used (possibly impersonated), created according the the logic described above. The target client is used to manage dependent objects, and is passed to generators via their context. For example, theHelmGeneratorandKustomizeGeneratorprovided by component-operator-runtime use the target client to realize thelookupandmustLookuptemplate functions.
This changes the previous impersonation logic a little bit. Other than before, no impersonation happens at all if a kubeconfig is specified (through
ClientConfiguration). In addition, relative service accounts returned byGetImpersonationUser()(that is: a user of the formsystem:serviceaccounts::name, setting an empty namespace), now will be interpreted always relative to themetadata.namespaceof the component resource; previously, the namespace specified by aPlacementConfigurationimplementation was considered as well; this is no longer the case. - The local client; it always points to the cluster where the component resides. If the component implements impersonation (that is, the component type or its spec implements the
-
The
clntparameter of theHelmGeneratorandKustomizeGeneratorconstructors is now ignored (and will be removed in a future release). Instead, these generators always use the local client, constructed as described above.
v0.3.66
fix(deps): update module sigs.k8s.io/controller-runtime to v0.20.1 (#…
v0.3.65: add template functions (must)lookupWithKubeConfig (#181)
* add template functions (must)lookupWithKubeConfig * change kubeconfig type from []byte to string
v0.3.64
update CONTRIBUTING