Skip to content

Commit 9e6371b

Browse files
authored
[v0.7] Align fleetworkspace webhook handling with controller flow (#1594)
* Align fleetworkspace webhook handling with controller flow The FleetWorkspace mutating admission handler is removed from the webhook server registration, and the associated mutator implementation is deleted. This keeps webhook mutation behavior focused on request shaping and avoids creating workspace side-effect resources in the webhook process. Webhook configuration reconciliation continues to rebuild the mutating webhook list from registered handlers at startup. A regression test is added to verify configuration updates replace webhook entries rather than accumulating stale entries. * Update FleetWorkspace generated docs Document that FleetWorkspace webhook mutation side effects were removed and resources are reconciled by controllers. Run go generate to refresh generated docs per branch.
1 parent 37e700f commit 9e6371b

5 files changed

Lines changed: 6 additions & 631 deletions

File tree

docs.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,9 @@ A `FleetWorkspace` cannot be created if a namespace with the same name already e
229229

230230
### Mutation Checks
231231

232-
#### On create
233-
234-
When a `FleetWorkspace` is created, it will create the following resources:
235-
1. `Namespace`. It will have the same name as the `FleetWorkspace`.
236-
2. `ClusterRole`. It will create the cluster role that has * permission only to the current workspace.
237-
3. Two `RoleBindings` to bind the current user to fleet-admin roles and `FleetWorkspace` roles.
232+
The `FleetWorkspace` mutating webhook no longer creates resources on create.
233+
Namespace and RBAC objects are reconciled by the Rancher controller after
234+
workspace creation.
238235

239236
## GlobalRole
240237

pkg/resources/management.cattle.io/v3/fleetworkspace/FleetWorkspace.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ A `FleetWorkspace` cannot be created if a namespace with the same name already e
44

55
## Mutation Checks
66

7-
### On create
8-
9-
When a `FleetWorkspace` is created, it will create the following resources:
10-
1. `Namespace`. It will have the same name as the `FleetWorkspace`.
11-
2. `ClusterRole`. It will create the cluster role that has * permission only to the current workspace.
12-
3. Two `RoleBindings` to bind the current user to fleet-admin roles and `FleetWorkspace` roles.
7+
The `FleetWorkspace` mutating webhook no longer creates resources on create.
8+
Namespace and RBAC objects are reconciled by the Rancher controller after
9+
workspace creation.

pkg/resources/management.cattle.io/v3/fleetworkspace/mutator.go

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)