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

Clean up Linseed elastic users for non-existent tenants #2930

Merged
merged 8 commits into from
Oct 20, 2023

Conversation

Josh-Tigera
Copy link
Contributor

-Export Elastic mock functions and structs for use more generally
-Introduce new test suite for users controller unit tests

Description

For PR author

  • Tests for change.
    - [ ] If changing pkg/apis/, run make gen-files
    - [ ] If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

-Export Elastic mock functions and structs for use more generally

-Introduce new test suite for users controller unit tests
Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

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

Looking good! A few minor comments so far

pkg/controller/logstorage/users/user_controller.go Outdated Show resolved Hide resolved
pkg/controller/logstorage/users/user_controller.go Outdated Show resolved Hide resolved
-Incorporate new expectation of a "clusterID" to be used in
ES username creation
-Add unit tests for ES username formatting and role generation
Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

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

Just a few minor comments but otherwise this LGTM

err = r.client.Get(ctx, clusterIDConfigMapKey, &clusterIDConfigMap)
if err != nil {
r.status.SetDegraded(operatorv1.ResourceReadError, fmt.Sprintf("Waiting for ConfigMap %s/%s to be available", clusterIDConfigMapKey.Namespace, clusterIDConfigMapKey.Name),
nil, reqLogger)
Copy link
Member

Choose a reason for hiding this comment

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

Should we pass err instead of nil here?

@Josh-Tigera Josh-Tigera merged commit 1835169 into tigera:master Oct 20, 2023
@Josh-Tigera Josh-Tigera deleted the josh.users-cleanup branch October 20, 2023 22:06
Josh-Tigera added a commit to Josh-Tigera/operator that referenced this pull request Oct 23, 2023
Clean up Linseed elastic users for non-existent tenants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants