-
Notifications
You must be signed in to change notification settings - Fork 12
HYPERFLEET-608 - fix: Store first adapter status report with Available=Unknown #52
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
HYPERFLEET-608 - fix: Store first adapter status report with Available=Unknown #52
Conversation
…e=Unknown Previously, all status reports with Available=Unknown were discarded. Now the first report from an adapter is stored even with Available=Unknown, so users can see adapter status in the cluster/statuses endpoint while validation is still in progress. Subsequent Unknown reports are still discarded to avoid unnecessary updates.
WalkthroughThe PR changes adapter-status handling for cluster and node-pool services: when an adapter reports Available=Unknown, the first such report is upserted but aggregation is intentionally skipped; subsequent Unknown reports are treated as no-ops (discarded). Tests and integration tests were updated/added to assert first-report storage (HTTP 201) and subsequent no-op behavior (HTTP 204). No public APIs or function signatures were changed. Sequence Diagram(s)sequenceDiagram
participant Adapter
participant Service
participant DAO as "DAO/Database"
participant Aggregator
Note over Adapter,Service: First report with Available=Unknown
Adapter->>Service: POST adapter status (Available=Unknown)
Service->>DAO: Lookup existing adapter status
DAO-->>Service: Not found
Service->>DAO: Upsert adapter status (store)
DAO-->>Service: Upsert OK
Service--xAggregator: (skip aggregation)
Service-->>Adapter: HTTP 201 Created
Note over Adapter,Service: Subsequent report with Available=Unknown
Adapter->>Service: POST adapter status (Available=Unknown)
Service->>DAO: Lookup existing adapter status
DAO-->>Service: Found
Service-->>DAO: No-op (discard)
Service-->>Adapter: HTTP 204 No Content
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
|
/retest |
…ort behavior Integration tests now expect 201 for the first adapter status report with Available=Unknown, and 204 for subsequent reports from the same adapter. This aligns with the service logic introduced in 6c9338b.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rh-amarin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e7601dc
into
openshift-hyperfleet:main
Summary
Available=Unknown, so users can see adapter status in thecluster/statusesendpoint while validation is still in progressAvailable=Unknowncontinue to be discarded (existing behavior preserved)Changes
pkg/services/cluster.go: ModifiedProcessAdapterStatusto allow first Unknown reportpkg/services/node_pool.go: Same change applied for nodepoolpkg/services/cluster_test.go: Updated and added tests (4 new test cases)pkg/services/node_pool_test.go: Updated and added tests (4 new test cases)Test plan
Available=Unknownreturns HTTP 201 and is storedAvailable=Unknownreturns HTTP 204 and is discardedAvailable=TrueorAvailable=Falsestill works as beforeFixes: HYPERFLEET-608
Summary by CodeRabbit
Tests
Chores