Unleash upgrades give no feedback in Console: the progress signal is dropped in nais-api
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Bắt đầu với nais-api/internal/unleash/models.go:33-66 và internal/graph/schema/unleash.graphqls:112-142, sau đó đọc +page.svelte:594-607 và :150-193 của console-frontend. Hãy lần theo query dựa trên watcher thay vì phản hồi của mutation. Hoàn tất khi Console có thể hiển thị phiên bản đích trong khi phiên bản đó khác với phiên bản thực tế, thực hiện polling trong khoảng thời gian đó và hiển thị thông báo lỗi hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A user changes an Unleash instance's release channel in Console. The displayed version stays on the old value with a green checkmark, nothing indicates work is happening, and then at some point it flips. A failed upgrade looks the same as a slow one for five minutes.
This traces the signal from the CRD to the browser and identifies where it is lost. Not where it was assumed to be.
The coordination needed is two repos, not three
The natural assumption is Console + nais-api + bifrost. bifrost is not involved.
- bifrost is not in the read path at all. nais-api runs a Kubernetes informer directly against the
unleashesCRD in the management cluster —internal/unleash/dataloader.go:45-49,queries.go:39-41. Console's instance data never passes through bifrost. - bifrost also does not drop anything. Its handlers serialize the raw CRD (
pkg/api/http/v1/handlers/unleash.go:70,:99,:371), so conditions,resolvedReleaseChannelImageandmetadata.generationall go over the wire.
So: nais-api and console-frontend. unleasherator is optional for the base fix but needed for a decent failure story.
Where it dies
nais-api/internal/unleash/models.go:33-66 — toUnleashInstance, run inside the watcher's converter, so the cache never holds the dropped fields:
instance := &UnleashInstance{
Name: u.Name,
Version: u.Status.Version,
Ready: u.Status.Reconciled && u.Status.Connected,
...
}
Three of six status fields are read. Dropped by name:
| Field | Why it matters |
|---|---|
Status.ResolvedReleaseChannelImage |
The target image. This is the field that makes "upgrading" renderable, and it is discarded here. |
Status.Conditions |
Every reason, message and transition time — including the failure message quoted below. |
Status.ReleaseChannelName |
The observed channel. nais-api reads the spec side instead (models.go:62-64), so Console shows desired state that flips instantly. |
The CRD's own comment at unleash_types.go:286-288 says "Rather than relying on this value, check the conditions instead." nais-api relies on the booleans and drops the conditions.
The GraphQL schema then has nowhere to put progress: internal/graph/schema/unleash.graphqls:112-142 compresses the entire rollout lifecycle into ready: Boolean!.
A second, smaller drop: bifrost returns the channel's full Image; models.go:208-223 discards it.
Why the version "flips suddenly"
In unleasherator, Status.Version is only written after a successful live connection to the server (unleash_controller.go:1069-1075) and is never cleared or marked stale. So it holds the old value from the moment the spec changes until the rollout completes, then jumps.
During the entire window the CRD reads reconciled: true, connected: true, version: <old> — byte-identical to steady state except for resolvedReleaseChannelImage. waitForDeployment blocks for up to 5 minutes (:58, :929-943) writing no status at all.
So there is no intermediate state to show — but there is a usable target-vs-actual gap, and it is exactly the field nais-api drops.
Smallest coherent fix
nais-api — roughly three struct fields, three schema fields, three assignments:
resolvedReleaseChannelImage: StringonUnleashInstance(already on the watched CRD)statusMessage: Stringfromconditions[Reconciled].messageimage: StringonUnleashReleaseChannel
console-frontend — compare target tag to version; when they differ show "Upgrading to vX…" and poll while they differ. Both pieces already exist there: an extractVersion() tag parser (+page.svelte:594-607), and a conditional-polling pattern with a document.hidden guard in WorkloadHealth.svelte:152-168.
Today Console fires the mutation and does one refetch (+page.svelte:150-170) — which, given the above, is guaranteed to read the old version. A polling helper exists at :188-193 but is only wired to instance creation, and stops when ready is true — which it already is during an upgrade.
Two traps for whoever picks this up
Do not use releaseChannel.currentVersion as the target. It is derived from instances whose resolved image matches (releasechannel_controller.go:1693-1711) — which precedes the rollout — while the version is harvested from such an instance. It can advertise the old version as current. Use the image tag.
Do not build on the mutation response. The generated bifrost client types status as {connected, version} only (bifrostclient/client.gen.go:108-115), so Reconciled is unreachable and ready is always false on mutation responses (models.go:226-288). Rely on the watcher-backed query.
What this does not fix
- A failing upgrade still looks like a slow one for five minutes, then becomes a bare X with the old version. The useful text —
"Deployment rollout timed out after 5m0s"— is already sitting inconditions[Reconciled].message; exposingstatusMessageturns an unexplained X into a sentence, but does not make it appear sooner. Degradedis never set for upgrade failure — only on the deletion path (unleash_controller.go:149,172). And the Unleash controller emits no Kubernetes Events at all.- No granularity. A badge and a target version; no pod counts, no ETA.
Related findings worth their own issues
Filed separately, but they bear on any progress UI built here:
- Unleash conditions never carry
ObservedGeneration, so nothing downstream can tell whetherReconciled=Truerefers to the new spec or the old one.RemoteUnleashalready does this correctly (remoteunleash_controller.go:401) — the fix is one line, copied. - A per-instance progress schema already exists and is dead.
ReleaseChannelStatus.InstanceStatuswithPhase/StartTime/EndTime/Message/Ready(releasechannel_types.go:133-134,184-202) is never written by any controller. The domain model for this feature was designed and never shipped. - Switching into a channel that is mid-rollout silently gives you the channel's old image (
internal/resources/unleash.go:567-588), with nothing anywhere saying so. A user could pick a channel and correctly conclude nothing happened — because nothing did.
- Ngôn ngữ chính
- Go
- Star
- 3
- Fork
- 2
- Merge trung bình
- 19 giờ 14 phút
- Pull request đã merge (30 ngày)
- 31
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nais/api
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Provide one paginated connection for workloads without usable vulnerability dataCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Valkey filterĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Gentleman-Programming/engram#1899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
Maintainer thường phản hồi trong vòng 1 ngày