Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,13 @@ dockerfiles:
python scripts/update_supported_dockerfiles.py
tar -czvf ./public/dockerfiles-$(VERSION).tgz ./public/dockerfiles

prepare-local-e2e: reset-mco # prepares the local environment to run a local operator
# prepares the local environment to run a local operator for e2e tests
prepare-local-e2e: reset-mco
scripts/dev/prepare_local_e2e_run.sh

# prepares the local environment to run a local operator as well as installs the helm chart to enable running the operator and reconcile resources without the need to run an e2e test
prepare-local-with-helm: reset-mco
DEPLOY_OPERATOR=true OVERRIDE_INSTALL_ROLES=true scripts/dev/prepare_local_e2e_run.sh

prepare-operator-configmap: # prepares the local environment to run a local operator
source scripts/dev/set_env_context.sh && source scripts/funcs/printing && source scripts/funcs/operator_deployment && prepare_operator_config_map "$(kubectl config current-context)"
24 changes: 12 additions & 12 deletions scripts/dev/prepare_local_e2e_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ make install 2>&1 | prepend "make install: "
test -f "docker/mongodb-enterprise-tests/.test_identifiers" && rm "docker/mongodb-enterprise-tests/.test_identifiers"
scripts/dev/delete_om_projects.sh

if [[ "${DEPLOY_OPERATOR:-"false"}" == "true" ]]; then
echo "installing operator helm chart to create the necessary sa and roles"
# shellcheck disable=SC2178
helm_values=$(get_operator_helm_values)
# shellcheck disable=SC2179
if [[ "${LOCAL_OPERATOR}" == true ]]; then
helm_values+=" operator.replicas=0"
if [[ "${KUBE_ENVIRONMENT_NAME}" == "kind" ]]; then
if [[ "${DEPLOY_OPERATOR:-"false"}" == "true" ]]; then
echo "installing operator helm chart to create the necessary sa and roles"
# shellcheck disable=SC2178
helm_values=$(get_operator_helm_values)
# shellcheck disable=SC2179
if [[ "${LOCAL_OPERATOR}" == true ]]; then
helm_values+=" operator.replicas=0"
fi

# shellcheck disable=SC2128
helm upgrade --install mongodb-enterprise-operator helm_chart --set "$(echo "${helm_values}" | tr ' ' ',')"
fi

# shellcheck disable=SC2128
helm upgrade --install mongodb-enterprise-operator helm_chart --set "$(echo "${helm_values}" | tr ' ' ',')"
fi

if [[ "${KUBE_ENVIRONMENT_NAME}" == "kind" ]]; then
echo "patching all default sa with imagePullSecrets to ensure we can deploy without setting it for each pod"

service_accounts=$(kubectl get serviceaccounts -n "${NAMESPACE}" -o jsonpath='{.items[*].metadata.name}')
Expand Down
3 changes: 2 additions & 1 deletion scripts/funcs/multicluster
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,12 @@ run_multi_cluster_kube_config_creator() {
"--member-cluster-namespace" "${NAMESPACE}"
"--central-cluster-namespace" "${NAMESPACE}"
"--service-account" "mongodb-enterprise-operator-multi-cluster"
"--image-pull-secrets=image-registries-secret"
)

# This is used to skip the database roles when the context configures clusters so that the operator cluster is also used as one of the member clusters.
# In case of this overlap we cannot install those roles here as otherwise multi-cluster cli tool
if [[ ! "${MEMBER_CLUSTERS}" == *"${CLUSTER_NAME}"* ]]; then
if [[ ! "${MEMBER_CLUSTERS}" == *"${CLUSTER_NAME}"* || ${OVERRIDE_INSTALL_ROLES:-"false"} == "true" ]]; then
>&2 echo "WARNING: When running e2e tests for multicluster locally, installing database roles by cli tool might cause failures when installing the operator in e2e test."
params+=("--install-database-roles")
fi
Expand Down