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

Wire up users controller and move internal clients package to pkg #236

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

andrewstucki
Copy link
Contributor

This PR does the following things:

  1. It wires up the users controller to run in v2 mode.
  2. It adds the CRDs to the kustomize manifest we tell users to point to when installing CRDs.
  3. It moves the internal/client package to pkg/client in anticipation of utilizing factories internally in our acceptance tests
  4. It adds a WithUser method on our factory to create clients who authenticate as a given SCRAM-based for authentication verification purposes in tests.
  5. It upgrades common-go and helm-charts dependencies to include some fixes

After this, the controller should be fully functional/runnable despite the acceptance tests not yet being merged. I will follow up with the acceptance test code that we can opine on the approach since it's introducing the first gherkin-based fully black-box tests.

This PR does the following things:

1. It wires up the users controller to run in v2 mode.
2. It adds the CRDs to the kustomize manifest we tell users to point to when installing CRDs.
3. It moves the internal/client package to pkg/client in anticipation of utilizing factories
internally in our acceptance tests
4. It adds a WithUser method on our factory to create clients who authenticate as a given SCRAM-based
for authentication verification purposes in tests.
5. It upgrades common-go and helm-charts dependencies to include some fixes

After this, the controller should be fully functional/runnable despite the acceptance tests not yet
being merged. I will follow up with the acceptance test code that we can opine on the approach since
it's introducing the first gherkin-based fully black-box tests.
@@ -93,7 +93,7 @@ func (s *Syncer) sync(ctx context.Context, principal string, rules []redpandav1a
func (s *Syncer) ListACLs(ctx context.Context, principal string) ([]redpandav1alpha2.ACLRule, error) {
describeResponse, err := s.listACLs(ctx, principal)
if err != nil {
return nil, err
return nil, fmt.Errorf("listing ACLs: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGTM

@RafalKorepta
Copy link
Contributor

Something went wrong. Operator v2 e2e tests are failing all over the place.

@andrewstucki
Copy link
Contributor Author

andrewstucki commented Sep 17, 2024

So, not entirely sure how we can fix this without doing a helm release or hacking in some additional stuff for our v2 tests. They're failing due to the controllers not starting up properly because of permission issues on users:

E0917 12:50:00.179351 1 reflector.go:147] pkg/mod/k8s.io/client-go@v0.29.5/tools/cache/reflector.go:229: Failed to watch *v1alpha2.User: failed to list *v1alpha2.User: users.cluster.redpanda.com is forbidden: User "system:serviceaccount:redpanda:redpanda-operator" cannot list resource "users" in API group "cluster.redpanda.com" in the namespace "redpanda"

The reason being that the test setup phase installs the operator with the latest released version of the helm chart:

- command: helm install --set logLevel=trace --set image.tag=dev
--set image.repository=localhost/redpanda-operator --namespace redpanda --create-namespace redpanda-operator
redpanda/operator --set rbac.createAdditionalControllerCRs=true --set additionalCmdFlags="{--additional-controllers=all}"
--set rbac.createRPKBundleCRs=true --wait

that means that if RBAC permissions change in the helm chart (like they need to here), we can't pass CI until we release the chart.

The RBAC PR already landed in the helm-charts repo in redpanda-data/helm-charts#1527, but since it's still unreleased the tests don't see the change. Ideally we'd be installing the helm chart from the tip of the main branch and/or locally (in a monorepo).

@andrewstucki andrewstucki merged commit c77ce61 into main Sep 17, 2024
5 checks passed
@andrewstucki andrewstucki deleted the user-controller-wire-up branch September 17, 2024 14:54
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.

2 participants