Skip to content

Commit a5b1804

Browse files
committed
Address review comments on WorkerPool SandboxConfig resolution
- Rename the WorkerPool cache index to status.sandboxClasses.sandboxConfig. It indexes pendingConfigRef as well as configRef, so a name that mentions only configRef misleads a reader checking why a claimed config is in use. - List pendingConfigRef in the api-guide's status table, so the row matches the schema instead of leaving the field to the Deletion protection section. - Say that the pool's events are its recent history. The API server drops events after their TTL, one hour by default, so only a logging backend that stores events has the full trail.
1 parent b9439d0 commit a5b1804

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎cmd/atecontroller/internal/controllers/sandboxconfig_protection_controller.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ import (
2929
)
3030

3131
// workerPoolSandboxConfigIndex names the cache index from a SandboxConfig's
32-
// name to the WorkerPools whose status uses it.
33-
const workerPoolSandboxConfigIndex = "status.sandboxClasses.configRef.name"
32+
// name to the WorkerPools whose status uses it, in configRef or
33+
// pendingConfigRef. See sandboxConfigsInUse.
34+
const workerPoolSandboxConfigIndex = "status.sandboxClasses.sandboxConfig"
3435

3536
// SandboxConfigProtectionReconciler removes the protection finalizer from a
3637
// SandboxConfig that is being deleted, once no WorkerPool uses it.

‎cmd/atecontroller/internal/controllers/workerpool_controller.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ func (r *WorkerPoolReconciler) confirmSandboxConfigSwitches(ctx context.Context,
278278
// state differs from prev, the pool's status before this reconcile.
279279
//
280280
// - A class whose configRef changed gets a Normal event that names the old
281-
// and the new config. The pool's events are then the history of the
282-
// configs it has used.
281+
// and the new config. The pool's events are then the history of its
282+
// recent configs. The API server drops an event after its TTL, one hour
283+
// by default, so the full trail lives in whatever stores the events.
283284
// - A class whose Resolved condition is False gets a Warning event, unless
284285
// prev already reports the same failure. A pool that stays unresolved
285286
// does not repeat the event on every reconcile.

‎docs/api-guide.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ worker pod on a GPU node and reserves the device, and nothing else reads it.
109109
| :--- | :--- | :--- |
110110
| `replicas` | `int32` | Total number of worker pods, mirrored from the managed Deployment. |
111111
| `selector` | `string` | Label selector for the worker pods. |
112-
| `sandboxClasses` | `[]WorkerPoolSandboxClassStatus` | One entry per sandbox class, with `name`, `configRef.name` (the `SandboxConfig` in use), and `conditions`. The `Resolved` condition is `True` (reason `Resolved`) when the class's spec resolves. Otherwise it is `False` with reason `SandboxConfigNotFound`, `SandboxConfigDeleting`, `SandboxClassMismatch`, or `DefaultConfigNotFound`, the controller emits a Warning event, and `configRef` keeps the last resolved config. `configRef` is omitted if the class has never resolved. Each time `configRef` changes, the controller emits a Normal `SandboxConfigSwitched` event naming the old and new config, so `kubectl events --for workerpool/NAME` shows the configs the pool has used. The controller creates the worker Deployment only once every class has a config, and keeps updating an existing Deployment while a class does not resolve. |
112+
| `sandboxClasses` | `[]WorkerPoolSandboxClassStatus` | One entry per sandbox class, with `name`, `configRef.name` (the `SandboxConfig` in use), `pendingConfigRef.name` (transient, the config the class is switching to; see [Deletion protection](#deletion-protection)), and `conditions`. The `Resolved` condition is `True` (reason `Resolved`) when the class's spec resolves. Otherwise it is `False` with reason `SandboxConfigNotFound`, `SandboxConfigDeleting`, `SandboxClassMismatch`, or `DefaultConfigNotFound`, the controller emits a Warning event, and `configRef` keeps the last resolved config. `configRef` is omitted if the class has never resolved. Each time `configRef` changes, the controller emits a Normal `SandboxConfigSwitched` event naming the old and new config, so `kubectl events --for workerpool/NAME` shows the configs the pool used recently. The API server keeps an event for one hour by default, so the full history is only in a logging backend that stores events. The controller creates the worker Deployment only once every class has a config, and keeps updating an existing Deployment while a class does not resolve. |
113113

114114
---
115115

0 commit comments

Comments
 (0)