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

K8SPSMDB-1245 Telemetry ClusterWideEnabled not handling multiple comma-separated namespaces #1829

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

nmarukovich
Copy link
Contributor

@nmarukovich nmarukovich commented Feb 14, 2025

K8SPSMDB-1245 Powered by Pull Request Badge

…a-separated namespaces

CHANGE DESCRIPTION

Problem:
Telemetry ClusterWideEnabled not handling multiple comma-separated namespaces

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Update value for ClusterWideEnabled

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

@@ -264,7 +264,7 @@ func (r *ReconcilePerconaServerMongoDB) getVersionMeta(ctx context.Context, cr *
BackupVersion: cr.Status.BackupVersion,
BackupsEnabled: cr.Spec.Backup.Enabled && len(cr.Spec.Backup.Storages) > 0,
ShardingEnabled: cr.Spec.Sharding.Enabled,
ClusterWideEnabled: len(watchNs) == 0,
ClusterWideEnabled: watchNs == "" || strings.Contains(watchNs, ","),
Copy link
Contributor

@gkech gkech Feb 14, 2025

Choose a reason for hiding this comment

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

A watchNs= "somenamespace," will be valid for this case? Maybe it is better to split the string and count that we have >1 splits which will mean that we have 2 or more namespaces

e.g. watchNs= "somenamespace,someothernamespace" will create 2 splits, split1: "somenamespace" and split2: "someothernamespace"

I think we can also include this implementation in the unit tests. We can perform a very small refactor to this part of the unit test we already have (Test_majorUpgradeRequested), and set the currentNs value from the test parameters instead of having it hardcoded.

@pull-request-size pull-request-size bot added size/S 10-29 lines and removed size/XS 0-9 lines labels Feb 18, 2025
@nmarukovich nmarukovich requested a review from gkech February 18, 2025 07:42
@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/S 10-29 lines labels Feb 18, 2025
@JNKPercona
Copy link
Collaborator

Test name Status
arbiter passed
balancer passed
custom-replset-name passed
custom-tls passed
custom-users-roles passed
custom-users-roles-sharded passed
cross-site-sharded passed
data-at-rest-encryption passed
data-sharded passed
demand-backup passed
demand-backup-fs passed
demand-backup-eks-credentials-irsa passed
demand-backup-physical passed
demand-backup-physical-sharded passed
demand-backup-sharded passed
expose-sharded passed
ignore-labels-annotations passed
init-deploy passed
finalizer passed
ldap passed
ldap-tls passed
limits passed
liveness passed
mongod-major-upgrade passed
mongod-major-upgrade-sharded passed
monitoring-2-0 passed
multi-cluster-service failure
non-voting passed
one-pod passed
operator-self-healing-chaos passed
pitr passed
pitr-sharded passed
pitr-physical passed
preinit-updates passed
pvc-resize passed
recover-no-primary passed
replset-overrides passed
rs-shard-migration passed
scaling passed
scheduled-backup passed
security-context passed
self-healing-chaos passed
service-per-pod passed
serviceless-external-nodes passed
smart-update passed
split-horizon passed
stable-resource-version passed
storage passed
tls-issue-cert-manager passed
upgrade passed
upgrade-consistency passed
upgrade-consistency-sharded-tls passed
upgrade-sharded passed
users passed
version-service passed
We run 55 out of 55

commit: b8d9551
image: perconalab/percona-server-mongodb-operator:PR-1829-b8d95519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M 30-99 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants