Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ cpo-container-sync:
# - current context to be set to a hosted cluster with AutoNode enabled.
# - an annotation to be applied to the HCP to stop reconcillation (hypershift.openshift.io/karpenter-core-e2e-override=true)
.PHONY: karpenter-upstream-e2e
karpenter-upstream-e2e:
karpenter-upstream-e2e: $(YQ)
./karpenter-operator/e2e/upstream-e2e.sh

## --------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions karpenter-operator/e2e/adjust-ec2nodeclass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

FILE=$1

SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(cd "${SCRIPT_DIR}/../.." && pwd)
YQ="${REPO_ROOT}/hack/tools/bin/yq"

# delete metadata fields
yq 'del(.metadata.creationTimestamp, .metadata.generation, .metadata.managedFields, .metadata.resourceVersion, .metadata.selfLink, .metadata.uid)' -i "$FILE"
$YQ 'del(.metadata.creationTimestamp, .metadata.generation, .metadata.managedFields, .metadata.resourceVersion, .metadata.selfLink, .metadata.uid)' -i "$FILE"

# delete status
yq 'del(.status)' -i "$FILE"
$YQ 'del(.status)' -i "$FILE"
Comment on lines +10 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="karpenter-operator/e2e/adjust-ec2nodeclass.sh"
wc -l "$file"
cat -n "$file" | sed -n '1,120p'

Repository: openshift/hypershift

Length of output: 698


Quote the repository-local yq path. $YQ is expanded unquoted, so karpenter-operator/e2e/adjust-ec2nodeclass.sh breaks when the checkout path contains whitespace or glob characters. Quote both invocations.

Proposed fix
-"$YQ" ...
+"$YQ" ...
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$YQ 'del(.metadata.creationTimestamp, .metadata.generation, .metadata.managedFields, .metadata.resourceVersion, .metadata.selfLink, .metadata.uid)' -i "$FILE"
# delete status
yq 'del(.status)' -i "$FILE"
$YQ 'del(.status)' -i "$FILE"
"$YQ" 'del(.metadata.creationTimestamp, .metadata.generation, .metadata.managedFields, .metadata.resourceVersion, .metadata.selfLink, .metadata.uid)' -i "$FILE"
# delete status
"$YQ" 'del(.status)' -i "$FILE"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@karpenter-operator/e2e/adjust-ec2nodeclass.sh` around lines 10 - 13, Quote
the repository-local yq executable expansion in both invocations within the
adjust-ec2nodeclass script: update the commands deleting metadata fields and
status to invoke "$YQ", preserving their existing expressions and arguments.