Skip to content

Commit

Permalink
🌱 fix testdata/project-v4 samples by removing call to generate Lakers…
Browse files Browse the repository at this point in the history
… controller without resource (#4129)

fix: testdata project-v4 samples by removing call to generate Lakers controller without resource

We are removing the Laker from here because we already test the creation of controllers without resource in the multi-group. Also, if we keep it here it will not allow we have a very comprehensive test e2e tests for this sample since it is an edge case and we users need to customize the controller for not see error likes

```
ERROR	setup	unable to create controller	{"controller": "Laker", "error": "one of For() or Named() must be called"}
main.main
	/workspace/cmd/main.go:193
runtime.main
	/usr/local/go/src/runtime/proc.go:271
```

We cannot do that manually just for our e2e tests on the samples
  • Loading branch information
camilamacedo86 authored Sep 3, 2024
1 parent b364462 commit 33a2f3d
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 113 deletions.
2 changes: 0 additions & 2 deletions test/testdata/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ function scaffold_test_project {
$kb create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false
$kb create webhook --group crew --version v1 --kind Admiral --defaulting
fi

$kb create api --group crew --version v1 --kind Laker --controller=true --resource=false --make=false
elif [[ $project =~ multigroup ]]; then
header_text 'Switching to multigroup layout ...'
$kb edit --multigroup=true
Expand Down
5 changes: 0 additions & 5 deletions testdata/project-v4/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,4 @@ resources:
webhooks:
defaulting: true
webhookVersion: v1
- controller: true
domain: testproject.org
group: crew
kind: Laker
version: v1
version: "3"
7 changes: 0 additions & 7 deletions testdata/project-v4/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,6 @@ func main() {
os.Exit(1)
}
}
if err = (&controller.LakerReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Laker")
os.Exit(1)
}
// +kubebuilder:scaffold:builder

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
Expand Down
3 changes: 0 additions & 3 deletions testdata/project-v4/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rules:
- admirales
- captains
- firstmates
- lakers
verbs:
- create
- delete
Expand All @@ -25,7 +24,6 @@ rules:
- admirales/finalizers
- captains/finalizers
- firstmates/finalizers
- lakers/finalizers
verbs:
- update
- apiGroups:
Expand All @@ -34,7 +32,6 @@ rules:
- admirales/status
- captains/status
- firstmates/status
- lakers/status
verbs:
- get
- patch
Expand Down
3 changes: 0 additions & 3 deletions testdata/project-v4/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ rules:
- admirales
- captains
- firstmates
- lakers
verbs:
- create
- delete
Expand All @@ -425,7 +424,6 @@ rules:
- admirales/finalizers
- captains/finalizers
- firstmates/finalizers
- lakers/finalizers
verbs:
- update
- apiGroups:
Expand All @@ -434,7 +432,6 @@ rules:
- admirales/status
- captains/status
- firstmates/status
- lakers/status
verbs:
- get
- patch
Expand Down
61 changes: 0 additions & 61 deletions testdata/project-v4/internal/controller/laker_controller.go

This file was deleted.

32 changes: 0 additions & 32 deletions testdata/project-v4/internal/controller/laker_controller_test.go

This file was deleted.

0 comments on commit 33a2f3d

Please sign in to comment.