diff --git a/.evergreen.yml b/.evergreen.yml index 78e2fbf80..d521f5c91 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -1862,7 +1862,17 @@ buildvariants: - name: private_kind_code_snippets display_name: private_kind_code_snippets - allowed_requesters: ["patch"] + tags: [ "e2e_test_suite" ] + allowed_requesters: ["patch", "github_pr"] + run_on: + - ubuntu2204-large + <<: *base_om8_dependency + tasks: + - name: kind_code_snippets_task_group + + - name: public_kind_code_snippets + display_name: public_kind_code_snippets + allowed_requesters: ["patch", "github_pr"] run_on: - ubuntu2204-large <<: *base_om8_dependency diff --git a/docs/community-search/quick-start/README.md b/docs/community-search/quick-start/README.md index 01998f597..3934db1ab 100644 --- a/docs/community-search/quick-start/README.md +++ b/docs/community-search/quick-start/README.md @@ -53,11 +53,7 @@ First, add the MongoDB Helm repository. This repository contains the Helm chart ```shell copy helm repo add mongodb https://mongodb.github.io/helm-charts helm repo update mongodb -if [[ "${OPERATOR_HELM_CHART}" != "helm_chart" ]]; then helm search repo "${OPERATOR_HELM_CHART}"; fi; -``` -After adding the repository, update your local Helm chart repository cache: -```shell -helm repo update +helm search repo mongodb/mongodb-kubernetes ``` ### 3. Install MongoDB Kubernetes Operator diff --git a/docs/community-search/quick-start/README.md.j2 b/docs/community-search/quick-start/README.md.j2 index ec2371869..0e3125075 100644 --- a/docs/community-search/quick-start/README.md.j2 +++ b/docs/community-search/quick-start/README.md.j2 @@ -38,10 +38,6 @@ First, add the MongoDB Helm repository. This repository contains the Helm chart ```shell copy {% include "code_snippets/090_helm_add_mogodb_repo.sh" %} ``` -After adding the repository, update your local Helm chart repository cache: -```shell -helm repo update -``` ### 3. Install MongoDB Kubernetes Operator diff --git a/docs/community-search/quick-start/code_snippets/0210_verify_community_search_pullsecret.sh b/docs/community-search/quick-start/code_snippets/0210_verify_community_search_pullsecret.sh index f9b442230..576824091 100644 --- a/docs/community-search/quick-start/code_snippets/0210_verify_community_search_pullsecret.sh +++ b/docs/community-search/quick-start/code_snippets/0210_verify_community_search_pullsecret.sh @@ -1,4 +1,4 @@ -echo "Verifying mongodb-kubernetes-database-pods contains proper pull secret" +echo "Verifying mongodb-kubernetes-database-pods service account contains proper pull secret" if ! kubectl get --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" -o json \ sa mongodb-kubernetes-database-pods -o=jsonpath='{.imagePullSecrets[*]}' | \ grep community-private-preview-pullsecret; then @@ -7,3 +7,4 @@ if ! kubectl get --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" sa mongodb-kubernetes-database-pods -o=yaml return 1 fi +echo "SUCCESS: mongodb-kubernetes-database-pods service account contains proper pull secret" diff --git a/docs/community-search/quick-start/code_snippets/090_helm_add_mogodb_repo.sh b/docs/community-search/quick-start/code_snippets/090_helm_add_mogodb_repo.sh index 8b19942ad..a348a3e0f 100644 --- a/docs/community-search/quick-start/code_snippets/090_helm_add_mogodb_repo.sh +++ b/docs/community-search/quick-start/code_snippets/090_helm_add_mogodb_repo.sh @@ -1,3 +1,3 @@ helm repo add mongodb https://mongodb.github.io/helm-charts helm repo update mongodb -if [[ "${OPERATOR_HELM_CHART}" != "helm_chart" ]]; then helm search repo "${OPERATOR_HELM_CHART}"; fi; +helm search repo mongodb/mongodb-kubernetes diff --git a/docs/community-search/quick-start/env_variables_e2e_public.sh b/docs/community-search/quick-start/env_variables_e2e_public.sh new file mode 100644 index 000000000..8a835d9b7 --- /dev/null +++ b/docs/community-search/quick-start/env_variables_e2e_public.sh @@ -0,0 +1,2 @@ +export K8S_CLUSTER_0_CONTEXT_NAME="${CLUSTER_NAME}" +export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}" diff --git a/scripts/code_snippets/sample_commit_output.sh b/scripts/code_snippets/sample_commit_output.sh index d54623980..ff2fd4e4a 100755 --- a/scripts/code_snippets/sample_commit_output.sh +++ b/scripts/code_snippets/sample_commit_output.sh @@ -3,7 +3,7 @@ set -Eeou pipefail source scripts/dev/set_env_context.sh -if [ "${COMMIT_OUTPUT:-false}" = true ]; then +if [[ "${CODE_SNIPPETS_COMMIT_OUTPUT:-"false"}" == "true" ]]; then echo "Pushing output files" branch="meko-snippets-update-$(date "+%Y%m%d%H%M%S")" git checkout -b "${branch}" diff --git a/scripts/dev/contexts/evg-private-context b/scripts/dev/contexts/evg-private-context index 423355528..52584edc7 100644 --- a/scripts/dev/contexts/evg-private-context +++ b/scripts/dev/contexts/evg-private-context @@ -101,6 +101,10 @@ export RUNNING_IN_EVG="true" export DELETE_KIND_NETWORK="true" +# code_snippets_commit_output can be set in evergreen patch by --param code_snippets_commit_output=true +# it's also set explicitly in public_*_snippets variants +export CODE_SNIPPETS_COMMIT_OUTPUT=${code_snippets_commit_output:-"false"} + # MCO # shellcheck disable=SC2154 export READINESS_PROBE_IMAGE="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-readinessprobe:${version_id}" diff --git a/scripts/dev/contexts/prerelease_gke_code_snippets b/scripts/dev/contexts/prerelease_gke_code_snippets index 8eb284746..61a07676f 100644 --- a/scripts/dev/contexts/prerelease_gke_code_snippets +++ b/scripts/dev/contexts/prerelease_gke_code_snippets @@ -11,7 +11,7 @@ source "${script_dir}/root-context" export MDB_GKE_PROJECT="scratch-kubernetes-team" export K8S_CLUSTER_SUFFIX="-${version_id}-${RANDOM}" -export COMMIT_OUTPUT=true +export CODE_SNIPPETS_COMMIT_OUTPUT=true # we reset evg host to use a default ~/.kube/config for GKE instead of the one from evg host export EVG_HOST_NAME="" diff --git a/scripts/dev/contexts/public_gke_code_snippets b/scripts/dev/contexts/public_gke_code_snippets index 8f93b699b..c8695b45e 100644 --- a/scripts/dev/contexts/public_gke_code_snippets +++ b/scripts/dev/contexts/public_gke_code_snippets @@ -18,4 +18,4 @@ export EVG_HOST_NAME="" # ENV_VARIABLES.SH overrides export OPERATOR_ADDITIONAL_HELM_VALUES="" export OPERATOR_HELM_CHART="" -export COMMIT_OUTPUT=true +export CODE_SNIPPETS_COMMIT_OUTPUT=true diff --git a/scripts/dev/contexts/public_kind_code_snippets b/scripts/dev/contexts/public_kind_code_snippets new file mode 100644 index 000000000..c3f64ba1a --- /dev/null +++ b/scripts/dev/contexts/public_kind_code_snippets @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# this context file is for code snippets running on GKE clusters +set -Eeou pipefail + +# overrides of public env_variables.sh +script_name=$(readlink -f "${BASH_SOURCE[0]}") +script_dir=$(dirname "${script_name}") + +source "${script_dir}/root-context" + +export NAMESPACE=mongodb +export CODE_SNIPPETS_FLAVOR=e2e_private +export CODE_SNIPPETS_COMMIT_OUTPUT=true