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

refactor: move CRD registration to separate cell #24219

Merged

Conversation

knight42
Copy link
Contributor

@knight42 knight42 commented Mar 7, 2023

Fixes: #24068

/cc @pippolo84

@knight42 knight42 requested a review from a team as a code owner March 7, 2023 14:18
@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 Mar 7, 2023
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Mar 7, 2023
@christarazi
Copy link
Member

Travis has a failure, but it's unclear to me if it's related to this PR:

panic: *resource.resource[*github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1.Service].Events() called from /home/travis/gopath/src/github.com/cilium/cilium/operator/pkg/lbipam/lbipam.go:192 has a broken event handler that did not call Done() before event was garbage collected

                                                                                                                                                                                                                                                                                        

goroutine 5 [running]:                                                                                                                                                                                                                                                                  

github.com/cilium/cilium/pkg/k8s/resource.(*resource[...]).Events.func1.1()                                                                                                                                                                                                             

	/home/travis/gopath/src/github.com/cilium/cilium/pkg/k8s/resource/resource.go:343 +0x68                                                                                                                                                                                                 

FAIL	github.com/cilium/cilium/operator/pkg/lbipam	3.698s                        

cc @dylandreimerink

@pippolo84 pippolo84 self-requested a review March 8, 2023 09:25
Copy link
Member

@pippolo84 pippolo84 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 your PR!
I left some comments inline with suggestions on how to restructure the new cell.

operator/cmd/root.go Outdated Show resolved Hide resolved
operator/cmd/root.go Outdated Show resolved Hide resolved
operator/cmd/root.go Outdated Show resolved Hide resolved
@knight42
Copy link
Contributor Author

knight42 commented Mar 9, 2023

Thanks for your PR! I left some comments inline with suggestions on how to restructure the new cell.

Thanks for your detailed guidance, I will update this PR in a few days.

@knight42 knight42 requested a review from a team as a code owner March 10, 2023 16:27
@maintainer-s-little-helper
Copy link

Commit f7fd9410946764331bccd4d130934438f9a16d4f does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Mar 10, 2023
@knight42 knight42 force-pushed the refactor/modularize-crd-registration branch from f7fd941 to 5f03659 Compare March 10, 2023 16:30
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Mar 10, 2023
@knight42
Copy link
Contributor Author

Travis has a failure, but it's unclear to me if it's related to this PR:

panic: *resource.resource[*github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1.Service].Events() called from /home/travis/gopath/src/github.com/cilium/cilium/operator/pkg/lbipam/lbipam.go:192 has a broken event handler that did not call Done() before event was garbage collected

                                                                                                                                                                                                                                                                                        

goroutine 5 [running]:                                                                                                                                                                                                                                                                  

github.com/cilium/cilium/pkg/k8s/resource.(*resource[...]).Events.func1.1()                                                                                                                                                                                                             

	/home/travis/gopath/src/github.com/cilium/cilium/pkg/k8s/resource/resource.go:343 +0x68                                                                                                                                                                                                 

FAIL	github.com/cilium/cilium/operator/pkg/lbipam	3.698s                        

cc @dylandreimerink

The test passed this time, seems to be a flaky one 🤔

Copy link
Member

@pippolo84 pippolo84 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 updated PR!

The cell is ok, my main concern is about the management of the skipCRDCreation option. We can improve it moving to the cell itself.

pkg/k8s/apis/cilium.io/client/cell.go Outdated Show resolved Hide resolved
operator/cmd/root.go Outdated Show resolved Hide resolved
operator/cmd/root.go Outdated Show resolved Hide resolved
@knight42 knight42 force-pushed the refactor/modularize-crd-registration branch from 5f03659 to c7b6f0b Compare March 13, 2023 14:38
@knight42 knight42 requested review from a team as code owners March 13, 2023 14:38
@knight42 knight42 requested a review from rolinh March 13, 2023 14:38
@pippolo84 pippolo84 added the release-note/misc This PR makes changes that have no direct user impact. label Mar 14, 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 Mar 14, 2023
Copy link
Member

@pippolo84 pippolo84 left a comment

Choose a reason for hiding this comment

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

Changes look good, only things remaining are:

  • fix the operator options setting in controlplane test
  • update documentation in cmdref

I left some notes inline.

test/controlplane/suite/testcase.go Outdated Show resolved Hide resolved
@maintainer-s-little-helper
Copy link

Commit 113c868a1c20c183b4ac29858b1e5828e6ed8d4b does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Mar 15, 2023
@maintainer-s-little-helper
Copy link

Commits 113c868a1c20c183b4ac29858b1e5828e6ed8d4b, 0e794d6ac866468dc544abe1f8f7833067ec4941 do not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@knight42 knight42 force-pushed the refactor/modularize-crd-registration branch from 0e794d6 to 6714b8d Compare March 15, 2023 09:50
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Mar 15, 2023
@pippolo84
Copy link
Member

@pippolo84 Got it, so.. could we simply rerun this test? If all tests become green, I think we could get this PR merged +1

We usually avoid rerunning in this case, it would just hide the flake.
For the PR to be marked as ready to merge, we should wait for the other reviewers feedback.

@christarazi christarazi added area/operator Impacts the cilium-operator component area/modularization labels Mar 17, 2023
@knight42 knight42 force-pushed the refactor/modularize-crd-registration branch from 6714b8d to 396ccd6 Compare March 18, 2023 04:33
@knight42
Copy link
Contributor Author

@christarazi I have squashed the commits, PTAL

@knight42
Copy link
Contributor Author

gently ping @christarazi

@christarazi christarazi force-pushed the refactor/modularize-crd-registration branch from 396ccd6 to 767bd6a Compare March 22, 2023 06:09
@christarazi
Copy link
Member

/test

@youngnick
Copy link
Contributor

@knight42 the outstanding CI failure is a known flake that should now be fixed, #23272. If you rebase, it should clear up, and then this should be able to be merged.

@knight42 knight42 force-pushed the refactor/modularize-crd-registration branch from 767bd6a to 060c348 Compare March 23, 2023 03:15
@knight42
Copy link
Contributor Author

@knight42 the outstanding CI failure is a known flake that should now be fixed, #23272. If you rebase, it should clear up, and then this should be able to be merged.

Hi I have rebased and there is no CI error this time 🎉

@pippolo84
Copy link
Member

pippolo84 commented Mar 29, 2023

/test

Job 'Cilium-PR-K8s-1.25-kernel-4.19' failed:

Click to show.

Test Name

K8sDatapathServicesTest Checks E/W loadbalancing (ClusterIP, NodePort from inside cluster, etc) Tests NodePort inside cluster (kube-proxy) with IPSec and externalTrafficPolicy=Local

Failure Output

FAIL: Request from k8s1 to service http://[fd04::11]:30227 failed

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.25-kernel-4.19 so I can create one.

@ciliumbot
Copy link

Build finished.

@pippolo84 pippolo84 added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 29, 2023
@christarazi
Copy link
Member

@pippolo84 We should track the CI failures before we mark ready to merge.

@christarazi christarazi removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 29, 2023
@pippolo84
Copy link
Member

pippolo84 commented Mar 30, 2023

/mlh new-flake Cilium-PR-K8s-1.25-kernel-4.19

👍 created #24648

@pippolo84
Copy link
Member

pippolo84 commented Mar 30, 2023

/test-1.25-4.19

Job 'Cilium-PR-K8s-1.25-kernel-4.19' failed:

Click to show.

Test Name

K8sDatapathServicesTest Checks E/W loadbalancing (ClusterIP, NodePort from inside cluster, etc) Tests NodePort inside cluster (kube-proxy) with IPSec and externalTrafficPolicy=Local

Failure Output

FAIL: Request from k8s1 to service http://[fd04::11]:32161 failed

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.25-kernel-4.19 so I can create one.


Edit: Hit #24648 again

@pippolo84
Copy link
Member

/test-1.26-net-next

@christarazi
Copy link
Member

christarazi commented Mar 30, 2023

/test-1.25-4.19

Job 'Cilium-PR-K8s-1.25-kernel-4.19' failed:

Click to show.

Test Name

K8sDatapathServicesTest Checks E/W loadbalancing (ClusterIP, NodePort from inside cluster, etc) Tests NodePort inside cluster (kube-proxy) with IPSec and externalTrafficPolicy=Local

Failure Output

FAIL: Request from k8s1 to service http://[fd04::11]:30470 failed

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.25-kernel-4.19 so I can create one.

Fixes: cilium#24068

1. Move CRD registration to a separate cell inside the client package,
   and add a `--skip-crd-creation` flag.
2. Remove the `SkipCRDOption` from the `operatorOption.OperatorConfig` struct,
   alongside any reference to it in `operator/cmd/fags.go`,
   `operator/option/config.go` and `pkg/option/config.go`
3. Update cmdref

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
@christarazi christarazi force-pushed the refactor/modularize-crd-registration branch from 060c348 to b918d35 Compare March 30, 2023 22:20
@christarazi
Copy link
Member

christarazi commented Mar 30, 2023

/test

Edit: 5.4 hit #24573

@christarazi
Copy link
Member

/test-1.24-5.4

@christarazi christarazi merged commit ba2362a into cilium:master Mar 31, 2023
42 checks passed
@knight42 knight42 deleted the refactor/modularize-crd-registration branch March 31, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/modularization area/operator Impacts the cilium-operator component kind/community-contribution This was a contribution made by a community member. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modularization: Operator CRDs registration
6 participants