Skip to content
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
380 changes: 276 additions & 104 deletions .github/workflows/regression-test.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/collect/cluster_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (c *CollectClusterResources) Collect(progressChan chan<- interface{}) (Coll
// replicasets
replicasets, replicasetsErrors := replicasets(ctx, client, namespaceNames)
for k, v := range replicasets {
output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, fmt.Sprintf("%s-errors.json", constants.CLUSTER_RESOURCES_STATEFULSETS), k), bytes.NewBuffer(v))
output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_REPLICASETS, k), bytes.NewBuffer(v))
}
output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, fmt.Sprintf("%s-errors.json", constants.CLUSTER_RESOURCES_REPLICASETS)), marshalErrors(replicasetsErrors))

Expand Down Expand Up @@ -370,9 +370,9 @@ func (c *CollectClusterResources) Collect(progressChan chan<- interface{}) (Coll
// endpointslices
endpointslices, endpointslicesErrors := endpointslices(ctx, client, namespaceNames)
for k, v := range endpointslices {
_ = output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_ENDPOINTSICES, k), bytes.NewBuffer(v))
_ = output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_ENDPOINTSLICES, k), bytes.NewBuffer(v))
}
_ = output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, fmt.Sprintf("%s-errors.json", constants.CLUSTER_RESOURCES_ENDPOINTSICES)), marshalErrors(endpointslicesErrors))
_ = output.SaveResult(c.BundlePath, path.Join(constants.CLUSTER_RESOURCES_DIR, fmt.Sprintf("%s-errors.json", constants.CLUSTER_RESOURCES_ENDPOINTSLICES)), marshalErrors(endpointslicesErrors))

// Service Accounts
servicesAccounts, servicesAccountsErrors := serviceAccounts(ctx, client, namespaceNames)
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const (
CLUSTER_RESOURCES_CLUSTER_ROLE_BINDINGS = "clusterrolebindings"
CLUSTER_RESOURCES_PRIORITY_CLASS = "priorityclasses"
CLUSTER_RESOURCES_ENDPOINTS = "endpoints"
CLUSTER_RESOURCES_ENDPOINTSICES = "endpointslices"
CLUSTER_RESOURCES_ENDPOINTSLICES = "endpointslices"
CLUSTER_RESOURCES_SERVICE_ACCOUNTS = "serviceaccounts"
CLUSTER_RESOURCES_LEASES = "leases"
CLUSTER_RESOURCES_VOLUME_ATTACHMENTS = "volumeattachments"
Expand Down
24 changes: 12 additions & 12 deletions scripts/update_baselines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ trap "rm -rf $TEMP_DIR" EXIT
echo -e "\n${BLUE}Step 1: Downloading artifacts...${NC}"

# Download artifacts from the run
cd "$TEMP_DIR"
if ! gh run download "$RUN_ID" --name "regression-test-results-${RUN_ID}-1" 2>/dev/null; then
if ! gh run download "$RUN_ID" --name "regression-test-results-${RUN_ID}-1" --dir "$TEMP_DIR" 2>/dev/null; then
# Try without attempt suffix
if ! gh run download "$RUN_ID" 2>/dev/null; then
if ! gh run download "$RUN_ID" --dir "$TEMP_DIR" 2>/dev/null; then
echo -e "${RED}Error: Failed to download artifacts from run ${RUN_ID}${NC}"
gh run download "$RUN_ID" --dir "$TEMP_DIR"
exit 1
fi
fi
Expand All @@ -67,18 +67,18 @@ V1BETA3_BUNDLE=""
V1BETA2_BUNDLE=""
SUPPORTBUNDLE=""

if [ -f "preflight-v1beta3-bundle.tar.gz" ] || [ -f "test/output/preflight-v1beta3-bundle.tar.gz" ]; then
V1BETA3_BUNDLE=$(find . -name "preflight-v1beta3-bundle.tar.gz" | head -1)
if [ -f "$TEMP_DIR/preflight-v1beta3-bundle.tar.gz" ] || [ -f "$TEMP_DIR/test/output/preflight-v1beta3-bundle.tar.gz" ]; then
V1BETA3_BUNDLE=$(find "$TEMP_DIR" -name "preflight-v1beta3-bundle.tar.gz" | head -1)
echo -e "${GREEN}✓${NC} Found v1beta3 preflight bundle"
fi

if [ -f "preflight-v1beta2-bundle.tar.gz" ] || [ -f "test/output/preflight-v1beta2-bundle.tar.gz" ]; then
V1BETA2_BUNDLE=$(find . -name "preflight-v1beta2-bundle.tar.gz" | head -1)
if [ -f "$TEMP_DIR/preflight-v1beta2-bundle.tar.gz" ] || [ -f "$TEMP_DIR/test/output/preflight-v1beta2-bundle.tar.gz" ]; then
V1BETA2_BUNDLE=$(find "$TEMP_DIR" -name "preflight-v1beta2-bundle.tar.gz" | head -1)
echo -e "${GREEN}✓${NC} Found v1beta2 preflight bundle"
fi

if [ -f "supportbundle.tar.gz" ] || [ -f "test/output/supportbundle.tar.gz" ]; then
SUPPORTBUNDLE=$(find . -name "supportbundle.tar.gz" | head -1)
if [ -f "$TEMP_DIR/supportbundle.tar.gz" ] || [ -f "$TEMP_DIR/test/output/supportbundle.tar.gz" ]; then
SUPPORTBUNDLE=$(find "$TEMP_DIR" -name "supportbundle.tar.gz" | head -1)
echo -e "${GREEN}✓${NC} Found support bundle"
fi

Expand Down Expand Up @@ -110,21 +110,21 @@ echo -e "\n${BLUE}Step 3: Updating baselines...${NC}"
# Update v1beta3 baseline
if [ -n "$V1BETA3_BUNDLE" ]; then
mkdir -p test/baselines/preflight-v1beta3
cp "$TEMP_DIR/$V1BETA3_BUNDLE" test/baselines/preflight-v1beta3/baseline.tar.gz
cp "$V1BETA3_BUNDLE" test/baselines/preflight-v1beta3/baseline.tar.gz
echo -e "${GREEN}✓${NC} Updated preflight-v1beta3 baseline"
fi

# Update v1beta2 baseline
if [ -n "$V1BETA2_BUNDLE" ]; then
mkdir -p test/baselines/preflight-v1beta2
cp "$TEMP_DIR/$V1BETA2_BUNDLE" test/baselines/preflight-v1beta2/baseline.tar.gz
cp "$V1BETA2_BUNDLE" test/baselines/preflight-v1beta2/baseline.tar.gz
echo -e "${GREEN}✓${NC} Updated preflight-v1beta2 baseline"
fi

# Update support bundle baseline
if [ -n "$SUPPORTBUNDLE" ]; then
mkdir -p test/baselines/supportbundle
cp "$TEMP_DIR/$SUPPORTBUNDLE" test/baselines/supportbundle/baseline.tar.gz
cp "$SUPPORTBUNDLE" test/baselines/supportbundle/baseline.tar.gz
echo -e "${GREEN}✓${NC} Updated supportbundle baseline"
fi

Expand Down
7 changes: 7 additions & 0 deletions test/baselines/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"updated_at": "2025-11-25T23:50:28Z",
"git_sha": "6cc6705527f5fd3d593ba38e088c1fb28a1eb803",
"workflow_run_id": "19687562008",
"k8s_version": "v1.28.3",
"updated_by": "Ethan Mosbaugh <[email protected]>"
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Accidentally committed baseline metadata file

The test/baselines/metadata.json file contains hardcoded values from a specific test run, including a timestamp, git SHA, workflow run ID, and user email. This file should be generated dynamically by the update_baselines.sh script rather than committed with specific values. The presence of this file suggests it was accidentally included from a local test run.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i am supposed to commit this

Binary file modified test/baselines/preflight-v1beta2/baseline.tar.gz
Binary file not shown.
Binary file modified test/baselines/preflight-v1beta3/baseline.tar.gz
Binary file not shown.
Binary file modified test/baselines/supportbundle/baseline.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion test/e2e/support-bundle/cluster_resources_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestClusterResources(t *testing.T) {
"roles",
"events",
"rolebindings",
"statefulsets-errors.json",
"replicasets",
"jobs",
"serviceaccounts",
"configmaps",
Expand Down
Loading