- Notifications
You must be signed in to change notification settings - Fork 21
CLOUDP-341025: Refactor of existing snippets on master #366
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
Conversation
MCK 1.3.1 Release Notes |
3420ed1
to be64ad8
Compare d5fd23e
to b08575c
Compare b08575c
to d6f389d
Compare @@ -1,16 +1,36 @@ | |||
#!/usr/bin/env bash | |||
#!/bin/bash |
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.
nit: why?
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.
oh, thanks, it's a debugging leftover!
# Capture output first to check if it contains actual resources | ||
local temp_output | ||
temp_output=$(kubectl --context="${context}" -n "${namespace}" ${action} "${object}" 2>&1) | ||
| ||
# Check if output contains actual resources (not just empty list) | ||
# Skip if it's an empty YAML list (contains "items: []") | ||
if printf '%s\n' "${temp_output}" | grep -Fq "items: []"; then | ||
# Empty list, don't create file | ||
return | ||
fi | ||
| ||
if [[ -n "${out_file}" ]]; then | ||
{ | ||
header "${msg}" | ||
echo "${temp_output}" | ||
} > "${out_file}" | ||
else | ||
header "${msg}" | ||
kubectl --context="${context}" -n "${namespace}" ${action} "${object}" 2>&1 | ||
fi |
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.
nit: This indentation looks off in github.
bc7095f
to 9380a5a
Compare 674c669
to 6d985d9
Compare | ||
run 9100_delete_backup_namespaces.sh & | ||
run 9200_delete_om.sh & | ||
run ra-06_9100_delete_backup_namespaces.sh & |
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.
What is the significance of this ra
prefix?
Edit: I released it probably stands for reference architecture(s)
😄
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.
yes! :D
@@ -1,4 +1,4 @@ | |||
kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${OPERATOR_NAMESPACE}" rollout status deployment/mongodb-kubernetes-operator-multi-cluster | |||
kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${OPERATOR_NAMESPACE}" rollout status --timeout=2m deployment/mongodb-kubernetes-operator-multi-cluster |
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.
Was it getting stuck?
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.
Yes, but I don't have any proof anymore 🙈
I mean - not stuck, sometimes it took longer than default timeout on GKE clusters. Not sure why.
d63c5c1
to 56dbb8b
Compare evergreen refresh |
56dbb8b
to ed39d15
Compare 3588fa1
to d9d020a
Compare
Summary
This PR refactors how we generate and manage outputs from snippet tests.
Before, every snippet module has its own output/ directory. But because snippet modules were reused across different tests we had no way of storing the outputs from different test runs (the files were overwritten).
Changes were needed to accommodate upcoming Search snippets, but due to the large scale of this refactoring it was extracted onto master.
Only changes to public/architectures has been made performed in this PR. Existing search snippets are left intact and will be refactored on the search feature branch. After this PR is approved, a followup PR in the docs repo will be created adjusting for the new include paths.
This PR incorporated changes from #150 to fix diagnostic dumps from GKE clusters.
What this change will help
scripts/code_snippets/tests/outputs/test_*
instead of traversing the tree and dealing with the conflicts pushed from different test runs.Glossary
Snippet module
- directory containingtest.sh
and scripts in acode_snippets
sub directory. It's a reusable set of scripts, e.g.public/architectures/setup-multi-cluster/ra-01-setup-gke
.scripts/code_snippets/tests/test_gke_multi_cluster_no_mesh_snippets.sh
,scripts/code_snippets/test_gke_multi_cluster_snippets.sh
.scripts/code_snippets
dir (e.g.scripts/code_snippets/task_gke_multi_cluster_no_mesh_snippets_test.sh
).Snippet outputs
- output files (.out) gathered from aSnippet test
.Changes
scripts/code_snippets/tests/outputs/<test name>
directory, which is gathering all outputs from a given snippet test.scripts/code_snippets/validate_snippets.py
) added topre-commit
that enforces this convention., e.g.
ra-02-setup-operator. Every snippet file belonging to this module should be also prefixed (e.g.
ra-02_0046_create_image_pull_secrets.sh`)Here is the fragment of the current directory structure:
Proof of Work
Green EVG run for all snippets.
Checklist
skip-changelog
label if not needed