Skip to content

Conversation

@cbarbian-sap
Copy link
Contributor

@cbarbian-sap cbarbian-sap commented Dec 13, 2025

This PR has two purposes:

First, a step towards the standard 'errors' package is made. That is, any references to utilerrors.NewAggregate() and multierror.Append() are replaced by errors.Join(). Note that errors produced by errors.Join() support both errors.Is() and errors.As().
Furthermore, all imports of the deprecated 'github.com/pkg/errors' package are aliased as 'legacyerrors'. The only remaining usage of 'legacyerrors' should be legacyerrors.Wrap() and legacyerrors.Wrapf(). In a later phase, we will replace these by fmt.Errorf() with %w.

Second, the K8s client handling in component.Reconcile() is revisited. That is, instead of using the manager's client (i.e. mgr.GetClient()) for the component reconciler (that is the client interacting with the component resources), we construct a dedicated client from mgr.GetConfig() and mgr.GetScheme(). Notes:

  • the manager's scheme is still required to recognize the component's group and the corev1 group
  • the constructed clients will emit our metrics (which was not the case before)
  • hooks and implementations of component.Reference[T] still use the manager's client.

@cbarbian-sap cbarbian-sap changed the title Refactor client Refactor client handling Dec 13, 2025
@sap-email-compliance
Copy link

SAP employees are expected to use their SAP-email address for commits related to their work. Our compliance check has detected usage of an email other than a SAP one by a SAP employee. Please update your pull request accordingly.

If you thing this is wrong or need any assistance, please contact ospo@sap.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants