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-959: Stop calling MongoDB directly from the operator #1330

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

inelpandzic
Copy link
Contributor

@inelpandzic inelpandzic commented Sep 28, 2023

K8SPSMDB-959 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
The operator connects to MongoDB nodes directly.

Solution:
Instead of connecting directly to MongoDB, the operator now execs into pods and calls mongosh directly.

TODO

  • Handle getting namespace properly
  • Handle using proper mongo cli binary depending on the mongo version (mongo or mongosh)
  • Cover new logic with unit-tests

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 the manifests (crd/bundle) regenerated if needed?
  • 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?

@pull-request-size pull-request-size bot added the size/XL 500-999 lines label Sep 28, 2023
cmd/manager/main.go Outdated Show resolved Hide resolved
pkg/controller/perconaservermongodb/version.go Outdated Show resolved Hide resolved
if _, ok := cr.Labels["helm.sh/chart"]; ok {
vm.HelmDeployCR = true
}
vm.HelmDeployCR = false
Copy link
Contributor

Choose a reason for hiding this comment

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

[gofmt] reported by reviewdog 🐶

Suggested change
vm.HelmDeployCR = false
vm.HelmDeployCR = false

if _, ok := operatorDepl.Labels["helm.sh/chart"]; ok {
vm.HelmDeployOperator = true
}
vm.HelmDeployOperator = false
Copy link
Contributor

Choose a reason for hiding this comment

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

[gofmt] reported by reviewdog 🐶

Suggested change
vm.HelmDeployOperator = false
vm.HelmDeployOperator = false

if _, ok := cr.Labels["helm.sh/chart"]; ok {
vm.HelmDeployCR = true
}
vm.HelmDeployCR = false
Copy link
Contributor

Choose a reason for hiding this comment

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

[gofmt] reported by reviewdog 🐶

Suggested change
vm.HelmDeployCR = false
vm.HelmDeployCR = false

inelpandzic and others added 2 commits September 28, 2023 10:49
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
if _, ok := operatorDepl.Labels["helm.sh/chart"]; ok {
vm.HelmDeployOperator = true
}
vm.HelmDeployOperator = false
Copy link
Contributor

Choose a reason for hiding this comment

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

[gofmt] reported by reviewdog 🐶

Suggested change
vm.HelmDeployOperator = false
vm.HelmDeployOperator = false

@it-percona-cla
Copy link

it-percona-cla commented Oct 18, 2023

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

2 participants