-
Notifications
You must be signed in to change notification settings - Fork 18
Allow for more than one deployment per test under cloud-qa #173
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
base: master
Are you sure you want to change the base?
Conversation
043f6e7
to
93baf39
Compare
4ba55b0
to
8515b05
Compare
93baf39
to
35c3435
Compare
8515b05
to
5ee79b4
Compare
evergreen retry |
# Summary This PR contains no functional changes - only moving functions around. It's extracting common bits imported from different places to their own files which resolves *some* cyclic dependencies in the code. It's by no means a complete refactor, it's an extracted refactor from the followup change (#173) which triggered cyclic dependencies in the first place. ## Proof of Work [Green EVG](https://spruce.mongodb.com/version/683fe9d44e8b7f0007877a9e/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC) ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [ ] Have you checked whether your jira ticket required DOCSP changes? - [ ] Have you checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](https://docs.google.com/document/d/1T93KUtdvONq43vfTfUt8l92uo4e4SEEvFbIEKOxGr44/edit?tab=t.0) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
5bd8491
to
94a69a9
Compare
evergreen refresh |
Try to use this in docker/mongodb-kubernetes-tests/tests/authentication/mongodb_custom_roles.py when #54 is merged |
q from @nammn: can you check whether those new projects are properly cleaned up in cloudmanager? |
94a69a9
to
b053f96
Compare
MCK 1.4.1 Release Notes |
8689e2c
to
5509206
Compare
f262059
to
4964f58
Compare
cat > "${wrapper_script}" << EOF | ||
#!/bin/bash | ||
# Define kubectl function to include the context | ||
set -x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this saves tons of log spamming when deploying csi drivers while creating kind clusters
|
||
func (m *MongoDBMultiCluster) GetProjectConfigMapName() string { | ||
return m.Spec.OpsManagerConfig.ConfigMapRef.Name | ||
return m.Spec.GetProject() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is release notes worthy. It was a bug that caused that MongoDBMultiCluster could handle only spec.opsManager
field, but in MongoDB we handle both spec.opsManager
and spec.cloudManager
via GetProject()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its a bug fix, should be in RN.
6245e5c
to
f432eb6
Compare
fa19d3d
to
de8fd69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
PTAL at my comments
|
||
func (m *MongoDBMultiCluster) GetProjectConfigMapName() string { | ||
return m.Spec.OpsManagerConfig.ConfigMapRef.Name | ||
return m.Spec.GetProject() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its a bug fix, should be in RN.
export TEST_MODE=opsmanager | ||
export OPS_MANAGER_REGISTRY="${BASE_REPO_URL}" | ||
|
||
export ops_manager_version="${CUSTOM_OM_VERSION}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why only here? Was it missing on the other variables? could we just rely on CUSTOM_OM_VERSION everywhere instead and remove ops_manager_version everywhere else instead?
om: Optional[MongoDBOpsManager], | ||
project_name: str, | ||
api_client: Optional[client.ApiClient] = None, | ||
) -> MongoDB: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt about a log line -> "we are running om vs cloudqa"?
Summary
This patch allows to deploy more than one database managed by cloud-qa in a single e2e test.
Currently it's only possible under Ops Manager tests which deploys it in the same test. With cloud-qa single test always used one project for the whole test with project_name=$NAMESPACE.
Deploying more than one database resource was therefore difficult and required manually crafting my-project config maps.
Additionally, this PR allows to reuse the whole test in both OM and cloud-qa tests with little changes to the code.
How does it work for OM?
Multiple mdb resources under OM are possible thanks to resource.configure() function, which requires to pass MongoDBOpsManager resource. It creates -project config map and credentials secret by using api keys that are available because there is an OM instance deployed in the same test.
How it was for cloud-qa tests?
Our tests were able to use only one "my-project" config map and credentials, which is created before the test pod is scheduled (configure_operator.sh). It contains fixed project name, which equals to the current namespace (a random string in CI). Reusing this config map leads to attempting to deploy mdb resource in the same cloud-qa project, which then the operator rejects.
What this PR changes for cloud-qa tests?
We hook into configure function allowing for passing None as ops manager resource. In this case we clone
my-project
config map and overwrite projectId to '{namespace}-{resourceName}'. The operator will then create a new cloud-qa project with that name allowing for running multiple cloud-qa-managed resources in one test.Refactored existing tests
Some tests were refactored to remove unnecessary manual project config maps:
Proof of Work
project config map was created (the default
my-project
is not used)evg link
which is automatically referenced in MongoDB resource
evg link
Checklist
Reminder (Please remove this when merging)