Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: public Builder compatibility with the BuilderInterface #1994

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

clamoriniere
Copy link
Contributor

What this PR does / why we need it:

This pull request add the changes introduced by #1864 into the "public" Builder (pkg/builder/Builder).

To avoid having future similar issue, this PR also add a interface type check between the pkg/build/type/BuilderInterface Interface and the pkg/build/Builder struct. It should allow to catch at compilation time any discrepancy.

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

It doesn't affect cardinality of KSM because it doesn't change any metrics generation logic.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 15, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 15, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 15, 2023
@CatherineF-dev
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2023
@clamoriniere
Copy link
Contributor Author

Hi @CatherineF-dev

thanks for the review.

Do you think, it can be back-ported after to previous release branch? I think the first release with this change is v2.7.0

@CatherineF-dev
Copy link
Contributor

QQ: want to know more about the context. What are the impacts of not backporting into v2.7.0?

Some new features can't be used or the binary will be broken.

@clamoriniere
Copy link
Contributor Author

QQ: want to know more about the context. What are the impacts of not backporting into v2.7.0?

Some new features can't be used or the binary will be broken.

Sure,

For context, we are vendoring part of the "kube-state-metrics" code in the datadog-agent (more details about why we are doing it in this blog post).
Currently we are vendoring kube-state-metrics version v2.4.2, but we discover a bug with Ingresses resource that is fixed in v2.7.0. So our initial tentative was to update to the last release version v2.8.0, but this version now vendor k8s.io/api v0.26.1 but our datadog-agent project only vendor v0.25.5, and we know that if we upgrade to to v0.26.0 now, we will break some compatibility with some deprecated Kubernetes resources on old Kubernetes versions.

So we tried to vendor the last version that uses k8s.io/api v0.25.x and that also has the Ingresses bug fix which corresponds to the version v2.7.0. And it is how we also discover that the pkg/builder/Builder struct is not anymore compliant with the BuilderInterface since the same version.
Here is the full story 😄

@mrueg
Copy link
Member

mrueg commented Feb 16, 2023

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CatherineF-dev, clamoriniere, L3n41c, mrueg

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 16, 2023
@k8s-ci-robot k8s-ci-robot merged commit da10923 into kubernetes:main Feb 16, 2023
@clamoriniere clamoriniere deleted the fix-builder-interface branch February 16, 2023 14:21
@mrueg mrueg mentioned this pull request Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants