-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Conversation
MCK 1.3.0 Release NotesNew FeaturesMulti-Architecture SupportWe've added comprehensive multi-architecture support for the kubernetes operator. This enhancement enables deployment on IBM Power (ppc64le) and IBM Z (s390x) architectures alongside Bug Fixes
Other Changes
|
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
ca0ad72
to
ff88240
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