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

Handle .status.conditions on Services using in accordance with KEP-1623 #27399

Merged
merged 2 commits into from Aug 30, 2023

Conversation

addreas
Copy link
Contributor

@addreas addreas commented Aug 9, 2023

Currently the lbipam controller creates multiple .status.conditions per type of condition on the Services it updates. This conflicts with what's expected, as the ServiceStatus.Conditions is defined as a // +listType=map and // +listMapKey=type.

While the Kubernetes API server seems to not notice, tooling that utilizes strategic merge patches on the in-cluster resources will encounter errors such as error: failed to create manager for existing fields: failed to convert new object (network-cluster/nginx-ingress-controller; /v1, Kind=Service) to smd typed: .status.conditions: duplicate entries for key [type="io.cilium/lb-ipam-request-satisfied"].

Not quite sure if copy-pasting the required code for github.com/cilium/cilium/pkg/k8s/slim/k8s/apimachinery/pkg/api/meta from the apimachinery master branch and modifying the header is the correct way of doing things. Is that supposed to follow some specific version or be tracked somehow?

Haven't dug into building an image locally for testing, but at least go test ./operator/pkg/lbipam passes.

Fixes: #24945

@addreas addreas requested review from a team as code owners August 9, 2023 19:42
@addreas addreas requested a review from joamaki August 9, 2023 19:42
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 9, 2023
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Aug 9, 2023
@addreas addreas requested a review from a team as a code owner August 9, 2023 19:49
@addreas addreas requested a review from lambdanis August 9, 2023 19:49
Copy link
Contributor

@lambdanis lambdanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs structure looks good

@lambdanis lambdanis added kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium. labels Aug 10, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 10, 2023
@lambdanis
Copy link
Contributor

/test

@joestringer
Copy link
Member

Thanks for the PR! CI was passing before. Next step is getting @cilium/sig-k8s review, then once all reviewers are addressed and green we can do a rebase + re-run CI to confirm there's no breakage on tip of main branch. It'll also be worth evaluating whether we should backport this fix to v1.14 assuming it satisfies the backport criteria.

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Not quite sure if copy-pasting the required code for github.com/cilium/cilium/pkg/k8s/slim/k8s/apimachinery/pkg/api/meta from the apimachinery master branch and modifying the header is the correct way of doing things. Is that supposed to follow some specific version or be tracked somehow?

Please follow https://github.com/cilium/cilium/blob/main/pkg/k8s/slim/README.md and update it if the files you need in this PR aren't inside this script.

@addreas
Copy link
Contributor Author

addreas commented Aug 28, 2023

Updated the slim README with another curl line for the meta conditions utils. Changed the package path to line up more closely with the others, though I'm not sure I can actually see the pattern there.

…ties

This changes the behaviour such that any one type of condition will only appear once in the .status.conditions list.

Fixes: cilium#24945

Signed-off-by: Andreas Mårtensson <andreas@addem.se>
Signed-off-by: Andreas Mårtensson <andreas@addem.se>
@christarazi
Copy link
Member

LGTM. CCing @aanm to double check the process for slim-related changes.

@christarazi christarazi requested a review from aanm August 28, 2023 17:04
Copy link
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slim-related changes LGTM

@joamaki
Copy link
Contributor

joamaki commented Aug 29, 2023

/test

Edit: ci-ginkgo suite failed on one case due to some cancellation of a step, re-running

@christarazi christarazi added the sig/k8s Impacts the kubernetes API, or kubernetes -> cilium internals translation layers. label Aug 29, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 29, 2023
@borkmann borkmann merged commit 42bd6ef into cilium:main Aug 30, 2023
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic. kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium. sig/k8s Impacts the kubernetes API, or kubernetes -> cilium internals translation layers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flux cannot reconcile services anymore due to duplicate lb-ipam-request-satisfied status
8 participants