kubernetes-sigs / kubebuilder-declarative-pattern

A toolkit for building declarative operators with kubebuilder
Apache License 2.0
257 stars 85 forks source link

Enable backwards-compatibility with controller-runtime v0.15 #364

Closed annasong20 closed 11 months ago

annasong20 commented 11 months ago

What this PR does / why we need it:

This PR makes the code backwards-compatible with versions of controller-runtime before 0.16, which introduced the metrics/server package that kdp now uses. The PR uses //go:build to segregate handling of the metrics configuration depending on the version of controller-runtime.

Special notes for your reviewer:

N/A

Additional documentation:

The following links may be useful references

k8s-ci-robot commented 11 months ago

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

annasong20 commented 11 months ago

/cc @yuwenma @haiyanmeng

yuwenma commented 11 months ago

/lgtm

justinsb commented 11 months ago

Thanks @annasong20 - this is nice!

/approve /lgtm

k8s-ci-robot commented 11 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: annasong20, justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/OWNERS)~~ [justinsb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment