Skip to content

refactor(kubeapi): introduce WaitForKubernetesOptions to control optional waits#5799

Merged
rene merged 1 commit intolf-edge:masterfrom
andrewd-zededa:eve-k-domainmgr-boot-wait
Apr 28, 2026
Merged

refactor(kubeapi): introduce WaitForKubernetesOptions to control optional waits#5799
rene merged 1 commit intolf-edge:masterfrom
andrewd-zededa:eve-k-domainmgr-boot-wait

Conversation

@andrewd-zededa
Copy link
Copy Markdown
Contributor

@andrewd-zededa andrewd-zededa commented Apr 14, 2026

Description

  • Introduce WaitForKubernetesOptions struct with WaitForKubevirt and
    WaitForLonghorn boolean flags, replacing implicit
    registrationAppliedToCluster() guards inside WaitForKubernetes.
  • domainmgr and volumemgr now subscribe to EdgeNodeClusterConfig
    (60 s timeout) before calling WaitForKubernetes and set only the flag
    relevant to their role.
  • Replace the kubevirt readiness heuristic (counting pods ≥ 4) with a
    check on the KubeVirt CR Available=True condition.

PR dependencies

None

How to test and validate this PR

  • Build EVE-k image and verify domainmgr/volumemgr boot correctly on a
    ReplicatedStorage cluster (KubeVirt + Longhorn waits active).
  • Verify domainmgr/volumemgr boot correctly on a base-k3s cluster
    (neither wait is triggered).
  • Confirm zedkube still reaches ready state with empty
    WaitForKubernetesOptions{}.
  • Verify 60 s timeout path in EdgeNodeClusterConfig subscription
    triggers a warning log and proceeds without blocking.

Changelog notes

None

PR Backports

  • 16.0-stable: To be backported.
  • 14.5-stable: No, as the feature is not available there.
  • 13.4-stable: No, as the feature is not available there.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

@andrewd-zededa andrewd-zededa force-pushed the eve-k-domainmgr-boot-wait branch from 02a0294 to eaca80a Compare April 15, 2026 03:01
@andrewd-zededa andrewd-zededa marked this pull request as ready for review April 15, 2026 03:16
@andrewd-zededa andrewd-zededa marked this pull request as draft April 16, 2026 04:05
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

back to draft while resolving single node fix

@andrewd-zededa andrewd-zededa force-pushed the eve-k-domainmgr-boot-wait branch from eaca80a to 49182d7 Compare April 16, 2026 04:18
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 0% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.13%. Comparing base (2281599) to head (87d5c50).
⚠️ Report is 607 commits behind head on master.

Files with missing lines Patch % Lines
pkg/pillar/cmd/domainmgr/domainmgr.go 0.00% 47 Missing ⚠️
pkg/pillar/cmd/volumemgr/volumemgr.go 0.00% 40 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5799      +/-   ##
==========================================
- Coverage   19.52%   17.13%   -2.40%     
==========================================
  Files          19      474     +455     
  Lines        3021    85591   +82570     
==========================================
+ Hits          590    14664   +14074     
- Misses       2310    69412   +67102     
- Partials      121     1515    +1394     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@andrewd-zededa andrewd-zededa force-pushed the eve-k-domainmgr-boot-wait branch from 49182d7 to be0c660 Compare April 23, 2026 17:21
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Rebased on latest master

@andrewd-zededa andrewd-zededa force-pushed the eve-k-domainmgr-boot-wait branch 2 times, most recently from fe371fc to 3b51de0 Compare April 23, 2026 21:37
…diness

- Add WaitForKubernetesOptions with WaitForKubevirt and WaitForLonghorn
  flags; replace KubevirtPodsRunning pod-count heuristic and
  registrationAppliedToCluster guards with explicit caller-supplied opts
- Extract waitForKubevirtReady to check KubeVirt CR Available=True
  condition; slim waitForNodeReady to a one-shot node-existence gate that
  gates optional component checks; move PollImmediate loop into
  WaitForKubernetes goroutine
- WaitForKubernetes now propagates errors (was always nil)
- domainmgr subscribes EdgeNodeClusterConfig to resolve ClusterType;
  sets WaitForKubevirt only for ClusterTypeReplicatedStorage and retries
  WaitForKubernetes indefinitely when kubevirt readiness is required
- Bound all API calls in the wait path with kubeAPITimeout context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Andrew Durbin <andrewd@zededa.com>
@andrewd-zededa andrewd-zededa force-pushed the eve-k-domainmgr-boot-wait branch from 3b51de0 to 87d5c50 Compare April 27, 2026 17:11
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Rebased on latest master and refined waitForKubevirt flag in domainmgr.go Run() and waitForLhFlag in volumemgr.go Run(). Both check for the updated EdgeNodeClusterConfig behavior (checking the Valid structure member boolean).

@andrewd-zededa andrewd-zededa marked this pull request as ready for review April 27, 2026 20:05
Copy link
Copy Markdown

@zedi-pramodh zedi-pramodh left a comment

Choose a reason for hiding this comment

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

LGTM

@rene rene merged commit c14ccec into lf-edge:master Apr 28, 2026
39 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants