Skip to content

AUTOSCALE-166: fix yq dependency for running upstream karpenter tests#9060

Open
fishereskew wants to merge 1 commit into
openshift:mainfrom
fishereskew:fix-karpenter-e2e-yq-dependency
Open

AUTOSCALE-166: fix yq dependency for running upstream karpenter tests#9060
fishereskew wants to merge 1 commit into
openshift:mainfrom
fishereskew:fix-karpenter-e2e-yq-dependency

Conversation

@fishereskew

@fishereskew fishereskew commented Jul 22, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

Updates the yq dependency for running upstream karpenter tests using the karpenter-upstream-e2e make target to use the repo's yq.

Which issue(s) this PR fixes:

Fixes issue related to AUTOSCALE-166.
Updates the make target and adjust-ec2nodeclass.sh script to use the repo's managed yq tool instead of relying on a manually downloaded yq.

Special notes for your reviewer:

Related PR for adding upstream regression tests to aws-karpenter-provider-aws: openshift/release#82258

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Bug Fixes
    • Improved end-to-end test execution reliability by ensuring required YAML tooling is available before running the upstream scenario.
    • Updated end-to-end configuration adjustment scripts to use the repository-provided tooling consistently.
    • Improved consistency when stripping generated metadata and status fields from test YAML inputs.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 22, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 22, 2026

Copy link
Copy Markdown

@fishereskew: This pull request references AUTOSCALE-166 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Updates the yq dependency for running upstream karpenter tests using the karpenter-upstream-e2e make target to use the repo's yq.

Which issue(s) this PR fixes:

Fixes issue related to AUTOSCALE-166.
Updates the make target and adjust-ec2nodeclass.sh script to use the repo's managed yq tool instead of relying on a manually downloaded yq.

Special notes for your reviewer:

Related PR for adding upstream regression tests to aws-karpenter-provider-aws: openshift/release#82258

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added do-not-merge/needs-area area/karpenter-operator Indicates the PR includes changes related to the Karpenter operator labels Jul 22, 2026
@openshift-ci
openshift-ci Bot requested review from Nirshal and ironcladlou July 22, 2026 15:27
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 184e2004-ebb7-4b06-82ca-15f29fea5041

📥 Commits

Reviewing files that changed from the base of the PR and between 809e3ec and e6b3d6d.

📒 Files selected for processing (2)
  • Makefile
  • karpenter-operator/e2e/adjust-ec2nodeclass.sh

📝 Walkthrough

Walkthrough

The karpenter-upstream-e2e Make target now depends on the repository’s bundled yq binary. The EC2NodeClass adjustment script resolves the repository root and invokes that binary to remove metadata fields and .status from the specified YAML file.

Suggested reviewers: ironcladlou, nirshal

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: switching upstream Karpenter tests to the repository-managed yq dependency.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR only updates Makefile and a shell helper; no Ginkgo test titles were added or modified, so there are no unstable names to flag.
Test Structure And Quality ✅ Passed PASS: The PR only changes Makefile and a shell script; no Ginkgo test files or test blocks were modified.
Topology-Aware Scheduling Compatibility ✅ Passed Only Makefile and a shell script changed; neither adds manifests, controllers, or topology-sensitive scheduling logic.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests were added or modified; the PR only switches the yq binary path in Makefile and a helper script.
No-Weak-Crypto ✅ Passed Touched files only update yq wiring; no weak-crypto primitives, custom crypto, or secret comparisons appear in the changes.
Container-Privileges ✅ Passed The PR only changes a Makefile and a shell script; no container/K8s manifests or privileged settings were introduced.
No-Sensitive-Data-In-Logs ✅ Passed No new logging was added: adjust-ec2nodeclass.sh only updates yq path/edits YAML, and the Makefile target just runs the script.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In `@karpenter-operator/e2e/adjust-ec2nodeclass.sh`:
- Around line 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.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9ecb3a4e-ac4a-43bf-a273-6cb285d4f0f3

📥 Commits

Reviewing files that changed from the base of the PR and between 09265ac and 809e3ec.

📒 Files selected for processing (2)
  • Makefile
  • karpenter-operator/e2e/adjust-ec2nodeclass.sh

Comment on lines +10 to +13
$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"

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.

@maxcao13

Copy link
Copy Markdown
Member

lgtm except for failing gitlint

Signed-off-by: Fisher Eskew <feskew@redhat.com>
@fishereskew
fishereskew force-pushed the fix-karpenter-e2e-yq-dependency branch from 809e3ec to e6b3d6d Compare July 22, 2026 17:48
@maxcao13

maxcao13 commented Jul 22, 2026

Copy link
Copy Markdown
Member

/approve
/pipeline-required

I thought changing makefile would require elevated approver rights, but I guess not?

EDIT: never mind still does, I was just baited by the lone karpenter-operator label

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fishereskew, maxcao13
Once this PR has been reviewed and has the lgtm label, please assign jparrill for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@fishereskew: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.50%. Comparing base (09265ac) to head (e6b3d6d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9060   +/-   ##
=======================================
  Coverage   44.50%   44.50%           
=======================================
  Files         774      774           
  Lines       96980    96980           
=======================================
  Hits        43164    43164           
  Misses      50828    50828           
  Partials     2988     2988           
Flag Coverage Δ
cmd-support 38.39% <ø> (ø)
cpo-hostedcontrolplane 47.19% <ø> (ø)
cpo-other 45.25% <ø> (ø)
hypershift-operator 54.44% <ø> (ø)
other 32.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/karpenter-operator Indicates the PR includes changes related to the Karpenter operator jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants