Skip to content

fix: OCPBUGS-86799: Add SpotTerminationHandlerConfigured condition for spot NodePools - #8646

Closed
dpateriya wants to merge 1 commit into
openshift:mainfrom
dpateriya:OCPBUGS-86799/spot-termination-handler-condition
Closed

fix: OCPBUGS-86799: Add SpotTerminationHandlerConfigured condition for spot NodePools#8646
dpateriya wants to merge 1 commit into
openshift:mainfrom
dpateriya:OCPBUGS-86799/spot-termination-handler-condition

Conversation

@dpateriya

@dpateriya dpateriya commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a new NodePool condition SpotTerminationHandlerConfigured that warns users when a spot-enabled NodePool exists but the HostedCluster lacks spec.platform.aws.terminationHandlerQueueURL
  • The condition is set to False with reason TerminationHandlerQueueURLNotSet and an actionable message when the queue URL is missing
  • The condition is only present on spot-enabled NodePools (removed for on-demand NodePools)
  • This is a warning only — NodePool reconciliation continues normally

Jira: https://redhat.atlassian.net/browse/OCPBUGS-86799

Problem

When a NodePool with marketType: Spot is created on a HostedCluster without terminationHandlerQueueURL, the Node Termination Handler (NTH) silently fails to deploy. Users unknowingly run spot instances without graceful interruption handling — spot interruptions result in abrupt instance termination with no cordon, drain, or PDB compliance.

Solution

Surface a NodePool status condition that:

  1. Only appears on spot-enabled NodePools
  2. Clearly tells the user what is missing and how to fix it
  3. Does not block reconciliation (warning only)

Test plan

  • Unit tests added in conditions_test.go covering:
    • When spot enabled + queue URL set → condition True
    • When spot enabled + queue URL empty → condition False with message
    • When spot enabled + AWS platform nil → condition False with message
    • When spot not enabled → condition removed
  • Full ./hypershift-operator/controllers/nodepool/... test suite passes
  • make hypershift-api regenerates CRDs successfully
  • gofmt clean

Made with Cursor

Summary by CodeRabbit

Release Notes

  • New Features
    • Added nodepool condition monitoring for spot instance termination handler configuration. The system now tracks and reports whether the infrastructure for graceful spot instance termination is properly configured when spot instances are enabled on a nodepool.

…t NodePools

When a NodePool with marketType: Spot is created on a HostedCluster that
does not have spec.platform.aws.terminationHandlerQueueURL configured,
the Node Termination Handler (NTH) silently fails to deploy. This leaves
spot instances without graceful interruption handling.

Add a new NodePool condition SpotTerminationHandlerConfigured that:
- Sets False with a descriptive message when terminationHandlerQueueURL
  is missing on the HostedCluster for spot-enabled NodePools
- Sets True when the queue URL is properly configured
- Is only present on spot-enabled NodePools (removed otherwise)
- Is a warning only and does not block NodePool reconciliation

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@dpateriya: This pull request references Jira Issue OCPBUGS-86799, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • Add a new NodePool condition SpotTerminationHandlerConfigured that warns users when a spot-enabled NodePool exists but the HostedCluster lacks spec.platform.aws.terminationHandlerQueueURL
  • The condition is set to False with reason TerminationHandlerQueueURLNotSet and an actionable message when the queue URL is missing
  • The condition is only present on spot-enabled NodePools (removed for on-demand NodePools)
  • This is a warning only — NodePool reconciliation continues normally

Jira: https://redhat.atlassian.net/browse/OCPBUGS-86799

Problem

When a NodePool with marketType: Spot is created on a HostedCluster without terminationHandlerQueueURL, the Node Termination Handler (NTH) silently fails to deploy. Users unknowingly run spot instances without graceful interruption handling — spot interruptions result in abrupt instance termination with no cordon, drain, or PDB compliance.

Solution

Surface a NodePool status condition that:

  1. Only appears on spot-enabled NodePools
  2. Clearly tells the user what is missing and how to fix it
  3. Does not block reconciliation (warning only)

Test plan

  • Unit tests added in conditions_test.go covering:
  • When spot enabled + queue URL set → condition True
  • When spot enabled + queue URL empty → condition False with message
  • When spot enabled + AWS platform nil → condition False with message
  • When spot not enabled → condition removed
  • Full ./hypershift-operator/controllers/nodepool/... test suite passes
  • make hypershift-api regenerates CRDs successfully
  • gofmt clean

Made with Cursor

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.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adds a new condition to track whether graceful spot termination handler infrastructure is configured on the HostedCluster. The change introduces the NodePoolSpotTerminationHandlerConfiguredConditionType constant and TerminationHandlerQueueURLNotSetReason in the API, implements a condition setter that checks whether the HostedCluster AWS terminationHandlerQueueURL is set (only when spot is enabled), includes comprehensive test coverage across all relevant scenarios, and integrates the new condition into the nodepool reconciliation loop.

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Custom check specifies Ginkgo test code review, but repo uses standard Go testing with Gomega. The new test lacks assertion messages (best practice), but follows existing codebase patterns exactly. Clarify if check applies to standard Go tests using Gomega, and if so, whether to enforce assertion messages per best practices or align with existing patterns in the file.
✅ Passed checks (10 passed)
Check name Status Explanation
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 All test case names in TestSpotTerminationHandlerConfiguredCondition are static, descriptive strings with no dynamic values, timestamps, UUIDs, or generated identifiers that could vary between runs.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds only a status condition for spot NodePools and contains no scheduling constraints, affinity rules, replica logic, or topology assumptions that would break on SNO, Two-Node, or HyperShift.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests were added. The new test is a standard Go unit test using testing.T and table-driven tests, not Ginkgo. Check not applicable.
No-Weak-Crypto ✅ Passed No weak crypto algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom implementations, or insecure secret comparisons found in the spot termination handler condition additions.
Container-Privileges ✅ Passed PR contains only Go source code modifications. No Kubernetes manifests or container configurations were modified, making the container-privileges check not applicable.
No-Sensitive-Data-In-Logs ✅ Passed No logging of sensitive data found. The PR does not expose passwords, tokens, API keys, PII, session IDs, hostnames, or customer data in any logs or condition messages.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding the SpotTerminationHandlerConfigured condition for spot NodePools.
✨ 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.

@openshift-ci
openshift-ci Bot requested review from clebs and csrwng May 31, 2026 20:53
@openshift-ci openshift-ci Bot added area/api Indicates the PR includes changes for the API area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels May 31, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label May 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@dpateriya: This pull request references Jira Issue OCPBUGS-86799, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Summary

  • Add a new NodePool condition SpotTerminationHandlerConfigured that warns users when a spot-enabled NodePool exists but the HostedCluster lacks spec.platform.aws.terminationHandlerQueueURL
  • The condition is set to False with reason TerminationHandlerQueueURLNotSet and an actionable message when the queue URL is missing
  • The condition is only present on spot-enabled NodePools (removed for on-demand NodePools)
  • This is a warning only — NodePool reconciliation continues normally

Jira: https://redhat.atlassian.net/browse/OCPBUGS-86799

Problem

When a NodePool with marketType: Spot is created on a HostedCluster without terminationHandlerQueueURL, the Node Termination Handler (NTH) silently fails to deploy. Users unknowingly run spot instances without graceful interruption handling — spot interruptions result in abrupt instance termination with no cordon, drain, or PDB compliance.

Solution

Surface a NodePool status condition that:

  1. Only appears on spot-enabled NodePools
  2. Clearly tells the user what is missing and how to fix it
  3. Does not block reconciliation (warning only)

Test plan

  • Unit tests added in conditions_test.go covering:
  • When spot enabled + queue URL set → condition True
  • When spot enabled + queue URL empty → condition False with message
  • When spot enabled + AWS platform nil → condition False with message
  • When spot not enabled → condition removed
  • Full ./hypershift-operator/controllers/nodepool/... test suite passes
  • make hypershift-api regenerates CRDs successfully
  • gofmt clean

Made with Cursor

Summary by CodeRabbit

Release Notes

  • New Features
  • Added nodepool condition monitoring for spot instance termination handler configuration. The system now tracks and reports whether the infrastructure for graceful spot instance termination is properly configured when spot instances are enabled on a nodepool.

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-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label May 31, 2026
@dpateriya

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@dpateriya: This pull request references Jira Issue OCPBUGS-86799, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
hypershift-operator/controllers/nodepool/nodepool_controller.go (1)

286-303: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Move this advisory condition before the short-circuiting checks.

signalConditions exits on the first non-nil result, so placing r.spotTerminationHandlerConfiguredCondition after releaseImageCondition, ignitionEndpointAvailableCondition, validMachineConfigCondition, etc. means the warning is often never set while the NodePool is still reconciling. This condition only depends on spec, so it should run before those blockers.

Proposed fix
 	signalConditions := []func(ctx context.Context, nodePool *hyperv1.NodePool, hcluster *hyperv1.HostedCluster) (*ctrl.Result, error){
 		r.autoscalerEnabledCondition,
 		r.updateManagementEnabledCondition,
+		r.spotTerminationHandlerConfiguredCondition,
 		r.releaseImageCondition,
 		r.ignitionEndpointAvailableCondition,
 		r.validArchPlatformCondition,
@@
 		r.reachedIgnitionEndpointCondition,
 		r.machineAndNodeConditions,
 		r.validPlatformConfigCondition,
-		r.spotTerminationHandlerConfiguredCondition,
 		// TODO(alberto): consider moving here:
🤖 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 `@hypershift-operator/controllers/nodepool/nodepool_controller.go` around lines
286 - 303, The advisory condition r.spotTerminationHandlerConfiguredCondition is
currently placed after several short-circuiting checks and thus may never run;
move r.spotTerminationHandlerConfiguredCondition up into the early part of
signalConditions (for example immediately after r.reconciliationActiveCondition
or before r.releaseImageCondition) because it only depends on the NodePool spec
and must run before blockers like r.releaseImageCondition,
r.ignitionEndpointAvailableCondition, r.validMachineConfigCondition,
r.validGeneratedPayloadCondition, r.reachedIgnitionEndpointCondition,
r.machineAndNodeConditions and r.validPlatformConfigCondition so it can set its
warning while reconciliation continues.
🧹 Nitpick comments (1)
hypershift-operator/controllers/nodepool/conditions_test.go (1)

530-545: ⚡ Quick win

The empty-URL case is not actually distinct from the nil-AWS case.

Line 602 only creates hc.Spec.Platform.AWS when the URL is non-empty, so both "terminationHandlerQueueURL is empty" and "AWS platform is nil" hit the same branch. That leaves the non-nil AWS + empty string path untested.

Proposed fix
 	tests := []struct {
 		name                       string
 		spotEnabled                bool
+		hostedClusterAWSConfigured bool
 		terminationHandlerQueueURL string
 		existingCondition          bool
 		expectedConditionPresent   bool
@@
 		{
 			name:                       "When spot is enabled and terminationHandlerQueueURL is set it should set condition to True",
 			spotEnabled:                true,
+			hostedClusterAWSConfigured: true,
 			terminationHandlerQueueURL: "https://sqs.us-east-1.amazonaws.com/123456789012/my-queue",
 			expectedConditionPresent:   true,
@@
 		{
 			name:                       "When spot is enabled and terminationHandlerQueueURL is empty it should set condition to False",
 			spotEnabled:                true,
+			hostedClusterAWSConfigured: true,
 			terminationHandlerQueueURL: "",
 			expectedConditionPresent:   true,
@@
-			if tc.terminationHandlerQueueURL != "" {
+			if tc.hostedClusterAWSConfigured {
 				hc.Spec.Platform.AWS = &hyperv1.AWSPlatformSpec{
 					TerminationHandlerQueueURL: tc.terminationHandlerQueueURL,
 				}
 			}

Also applies to: 602-606

🤖 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 `@hypershift-operator/controllers/nodepool/conditions_test.go` around lines 530
- 545, Test currently conflates the "nil AWS platform" and "non-nil AWS platform
with empty terminationHandlerQueueURL" cases because hc.Spec.Platform.AWS is
only created when terminationHandlerQueueURL is non-empty; update the test setup
in conditions_test.go to explicitly construct a non-nil hc.Spec.Platform.AWS
(e.g., set hc.Spec.Platform.AWS = &hyperv1.AWSPlatformSpec{}) for the case where
you want AWS present but terminationHandlerQueueURL == "" so the branch in the
reconciler that checks for a present AWS platform with an empty URL is
exercised; ensure the test case named "When spot is enabled and
terminationHandlerQueueURL is empty it should set condition to False" leaves
terminationHandlerQueueURL == "" but forces a non-nil Platform.AWS to verify
expectedConditionPresent/expectedStatus/expectedReason/expectedMessage.
🤖 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.

Outside diff comments:
In `@hypershift-operator/controllers/nodepool/nodepool_controller.go`:
- Around line 286-303: The advisory condition
r.spotTerminationHandlerConfiguredCondition is currently placed after several
short-circuiting checks and thus may never run; move
r.spotTerminationHandlerConfiguredCondition up into the early part of
signalConditions (for example immediately after r.reconciliationActiveCondition
or before r.releaseImageCondition) because it only depends on the NodePool spec
and must run before blockers like r.releaseImageCondition,
r.ignitionEndpointAvailableCondition, r.validMachineConfigCondition,
r.validGeneratedPayloadCondition, r.reachedIgnitionEndpointCondition,
r.machineAndNodeConditions and r.validPlatformConfigCondition so it can set its
warning while reconciliation continues.

---

Nitpick comments:
In `@hypershift-operator/controllers/nodepool/conditions_test.go`:
- Around line 530-545: Test currently conflates the "nil AWS platform" and
"non-nil AWS platform with empty terminationHandlerQueueURL" cases because
hc.Spec.Platform.AWS is only created when terminationHandlerQueueURL is
non-empty; update the test setup in conditions_test.go to explicitly construct a
non-nil hc.Spec.Platform.AWS (e.g., set hc.Spec.Platform.AWS =
&hyperv1.AWSPlatformSpec{}) for the case where you want AWS present but
terminationHandlerQueueURL == "" so the branch in the reconciler that checks for
a present AWS platform with an empty URL is exercised; ensure the test case
named "When spot is enabled and terminationHandlerQueueURL is empty it should
set condition to False" leaves terminationHandlerQueueURL == "" but forces a
non-nil Platform.AWS to verify
expectedConditionPresent/expectedStatus/expectedReason/expectedMessage.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 5e82549b-8c47-44ee-99f7-01305d9dd00f

📥 Commits

Reviewing files that changed from the base of the PR and between ab1e63b and 14c9cfd.

⛔ Files ignored due to path filters (1)
  • vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/nodepool_conditions.go is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (4)
  • api/hypershift/v1beta1/nodepool_conditions.go
  • hypershift-operator/controllers/nodepool/conditions.go
  • hypershift-operator/controllers/nodepool/conditions_test.go
  • hypershift-operator/controllers/nodepool/nodepool_controller.go

@JoelSpeed

Copy link
Copy Markdown
Contributor

/approve for API

@openshift-ci

openshift-ci Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dpateriya, JoelSpeed
Once this PR has been reviewed and has the lgtm label, please assign sjenning 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 3, 2026

Copy link
Copy Markdown
Contributor

Stale PRs are closed after 21d of inactivity.

If this PR is still relevant, comment to refresh it or remove the stale label.
Mark the PR as fresh by commenting /remove-lifecycle stale.

If this PR is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 3, 2026
@hypershift-jira-solve-ci

Copy link
Copy Markdown
Contributor

The final agent confirmed the same finding — the okd-scos-images failure was a transient CI infrastructure issue with the origin/scos-4.21 imagestream. The agent also found that the identical error hit PR #8645 from the same author on the same day, and that PR later passed without code changes, further proving it was transient.

All analysis is complete. The report above covers all three failures comprehensively.


@dpateriya

Copy link
Copy Markdown
Contributor Author

@csrwng , would you please review this Pull request?

@dpateriya dpateriya changed the title fix: OCPBUGS-86799: Add SpotTerminationHandlerConfigured condition for spot NodePools OCPBUGS-86799: fix Add SpotTerminationHandlerConfigured condition for spot NodePools Jul 5, 2026
@dpateriya

Copy link
Copy Markdown
Contributor Author

/retest-required

@dpateriya dpateriya changed the title OCPBUGS-86799: fix Add SpotTerminationHandlerConfigured condition for spot NodePools fix: OCPBUGS-86799: Add SpotTerminationHandlerConfigured condition for spot NodePools Jul 5, 2026
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.69%. Comparing base (6a6d8c1) to head (14c9cfd).
⚠️ Report is 619 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8646      +/-   ##
==========================================
+ Coverage   40.68%   40.69%   +0.01%     
==========================================
  Files         755      755              
  Lines       93368    93390      +22     
==========================================
+ Hits        37985    38007      +22     
  Misses      52649    52649              
  Partials     2734     2734              
Files with missing lines Coverage Δ
...rshift-operator/controllers/nodepool/conditions.go 55.08% <100.00%> (+1.15%) ⬆️
...erator/controllers/nodepool/nodepool_controller.go 41.30% <100.00%> (+0.06%) ⬆️

... and 15 files with indirect coverage changes

Flag Coverage Δ
cmd-support 34.70% <ø> (ø)
cpo-hostedcontrolplane 41.80% <ø> (ø)
cpo-other 41.39% <ø> (ø)
hypershift-operator 50.86% <100.00%> (+0.04%) ⬆️
other 31.61% <ø> (ø)

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.

@openshift-ci

openshift-ci Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@dpateriya: 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.

@openshift-ci

openshift-ci Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Stale PRs rot after 14d of inactivity.

Mark the PR as fresh by commenting /remove-lifecycle rotten.
Rotten PRs close after an additional 7d of inactivity.

If this PR is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci Bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 19, 2026
@openshift-ci

openshift-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Rotten PRs close after 7d of inactivity.

Reopen the PR by commenting /reopen.
Mark the PR as fresh by commenting /remove-lifecycle rotten.

/close

@openshift-ci openshift-ci Bot closed this Jul 26, 2026
@openshift-ci

openshift-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@openshift-ci[bot]: Closed this PR.

Details

In response to this:

Rotten PRs close after 7d of inactivity.

Reopen the PR by commenting /reopen.
Mark the PR as fresh by commenting /remove-lifecycle rotten.

/close

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.

@openshift-ci-robot

Copy link
Copy Markdown

@dpateriya: This pull request references Jira Issue OCPBUGS-86799. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

Details

In response to this:

Summary

  • Add a new NodePool condition SpotTerminationHandlerConfigured that warns users when a spot-enabled NodePool exists but the HostedCluster lacks spec.platform.aws.terminationHandlerQueueURL
  • The condition is set to False with reason TerminationHandlerQueueURLNotSet and an actionable message when the queue URL is missing
  • The condition is only present on spot-enabled NodePools (removed for on-demand NodePools)
  • This is a warning only — NodePool reconciliation continues normally

Jira: https://redhat.atlassian.net/browse/OCPBUGS-86799

Problem

When a NodePool with marketType: Spot is created on a HostedCluster without terminationHandlerQueueURL, the Node Termination Handler (NTH) silently fails to deploy. Users unknowingly run spot instances without graceful interruption handling — spot interruptions result in abrupt instance termination with no cordon, drain, or PDB compliance.

Solution

Surface a NodePool status condition that:

  1. Only appears on spot-enabled NodePools
  2. Clearly tells the user what is missing and how to fix it
  3. Does not block reconciliation (warning only)

Test plan

  • Unit tests added in conditions_test.go covering:
  • When spot enabled + queue URL set → condition True
  • When spot enabled + queue URL empty → condition False with message
  • When spot enabled + AWS platform nil → condition False with message
  • When spot not enabled → condition removed
  • Full ./hypershift-operator/controllers/nodepool/... test suite passes
  • make hypershift-api regenerates CRDs successfully
  • gofmt clean

Made with Cursor

Summary by CodeRabbit

Release Notes

  • New Features
  • Added nodepool condition monitoring for spot instance termination handler configuration. The system now tracks and reports whether the infrastructure for graceful spot instance termination is properly configured when spot instances are enabled on a nodepool.

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.

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

Labels

area/api Indicates the PR includes changes for the API area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants