8000 🐛 fixes for detection, root cause, paging, messages and runtime by abahmed · Pull Request #567 · abahmed/kwatch · GitHub
[go: up one dir, main page]

Skip to content

🐛 fixes for detection, root cause, paging, messages and runtime - #567

Merged
abahmed merged 12 commits into
mainfrom
fixes-4
Oct 21, 2026
Merged

abahmed merged 12 commits into
mainfrom
fixes-4

Conversation

@abahmed
@abahmed abahmed commented Oct 21, 2026 •
Copy link
Copy Markdown
Owner

Fixes for detection, root cause, paging, messages and runtime. This PR also includes the license client hardening and the removal of cluster check-ins (previously #568).

Licensing and privacy

  • Check-ins no longer carry cluster name or namespace. This was the first change on this branch.
  • Cluster check-ins removed. The 30-minute ping, its client and the clusterCheckins setting are gone. clusterCheckins (in the file, a KwatchConfig or Helm values) and KWATCH_CLUSTER_CHECKINS are still accepted, but they are ignored and logged once as deprecated. The CRD and Helm schema keep the field, so validation still passes. A revocation now takes effect at the next daily renewal, about 25 hours later. The docs now point to heartbeatMonitor.url for knowing when kwatch stops.
  • What kwatch sends (README): usage stats weekly (opt-out). Pro license renewal daily (hashed cluster ID, license ID, version, node count). Nothing else goes to kwatch.dev.
  • License end works offline. When a verified lease has a lic_exp, that date is the license end. A later date extends the license and an earlier one ends it early.
  • Clock skew. The server time is read from the body's srv_time, then X-Kwatch-Srv-Time, then Date. kwatch keeps the offset to the server and uses it only to timestamp signed renew/deactivate requests and activate/move. On stale_timestamp it updates the offset and retries once. A second rejection is treated as a temporary failure and the state stays the same.
  • Activate and move send ts and retry once on 409 nonce_reused. A 429 rate_limited with Retry-After is honoured and is not treated as a suspension.
  • emptyDir. The signed lease and the clock guard are kept as one record in the state file. A copy goes to the lease-cache field of kwatch-license-instance, so offline grace survives a lost volume. On load, kwatch takes the newer verified lease and the later guard. The Secret has helm.sh/resource-policy: keep, so helm uninstall keeps it (this is documented).
  • Hardening.
    • Retry backoff gets ±20% jitter.
    • At init, the clock guard is raised to the cached lease's signed iat/srv_time.
    • The clock guard cannot be deleted separately from the lease.

API protocol assumptions (abahmed/kwatch-api#13)

  • X-Kwatch-Srv-Time is unix seconds on every /license/* response. The body's srv_time takes precedence.
  • Optional ts on activate/move is unix seconds, allowed ±600s, rejected with 400 stale_timestamp.
  • 409 {"error":"nonce_reused"} on activate/move.
  • Lease exp is at most lic_exp. The client does not depend on this.
  • /license/ping is no longer called. The server can keep accepting old clients.

Compatibility

An older kwatch build cannot parse the new lease record in the state file. It activates online again once.

Checks

  • make verify-focused on license, app, config and api passed. The disk was low, so I used this instead of the full make verify.
  • go test -race on the same packages passed.
  • -tags licensetest on license and app passed.
  • make verify-catalogs and make docs-verify passed.
  • CI still has to run: the full make ci, e2e and helm tests.

Check-ins now carry only the hashed cluster ID, license ID, version and
node count. Align README benefits order and data copy with MESSAGING.md,
and the chart README and configuration docs.
@abahmed abahmed added the e2e Run the real-cluster E2E suite on this pull request label Oct 21, 2026
- A verified lease's lic_exp now sets the license end in both directions.
- Expired, revoked and suspended check-in answers trigger an immediate
  resync (throttled to one per 5 minutes).
- Signed requests and activations carry server-corrected time from
  srv_time / X-Kwatch-Srv-Time; one retry after stale_timestamp.
- Activate and move retry once on nonce_reused and send ts.
- The lease and clock guard are stored as one record and mirrored to
  the kwatch-license-instance Secret, so emptyDir keeps offline grace.
- Init raises the clock guard to the cached lease's signed time.
- Retry backoff gets ±20% jitter.
The 30-minute ping, its client and the clusterCheckins setting are gone.
clusterCheckins and KWATCH_CLUSTER_CHECKINS are still accepted, ignored
and logged once as deprecated, so existing config, KwatchConfig objects
and Helm values keep loading. Pro now talks to api.kwatch.dev only for
the daily license renewal; docs point to heartbeatMonitor.url for
knowing when kwatch stops.
@abahmed
abahmed merged commit 38a8c0a into main Oct 21, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run the real-cluster E2E suite on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0