You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kubebuilder alpha generate # Experimental: generate from PROJECT file
272
317
kubebuilder alpha update # Experimental: update to latest plugin versions
273
318
```
274
319
320
+
## Implementing Delete
321
+
322
+
**Rule**: If you add a `create` command, you MUST add the corresponding `delete` command.
323
+
324
+
**Key Principle**: Each plugin undoes ONLY what it created. When plugins run in chain (default: `go/v4` + `kustomize/v2`), each cleans its own artifacts:
325
+
-`go/v4` → removes Go code (types, controllers, main.go, suite_test.go)
- Additional plugins → remove their metadata from PROJECT file
328
+
329
+
**Shared Resources**: Imports/code used by multiple resources are preserved until the last one is deleted (e.g., `appv1` import kept while any app/v1 API exists).
330
+
331
+
**Integration Test**: Add `delete_integration_test.go` with baseline verification:
332
+
```go
333
+
baseline:=captureState()
334
+
createResource()
335
+
deleteResource("-y")
336
+
Expect(currentState()).To(Equal(baseline)) // Exact match required
0 commit comments