From 196632bf443616067736695d599dd54c5edaf425 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Thu, 16 Jun 2022 10:40:00 +0100 Subject: [PATCH] :seedling: clean up samples by removing deprecated options - remove samples with add-on and declarative for project-v2 - remove samples for v1beta1 CRDs and WebHooks --- test/testdata/generate.sh | 7 - testdata/project-v2-addon/.gitignore | 24 -- testdata/project-v2-addon/Dockerfile | 34 -- testdata/project-v2-addon/Makefile | 125 -------- testdata/project-v2-addon/PROJECT | 49 --- .../project-v2-addon/api/v1/admiral_types.go | 90 ------ .../project-v2-addon/api/v1/captain_types.go | 89 ------ .../api/v1/firstmate_types.go | 89 ------ .../api/v1/groupversion_info.go | 36 --- .../api/v1/zz_generated.deepcopy.go | 302 ------------------ .../packages/admiral/0.0.1/manifest.yaml | 1 - .../packages/captain/0.0.1/manifest.yaml | 1 - .../packages/firstmate/0.0.1/manifest.yaml | 1 - testdata/project-v2-addon/channels/stable | 3 - .../config/certmanager/certificate.yaml | 26 -- .../config/certmanager/kustomization.yaml | 5 - .../config/certmanager/kustomizeconfig.yaml | 16 - .../bases/crew.testproject.org_admirals.yaml | 75 ----- .../bases/crew.testproject.org_captains.yaml | 75 ----- .../crew.testproject.org_firstmates.yaml | 75 ----- .../config/crd/kustomization.yaml | 27 -- .../config/crd/kustomizeconfig.yaml | 17 - .../crd/patches/cainjection_in_admirals.yaml | 8 - .../crd/patches/cainjection_in_captains.yaml | 8 - .../patches/cainjection_in_firstmates.yaml | 8 - .../crd/patches/webhook_in_admirals.yaml | 17 - .../crd/patches/webhook_in_captains.yaml | 17 - .../crd/patches/webhook_in_firstmates.yaml | 17 - .../config/default/kustomization.yaml | 70 ---- .../default/manager_auth_proxy_patch.yaml | 25 -- .../config/default/manager_webhook_patch.yaml | 23 -- .../default/webhookcainjection_patch.yaml | 15 - .../config/manager/kustomization.yaml | 2 - .../config/manager/manager.yaml | 39 --- .../config/prometheus/kustomization.yaml | 2 - .../config/prometheus/monitor.yaml | 20 -- .../config/rbac/admiral_editor_role.yaml | 24 -- .../config/rbac/admiral_viewer_role.yaml | 20 -- .../rbac/auth_proxy_client_clusterrole.yaml | 7 - .../config/rbac/auth_proxy_role.yaml | 13 - .../config/rbac/auth_proxy_role_binding.yaml | 12 - .../config/rbac/auth_proxy_service.yaml | 14 - .../config/rbac/captain_editor_role.yaml | 24 -- .../config/rbac/captain_viewer_role.yaml | 20 -- .../config/rbac/firstmate_editor_role.yaml | 24 -- .../config/rbac/firstmate_viewer_role.yaml | 20 -- .../config/rbac/kustomization.yaml | 12 - .../config/rbac/leader_election_role.yaml | 33 -- .../rbac/leader_election_role_binding.yaml | 12 - .../project-v2-addon/config/rbac/role.yaml | 68 ---- .../config/rbac/role_binding.yaml | 12 - .../config/samples/crew_v1_admiral.yaml | 6 - .../config/samples/crew_v1_captain.yaml | 6 - .../config/samples/crew_v1_firstmate.yaml | 6 - .../config/webhook/kustomization.yaml | 6 - .../config/webhook/kustomizeconfig.yaml | 25 -- .../config/webhook/service.yaml | 12 - .../controllers/admiral_controller.go | 89 ------ .../controllers/captain_controller.go | 89 ------ .../controllers/firstmate_controller.go | 89 ------ .../controllers/suite_test.go | 82 ----- testdata/project-v2-addon/go.mod | 13 - .../project-v2-addon/hack/boilerplate.go.txt | 15 - testdata/project-v2-addon/main.go | 101 ------ testdata/project-v2-multigroup/.gitignore | 24 -- testdata/project-v2-multigroup/Dockerfile | 27 -- testdata/project-v2-multigroup/Makefile | 125 -------- testdata/project-v2-multigroup/PROJECT | 32 -- .../apis/crew/v1/captain_types.go | 64 ---- .../apis/crew/v1/captain_webhook.go | 75 ----- .../apis/crew/v1/groupversion_info.go | 36 --- .../apis/crew/v1/zz_generated.deepcopy.go | 115 ------- .../apis/fiz/v1/bar_types.go | 64 ---- .../apis/fiz/v1/groupversion_info.go | 36 --- .../apis/fiz/v1/zz_generated.deepcopy.go | 115 ------- .../apis/foo.policy/v1/groupversion_info.go | 36 --- .../foo.policy/v1/healthcheckpolicy_types.go | 64 ---- .../foo.policy/v1/zz_generated.deepcopy.go | 115 ------- .../apis/foo/v1/bar_types.go | 64 ---- .../apis/foo/v1/groupversion_info.go | 36 --- .../apis/foo/v1/zz_generated.deepcopy.go | 115 ------- .../v1beta1/groupversion_info.go | 36 --- .../sea-creatures/v1beta1/kraken_types.go | 64 ---- .../v1beta1/zz_generated.deepcopy.go | 115 ------- .../v1beta2/groupversion_info.go | 36 --- .../sea-creatures/v1beta2/leviathan_types.go | 64 ---- .../v1beta2/zz_generated.deepcopy.go | 115 ------- .../apis/ship/v1/destroyer_types.go | 65 ---- .../apis/ship/v1/destroyer_webhook.go | 45 --- .../apis/ship/v1/groupversion_info.go | 36 --- .../apis/ship/v1/zz_generated.deepcopy.go | 115 ------- .../apis/ship/v1beta1/frigate_types.go | 64 ---- .../apis/ship/v1beta1/frigate_webhook.go | 33 -- .../apis/ship/v1beta1/groupversion_info.go | 36 --- .../ship/v1beta1/zz_generated.deepcopy.go | 115 ------- .../apis/ship/v2alpha1/cruiser_types.go | 65 ---- .../apis/ship/v2alpha1/cruiser_webhook.go | 64 ---- .../apis/ship/v2alpha1/groupversion_info.go | 36 --- .../ship/v2alpha1/zz_generated.deepcopy.go | 115 ------- .../config/certmanager/certificate.yaml | 26 -- .../config/certmanager/kustomization.yaml | 5 - .../config/certmanager/kustomizeconfig.yaml | 16 - .../bases/crew.testproject.org_captains.yaml | 58 ---- .../crd/bases/fiz.testproject.org_bars.yaml | 57 ---- ...y.testproject.org_healthcheckpolicies.yaml | 58 ---- .../crd/bases/foo.testproject.org_bars.yaml | 57 ---- ...sea-creatures.testproject.org_krakens.yaml | 58 ---- ...-creatures.testproject.org_leviathans.yaml | 58 ---- .../bases/ship.testproject.org_cruisers.yaml | 58 ---- .../ship.testproject.org_destroyers.yaml | 58 ---- .../bases/ship.testproject.org_frigates.yaml | 58 ---- .../config/crd/kustomization.yaml | 43 --- .../config/crd/kustomizeconfig.yaml | 17 - .../crd/patches/cainjection_in_bars.yaml | 8 - .../crd/patches/cainjection_in_captains.yaml | 8 - .../crd/patches/cainjection_in_cruisers.yaml | 8 - .../patches/cainjection_in_destroyers.yaml | 8 - .../crd/patches/cainjection_in_frigates.yaml | 8 - .../cainjection_in_healthcheckpolicies.yaml | 8 - .../crd/patches/cainjection_in_krakens.yaml | 8 - .../patches/cainjection_in_leviathans.yaml | 8 - .../config/crd/patches/webhook_in_bars.yaml | 17 - .../crd/patches/webhook_in_captains.yaml | 17 - .../crd/patches/webhook_in_cruisers.yaml | 17 - .../crd/patches/webhook_in_destroyers.yaml | 17 - .../crd/patches/webhook_in_frigates.yaml | 17 - .../webhook_in_healthcheckpolicies.yaml | 17 - .../crd/patches/webhook_in_krakens.yaml | 17 - .../crd/patches/webhook_in_leviathans.yaml | 17 - .../config/default/kustomization.yaml | 70 ---- .../default/manager_auth_proxy_patch.yaml | 25 -- .../config/default/manager_webhook_patch.yaml | 23 -- .../default/webhookcainjection_patch.yaml | 15 - .../config/manager/kustomization.yaml | 2 - .../config/manager/manager.yaml | 39 --- .../config/prometheus/kustomization.yaml | 2 - .../config/prometheus/monitor.yaml | 20 -- .../rbac/auth_proxy_client_clusterrole.yaml | 7 - .../config/rbac/auth_proxy_role.yaml | 13 - .../config/rbac/auth_proxy_role_binding.yaml | 12 - .../config/rbac/auth_proxy_service.yaml | 14 - .../config/rbac/bar_editor_role.yaml | 24 -- .../config/rbac/bar_viewer_role.yaml | 20 -- .../config/rbac/captain_editor_role.yaml | 24 -- .../config/rbac/captain_viewer_role.yaml | 20 -- .../config/rbac/cruiser_editor_role.yaml | 24 -- .../config/rbac/cruiser_viewer_role.yaml | 20 -- .../config/rbac/destroyer_editor_role.yaml | 24 -- .../config/rbac/destroyer_viewer_role.yaml | 20 -- .../config/rbac/frigate_editor_role.yaml | 24 -- .../config/rbac/frigate_viewer_role.yaml | 20 -- .../rbac/healthcheckpolicy_editor_role.yaml | 24 -- .../rbac/healthcheckpolicy_viewer_role.yaml | 20 -- .../config/rbac/kraken_editor_role.yaml | 24 -- .../config/rbac/kraken_viewer_role.yaml | 20 -- .../config/rbac/kustomization.yaml | 12 - .../config/rbac/leader_election_role.yaml | 33 -- .../rbac/leader_election_role_binding.yaml | 12 - .../config/rbac/leviathan_editor_role.yaml | 24 -- .../config/rbac/leviathan_viewer_role.yaml | 20 -- .../config/rbac/role.yaml | 208 ------------ .../config/rbac/role_binding.yaml | 12 - .../config/samples/crew_v1_captain.yaml | 6 - .../config/samples/fiz_v1_bar.yaml | 6 - .../foo.policy_v1_healthcheckpolicy.yaml | 6 - .../config/samples/foo_v1_bar.yaml | 6 - .../samples/sea-creatures_v1beta1_kraken.yaml | 6 - .../sea-creatures_v1beta2_leviathan.yaml | 6 - .../config/samples/ship_v1_destroyer.yaml | 6 - .../config/samples/ship_v1beta1_frigate.yaml | 6 - .../config/samples/ship_v2alpha1_cruiser.yaml | 6 - .../config/webhook/kustomization.yaml | 6 - .../config/webhook/kustomizeconfig.yaml | 25 -- .../config/webhook/manifests.yaml | 88 ----- .../config/webhook/service.yaml | 12 - .../controllers/apps/deployment_controller.go | 62 ---- .../controllers/apps/suite_test.go | 81 ----- .../controllers/crew/captain_controller.go | 63 ---- .../controllers/crew/suite_test.go | 82 ----- .../controllers/fiz/bar_controller.go | 63 ---- .../controllers/fiz/suite_test.go | 82 ----- .../healthcheckpolicy_controller.go | 63 ---- .../controllers/foo.policy/suite_test.go | 82 ----- .../controllers/foo/bar_controller.go | 63 ---- .../controllers/foo/suite_test.go | 82 ----- .../sea-creatures/kraken_controller.go | 63 ---- .../sea-creatures/leviathan_controller.go | 63 ---- .../controllers/sea-creatures/suite_test.go | 86 ----- .../controllers/ship/cruiser_controller.go | 63 ---- .../controllers/ship/destroyer_controller.go | 63 ---- .../controllers/ship/frigate_controller.go | 63 ---- .../controllers/ship/suite_test.go | 90 ------ testdata/project-v2-multigroup/go.mod | 13 - .../hack/boilerplate.go.txt | 15 - testdata/project-v2-multigroup/main.go | 195 ----------- testdata/project-v3-v1beta1/.dockerignore | 4 - testdata/project-v3-v1beta1/.gitignore | 25 -- testdata/project-v3-v1beta1/Dockerfile | 27 -- testdata/project-v3-v1beta1/Makefile | 135 -------- testdata/project-v3-v1beta1/PROJECT | 18 -- testdata/project-v3-v1beta1/README.md | 94 ------ .../api/v1/admiral_types.go | 65 ---- .../api/v1/admiral_webhook.go | 45 --- .../api/v1/groupversion_info.go | 36 --- .../api/v1/webhook_suite_test.go | 135 -------- .../api/v1/zz_generated.deepcopy.go | 115 ------- .../config/certmanager/certificate.yaml | 25 -- .../config/certmanager/kustomization.yaml | 5 - .../config/certmanager/kustomizeconfig.yaml | 16 - .../bases/crew.testproject.org_admirals.yaml | 59 ---- .../config/crd/kustomization.yaml | 21 -- .../config/crd/kustomizeconfig.yaml | 19 -- .../crd/patches/cainjection_in_admirals.yaml | 8 - .../crd/patches/webhook_in_admirals.yaml | 14 - .../config/default/kustomization.yaml | 74 ----- .../default/manager_auth_proxy_patch.yaml | 40 --- .../config/default/manager_config_patch.yaml | 20 -- .../config/default/manager_webhook_patch.yaml | 23 -- .../default/webhookcainjection_patch.yaml | 15 - .../manager/controller_manager_config.yaml | 21 -- .../config/manager/kustomization.yaml | 10 - .../config/manager/manager.yaml | 71 ---- .../config/prometheus/kustomization.yaml | 2 - .../config/prometheus/monitor.yaml | 20 -- .../config/rbac/admiral_editor_role.yaml | 24 -- .../config/rbac/admiral_viewer_role.yaml | 20 -- .../rbac/auth_proxy_client_clusterrole.yaml | 9 - .../config/rbac/auth_proxy_role.yaml | 17 - .../config/rbac/auth_proxy_role_binding.yaml | 12 - .../config/rbac/auth_proxy_service.yaml | 15 - .../config/rbac/kustomization.yaml | 18 -- .../config/rbac/leader_election_role.yaml | 37 --- .../rbac/leader_election_role_binding.yaml | 12 - .../project-v3-v1beta1/config/rbac/role.yaml | 34 -- .../config/rbac/role_binding.yaml | 12 - .../config/rbac/service_account.yaml | 5 - .../config/samples/crew_v1_admiral.yaml | 6 - .../config/webhook/kustomization.yaml | 6 - .../config/webhook/kustomizeconfig.yaml | 25 -- .../config/webhook/manifests.v1beta1.yaml | 29 -- .../config/webhook/service.yaml | 13 - .../controllers/admiral_controller.go | 62 ---- .../controllers/suite_test.go | 82 ----- testdata/project-v3-v1beta1/go.mod | 74 ----- .../hack/boilerplate.go.txt | 15 - testdata/project-v3-v1beta1/main.go | 119 ------- 246 files changed, 9782 deletions(-) delete mode 100644 testdata/project-v2-addon/.gitignore delete mode 100644 testdata/project-v2-addon/Dockerfile delete mode 100644 testdata/project-v2-addon/Makefile delete mode 100644 testdata/project-v2-addon/PROJECT delete mode 100644 testdata/project-v2-addon/api/v1/admiral_types.go delete mode 100644 testdata/project-v2-addon/api/v1/captain_types.go delete mode 100644 testdata/project-v2-addon/api/v1/firstmate_types.go delete mode 100644 testdata/project-v2-addon/api/v1/groupversion_info.go delete mode 100644 testdata/project-v2-addon/api/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-addon/channels/packages/admiral/0.0.1/manifest.yaml delete mode 100644 testdata/project-v2-addon/channels/packages/captain/0.0.1/manifest.yaml delete mode 100644 testdata/project-v2-addon/channels/packages/firstmate/0.0.1/manifest.yaml delete mode 100644 testdata/project-v2-addon/channels/stable delete mode 100644 testdata/project-v2-addon/config/certmanager/certificate.yaml delete mode 100644 testdata/project-v2-addon/config/certmanager/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/certmanager/kustomizeconfig.yaml delete mode 100644 testdata/project-v2-addon/config/crd/bases/crew.testproject.org_admirals.yaml delete mode 100644 testdata/project-v2-addon/config/crd/bases/crew.testproject.org_captains.yaml delete mode 100644 testdata/project-v2-addon/config/crd/bases/crew.testproject.org_firstmates.yaml delete mode 100644 testdata/project-v2-addon/config/crd/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/crd/kustomizeconfig.yaml delete mode 100644 testdata/project-v2-addon/config/crd/patches/cainjection_in_admirals.yaml delete mode 100644 testdata/project-v2-addon/config/crd/patches/cainjection_in_captains.yaml delete mode 100644 testdata/project-v2-addon/config/crd/patches/cainjection_in_firstmates.yaml delete mode 100644 testdata/project-v2-addon/config/crd/patches/webhook_in_admirals.yaml delete mode 100644 testdata/project-v2-addon/config/crd/patches/webhook_in_captains.yaml delete mode 100644 testdata/project-v2-addon/config/crd/patches/webhook_in_firstmates.yaml delete mode 100644 testdata/project-v2-addon/config/default/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/default/manager_auth_proxy_patch.yaml delete mode 100644 testdata/project-v2-addon/config/default/manager_webhook_patch.yaml delete mode 100644 testdata/project-v2-addon/config/default/webhookcainjection_patch.yaml delete mode 100644 testdata/project-v2-addon/config/manager/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/manager/manager.yaml delete mode 100644 testdata/project-v2-addon/config/prometheus/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/prometheus/monitor.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/admiral_editor_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/admiral_viewer_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/auth_proxy_client_clusterrole.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/auth_proxy_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/auth_proxy_role_binding.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/auth_proxy_service.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/captain_editor_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/captain_viewer_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/firstmate_editor_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/firstmate_viewer_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/leader_election_role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/leader_election_role_binding.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/role.yaml delete mode 100644 testdata/project-v2-addon/config/rbac/role_binding.yaml delete mode 100644 testdata/project-v2-addon/config/samples/crew_v1_admiral.yaml delete mode 100644 testdata/project-v2-addon/config/samples/crew_v1_captain.yaml delete mode 100644 testdata/project-v2-addon/config/samples/crew_v1_firstmate.yaml delete mode 100644 testdata/project-v2-addon/config/webhook/kustomization.yaml delete mode 100644 testdata/project-v2-addon/config/webhook/kustomizeconfig.yaml delete mode 100644 testdata/project-v2-addon/config/webhook/service.yaml delete mode 100644 testdata/project-v2-addon/controllers/admiral_controller.go delete mode 100644 testdata/project-v2-addon/controllers/captain_controller.go delete mode 100644 testdata/project-v2-addon/controllers/firstmate_controller.go delete mode 100644 testdata/project-v2-addon/controllers/suite_test.go delete mode 100644 testdata/project-v2-addon/go.mod delete mode 100644 testdata/project-v2-addon/hack/boilerplate.go.txt delete mode 100644 testdata/project-v2-addon/main.go delete mode 100644 testdata/project-v2-multigroup/.gitignore delete mode 100644 testdata/project-v2-multigroup/Dockerfile delete mode 100644 testdata/project-v2-multigroup/Makefile delete mode 100644 testdata/project-v2-multigroup/PROJECT delete mode 100644 testdata/project-v2-multigroup/apis/crew/v1/captain_types.go delete mode 100644 testdata/project-v2-multigroup/apis/crew/v1/captain_webhook.go delete mode 100644 testdata/project-v2-multigroup/apis/crew/v1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/crew/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/fiz/v1/bar_types.go delete mode 100644 testdata/project-v2-multigroup/apis/fiz/v1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/fiz/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/foo.policy/v1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go delete mode 100644 testdata/project-v2-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/foo/v1/bar_types.go delete mode 100644 testdata/project-v2-multigroup/apis/foo/v1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/foo/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/kraken_types.go delete mode 100644 testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go delete mode 100644 testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1/destroyer_types.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1/destroyer_webhook.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_types.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_webhook.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1beta1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_types.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_webhook.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v2alpha1/groupversion_info.go delete mode 100644 testdata/project-v2-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v2-multigroup/config/certmanager/certificate.yaml delete mode 100644 testdata/project-v2-multigroup/config/certmanager/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/certmanager/kustomizeconfig.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/crew.testproject.org_captains.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/foo.testproject.org_bars.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/kustomizeconfig.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_bars.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_captains.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_cruisers.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_destroyers.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_frigates.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_healthcheckpolicies.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_krakens.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/cainjection_in_leviathans.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_bars.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_captains.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_cruisers.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_destroyers.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_frigates.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_healthcheckpolicies.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_krakens.yaml delete mode 100644 testdata/project-v2-multigroup/config/crd/patches/webhook_in_leviathans.yaml delete mode 100644 testdata/project-v2-multigroup/config/default/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/default/manager_auth_proxy_patch.yaml delete mode 100644 testdata/project-v2-multigroup/config/default/manager_webhook_patch.yaml delete mode 100644 testdata/project-v2-multigroup/config/default/webhookcainjection_patch.yaml delete mode 100644 testdata/project-v2-multigroup/config/manager/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/manager/manager.yaml delete mode 100644 testdata/project-v2-multigroup/config/prometheus/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/prometheus/monitor.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/auth_proxy_client_clusterrole.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/auth_proxy_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/auth_proxy_role_binding.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/auth_proxy_service.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/bar_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/bar_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/captain_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/captain_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/cruiser_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/cruiser_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/destroyer_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/destroyer_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/frigate_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/frigate_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/kraken_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/kraken_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/leader_election_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/leader_election_role_binding.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/leviathan_editor_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/leviathan_viewer_role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/role.yaml delete mode 100644 testdata/project-v2-multigroup/config/rbac/role_binding.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/crew_v1_captain.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/fiz_v1_bar.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/foo.policy_v1_healthcheckpolicy.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/foo_v1_bar.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta1_kraken.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta2_leviathan.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/ship_v1_destroyer.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/ship_v1beta1_frigate.yaml delete mode 100644 testdata/project-v2-multigroup/config/samples/ship_v2alpha1_cruiser.yaml delete mode 100644 testdata/project-v2-multigroup/config/webhook/kustomization.yaml delete mode 100644 testdata/project-v2-multigroup/config/webhook/kustomizeconfig.yaml delete mode 100644 testdata/project-v2-multigroup/config/webhook/manifests.yaml delete mode 100644 testdata/project-v2-multigroup/config/webhook/service.yaml delete mode 100644 testdata/project-v2-multigroup/controllers/apps/deployment_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/apps/suite_test.go delete mode 100644 testdata/project-v2-multigroup/controllers/crew/captain_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/crew/suite_test.go delete mode 100644 testdata/project-v2-multigroup/controllers/fiz/bar_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/fiz/suite_test.go delete mode 100644 testdata/project-v2-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/foo.policy/suite_test.go delete mode 100644 testdata/project-v2-multigroup/controllers/foo/bar_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/foo/suite_test.go delete mode 100644 testdata/project-v2-multigroup/controllers/sea-creatures/kraken_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/sea-creatures/leviathan_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/sea-creatures/suite_test.go delete mode 100644 testdata/project-v2-multigroup/controllers/ship/cruiser_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/ship/destroyer_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/ship/frigate_controller.go delete mode 100644 testdata/project-v2-multigroup/controllers/ship/suite_test.go delete mode 100644 testdata/project-v2-multigroup/go.mod delete mode 100644 testdata/project-v2-multigroup/hack/boilerplate.go.txt delete mode 100644 testdata/project-v2-multigroup/main.go delete mode 100644 testdata/project-v3-v1beta1/.dockerignore delete mode 100644 testdata/project-v3-v1beta1/.gitignore delete mode 100644 testdata/project-v3-v1beta1/Dockerfile delete mode 100644 testdata/project-v3-v1beta1/Makefile delete mode 100644 testdata/project-v3-v1beta1/PROJECT delete mode 100644 testdata/project-v3-v1beta1/README.md delete mode 100644 testdata/project-v3-v1beta1/api/v1/admiral_types.go delete mode 100644 testdata/project-v3-v1beta1/api/v1/admiral_webhook.go delete mode 100644 testdata/project-v3-v1beta1/api/v1/groupversion_info.go delete mode 100644 testdata/project-v3-v1beta1/api/v1/webhook_suite_test.go delete mode 100644 testdata/project-v3-v1beta1/api/v1/zz_generated.deepcopy.go delete mode 100644 testdata/project-v3-v1beta1/config/certmanager/certificate.yaml delete mode 100644 testdata/project-v3-v1beta1/config/certmanager/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/certmanager/kustomizeconfig.yaml delete mode 100644 testdata/project-v3-v1beta1/config/crd/bases/crew.testproject.org_admirals.yaml delete mode 100644 testdata/project-v3-v1beta1/config/crd/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/crd/kustomizeconfig.yaml delete mode 100644 testdata/project-v3-v1beta1/config/crd/patches/cainjection_in_admirals.yaml delete mode 100644 testdata/project-v3-v1beta1/config/crd/patches/webhook_in_admirals.yaml delete mode 100644 testdata/project-v3-v1beta1/config/default/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/default/manager_auth_proxy_patch.yaml delete mode 100644 testdata/project-v3-v1beta1/config/default/manager_config_patch.yaml delete mode 100644 testdata/project-v3-v1beta1/config/default/manager_webhook_patch.yaml delete mode 100644 testdata/project-v3-v1beta1/config/default/webhookcainjection_patch.yaml delete mode 100644 testdata/project-v3-v1beta1/config/manager/controller_manager_config.yaml delete mode 100644 testdata/project-v3-v1beta1/config/manager/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/manager/manager.yaml delete mode 100644 testdata/project-v3-v1beta1/config/prometheus/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/prometheus/monitor.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/admiral_editor_role.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/admiral_viewer_role.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/auth_proxy_client_clusterrole.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/auth_proxy_role.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/auth_proxy_role_binding.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/auth_proxy_service.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/leader_election_role.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/leader_election_role_binding.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/role.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/role_binding.yaml delete mode 100644 testdata/project-v3-v1beta1/config/rbac/service_account.yaml delete mode 100644 testdata/project-v3-v1beta1/config/samples/crew_v1_admiral.yaml delete mode 100644 testdata/project-v3-v1beta1/config/webhook/kustomization.yaml delete mode 100644 testdata/project-v3-v1beta1/config/webhook/kustomizeconfig.yaml delete mode 100644 testdata/project-v3-v1beta1/config/webhook/manifests.v1beta1.yaml delete mode 100644 testdata/project-v3-v1beta1/config/webhook/service.yaml delete mode 100644 testdata/project-v3-v1beta1/controllers/admiral_controller.go delete mode 100644 testdata/project-v3-v1beta1/controllers/suite_test.go delete mode 100644 testdata/project-v3-v1beta1/go.mod delete mode 100644 testdata/project-v3-v1beta1/hack/boilerplate.go.txt delete mode 100644 testdata/project-v3-v1beta1/main.go diff --git a/test/testdata/generate.sh b/test/testdata/generate.sh index 3885f4597ba..6eeb4314dc2 100755 --- a/test/testdata/generate.sh +++ b/test/testdata/generate.sh @@ -107,10 +107,6 @@ function scaffold_test_project { $kb create api --group crew --version v1 --kind Captain --controller=true --resource=true --make=false $kb create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false $kb create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false - elif [[ $project =~ v1beta1 ]]; then - header_text 'Creating APIs ...' - $kb create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false --crd-version=v1beta1 - $kb create webhook --group crew --version v1 --kind Admiral --defaulting --webhook-version=v1beta1 fi make generate manifests @@ -123,12 +119,9 @@ build_kb # Project version 2 uses plugin go/v2 (default). scaffold_test_project project-v2 --project-version=2 -scaffold_test_project project-v2-multigroup --project-version=2 -scaffold_test_project project-v2-addon --project-version=3 --plugins="go/v2,declarative" # Project version 3 (default) uses plugin go/v3 (default). scaffold_test_project project-v3 scaffold_test_project project-v3-multigroup scaffold_test_project project-v3-addon --plugins="go/v3,declarative" scaffold_test_project project-v3-config --component-config -scaffold_test_project project-v3-v1beta1 scaffold_test_project project-v3-with-kustomize-v2 --plugins="kustomize/v2-alpha,base.go.kubebuilder.io/v3" diff --git a/testdata/project-v2-addon/.gitignore b/testdata/project-v2-addon/.gitignore deleted file mode 100644 index d97ffc5159b..00000000000 --- a/testdata/project-v2-addon/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ - -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -bin - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Kubernetes Generated files - skip generated files, except for vendored files - -!vendor/**/zz_generated.* - -# editor and IDE paraphernalia -.idea -*.swp -*.swo -*~ diff --git a/testdata/project-v2-addon/Dockerfile b/testdata/project-v2-addon/Dockerfile deleted file mode 100644 index 38809fa512e..00000000000 --- a/testdata/project-v2-addon/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# Build the manager binary -FROM golang:1.13 as builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY main.go main.go -COPY api/ api/ -COPY controllers/ controllers/ -# https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/docs/addon/walkthrough/README.md#adding-a-manifest -# Stage channels and make readable -COPY channels/ /channels/ -RUN chmod -R a+rx /channels/ - -# Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go - -# Use distroless as minimal base image to package the manager binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot -WORKDIR / -COPY --from=builder /workspace/manager . -# copy channels -COPY --from=builder /channels /channels - -USER nonroot:nonroot - -ENTRYPOINT ["/manager"] diff --git a/testdata/project-v2-addon/Makefile b/testdata/project-v2-addon/Makefile deleted file mode 100644 index 2de8bc9a1d6..00000000000 --- a/testdata/project-v2-addon/Makefile +++ /dev/null @@ -1,125 +0,0 @@ - -# Image URL to use all building/pushing image targets -IMG ?= controller:latest -# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) -CRD_OPTIONS ?= "crd:trivialVersions=true" - -# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) -ifeq (,$(shell go env GOBIN)) -GOBIN=$(shell go env GOPATH)/bin -else -GOBIN=$(shell go env GOBIN) -endif - -.PHONY: all -all: build - -##@ General - -# The help target prints out all targets with their descriptions organized -# beneath their categories. The categories are represented by '##@' and the -# target descriptions by '##'. The awk commands is responsible for reading the -# entire set of makefiles included in this invocation, looking for lines of the -# file as xyz: ## something, and then pretty-format the target and help. Then, -# if there's a line with ##@ something, that gets pretty-printed as a category. -# More info on the usage of ANSI control characters for terminal formatting: -# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters -# More info on the awk command: -# http://linuxcommand.org/lc3_adv_awk.php - -.PHONY: help -help: ## Display this help. - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) - -##@ Development - -.PHONY: manifests -manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases - -.PHONY: generate -generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. - $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." - -.PHONY: fmt -fmt: ## Run go fmt against code. - go fmt ./... - -.PHONY: vet -vet: ## Run go vet against code. - go vet ./... - -.PHONY: test -test: manifests generate fmt vet ## Run tests. - go test ./... -coverprofile cover.out - -##@ Build - -.PHONY: build -build: generate fmt vet ## Build manager binary. - go build -o bin/manager main.go - -# Backwards compatibility -.PHONY: manager -manager: build ## Build manager binary (alias for build target). - -.PHONY: run -run: manifests generate fmt vet ## Run a controller from your host. - go run ./main.go - -.PHONY: docker-build -docker-build: test ## Build docker image with the manager. - docker build -t ${IMG} . - -.PHONY: docker-push -docker-push: ## Push docker image with the manager. - docker push ${IMG} - -##@ Deployment - -ifndef ignore-not-found - ignore-not-found = false -endif - -.PHONY: install -install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl apply -f - - -.PHONY: uninstall -uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - - -.PHONY: deploy -deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - $(KUSTOMIZE) build config/default | kubectl apply -f - - -.PHONY: undeploy -undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - - -##@ Build Dependencies - -## Location to install dependencies to -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): ## Ensure that the directory exists - mkdir -p $(LOCALBIN) - -## Tool Binaries -KUSTOMIZE ?= $(LOCALBIN)/kustomize -CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen - -## Tool Versions -KUSTOMIZE_VERSION ?= v3.5.4 -CONTROLLER_TOOLS_VERSION ?= v0.3.0 - -KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" -.PHONY: kustomize -kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. -$(KUSTOMIZE): $(LOCALBIN) - curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN) - -.PHONY: controller-gen -controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. -$(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) diff --git a/testdata/project-v2-addon/PROJECT b/testdata/project-v2-addon/PROJECT deleted file mode 100644 index 6db875d62c8..00000000000 --- a/testdata/project-v2-addon/PROJECT +++ /dev/null @@ -1,49 +0,0 @@ -domain: testproject.org -layout: -- go.kubebuilder.io/v2 -- declarative.go.kubebuilder.io/v1 -plugins: - declarative.go.kubebuilder.io/v1: - resources: - - domain: testproject.org - group: crew - kind: Captain - version: v1 - - domain: testproject.org - group: crew - kind: FirstMate - version: v1 - - domain: testproject.org - group: crew - kind: Admiral - version: v1 -projectName: project-v2-addon -repo: sigs.k8s.io/kubebuilder/testdata/project-v2-addon -resources: -- api: - crdVersion: v1beta1 - namespaced: true - controller: true - domain: testproject.org - group: crew - kind: Captain - path: sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1 - version: v1 -- api: - crdVersion: v1beta1 - namespaced: true - controller: true - domain: testproject.org - group: crew - kind: FirstMate - path: sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1 - version: v1 -- api: - crdVersion: v1beta1 - controller: true - domain: testproject.org - group: crew - kind: Admiral - path: sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1 - version: v1 -version: "3" diff --git a/testdata/project-v2-addon/api/v1/admiral_types.go b/testdata/project-v2-addon/api/v1/admiral_types.go deleted file mode 100644 index 027432be46a..00000000000 --- a/testdata/project-v2-addon/api/v1/admiral_types.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// AdmiralSpec defines the desired state of Admiral -type AdmiralSpec struct { - addonv1alpha1.CommonSpec `json:",inline"` - addonv1alpha1.PatchSpec `json:",inline"` - - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -// AdmiralStatus defines the observed state of Admiral -type AdmiralStatus struct { - addonv1alpha1.CommonStatus `json:",inline"` - - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status -//+kubebuilder:resource:scope=Cluster - -// Admiral is the Schema for the admirals API -type Admiral struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AdmiralSpec `json:"spec,omitempty"` - Status AdmiralStatus `json:"status,omitempty"` -} - -var _ addonv1alpha1.CommonObject = &Admiral{} - -func (o *Admiral) ComponentName() string { - return "admiral" -} - -func (o *Admiral) CommonSpec() addonv1alpha1.CommonSpec { - return o.Spec.CommonSpec -} - -func (o *Admiral) PatchSpec() addonv1alpha1.PatchSpec { - return o.Spec.PatchSpec -} - -func (o *Admiral) GetCommonStatus() addonv1alpha1.CommonStatus { - return o.Status.CommonStatus -} - -func (o *Admiral) SetCommonStatus(s addonv1alpha1.CommonStatus) { - o.Status.CommonStatus = s -} - -//+kubebuilder:object:root=true - -// AdmiralList contains a list of Admiral -type AdmiralList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Admiral `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Admiral{}, &AdmiralList{}) -} diff --git a/testdata/project-v2-addon/api/v1/captain_types.go b/testdata/project-v2-addon/api/v1/captain_types.go deleted file mode 100644 index b4bea01a9fb..00000000000 --- a/testdata/project-v2-addon/api/v1/captain_types.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// CaptainSpec defines the desired state of Captain -type CaptainSpec struct { - addonv1alpha1.CommonSpec `json:",inline"` - addonv1alpha1.PatchSpec `json:",inline"` - - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -// CaptainStatus defines the observed state of Captain -type CaptainStatus struct { - addonv1alpha1.CommonStatus `json:",inline"` - - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Captain is the Schema for the captains API -type Captain struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CaptainSpec `json:"spec,omitempty"` - Status CaptainStatus `json:"status,omitempty"` -} - -var _ addonv1alpha1.CommonObject = &Captain{} - -func (o *Captain) ComponentName() string { - return "captain" -} - -func (o *Captain) CommonSpec() addonv1alpha1.CommonSpec { - return o.Spec.CommonSpec -} - -func (o *Captain) PatchSpec() addonv1alpha1.PatchSpec { - return o.Spec.PatchSpec -} - -func (o *Captain) GetCommonStatus() addonv1alpha1.CommonStatus { - return o.Status.CommonStatus -} - -func (o *Captain) SetCommonStatus(s addonv1alpha1.CommonStatus) { - o.Status.CommonStatus = s -} - -//+kubebuilder:object:root=true - -// CaptainList contains a list of Captain -type CaptainList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Captain `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Captain{}, &CaptainList{}) -} diff --git a/testdata/project-v2-addon/api/v1/firstmate_types.go b/testdata/project-v2-addon/api/v1/firstmate_types.go deleted file mode 100644 index 12f64ad0697..00000000000 --- a/testdata/project-v2-addon/api/v1/firstmate_types.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// FirstMateSpec defines the desired state of FirstMate -type FirstMateSpec struct { - addonv1alpha1.CommonSpec `json:",inline"` - addonv1alpha1.PatchSpec `json:",inline"` - - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -// FirstMateStatus defines the observed state of FirstMate -type FirstMateStatus struct { - addonv1alpha1.CommonStatus `json:",inline"` - - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// FirstMate is the Schema for the firstmates API -type FirstMate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec FirstMateSpec `json:"spec,omitempty"` - Status FirstMateStatus `json:"status,omitempty"` -} - -var _ addonv1alpha1.CommonObject = &FirstMate{} - -func (o *FirstMate) ComponentName() string { - return "firstmate" -} - -func (o *FirstMate) CommonSpec() addonv1alpha1.CommonSpec { - return o.Spec.CommonSpec -} - -func (o *FirstMate) PatchSpec() addonv1alpha1.PatchSpec { - return o.Spec.PatchSpec -} - -func (o *FirstMate) GetCommonStatus() addonv1alpha1.CommonStatus { - return o.Status.CommonStatus -} - -func (o *FirstMate) SetCommonStatus(s addonv1alpha1.CommonStatus) { - o.Status.CommonStatus = s -} - -//+kubebuilder:object:root=true - -// FirstMateList contains a list of FirstMate -type FirstMateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []FirstMate `json:"items"` -} - -func init() { - SchemeBuilder.Register(&FirstMate{}, &FirstMateList{}) -} diff --git a/testdata/project-v2-addon/api/v1/groupversion_info.go b/testdata/project-v2-addon/api/v1/groupversion_info.go deleted file mode 100644 index 33458c7506e..00000000000 --- a/testdata/project-v2-addon/api/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the crew v1 API group -//+kubebuilder:object:generate=true -//+groupName=crew.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "crew.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-addon/api/v1/zz_generated.deepcopy.go b/testdata/project-v2-addon/api/v1/zz_generated.deepcopy.go deleted file mode 100644 index d7d62dbdb1c..00000000000 --- a/testdata/project-v2-addon/api/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,302 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Admiral) DeepCopyInto(out *Admiral) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Admiral. -func (in *Admiral) DeepCopy() *Admiral { - if in == nil { - return nil - } - out := new(Admiral) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Admiral) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdmiralList) DeepCopyInto(out *AdmiralList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Admiral, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralList. -func (in *AdmiralList) DeepCopy() *AdmiralList { - if in == nil { - return nil - } - out := new(AdmiralList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdmiralList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdmiralSpec) DeepCopyInto(out *AdmiralSpec) { - *out = *in - out.CommonSpec = in.CommonSpec - in.PatchSpec.DeepCopyInto(&out.PatchSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralSpec. -func (in *AdmiralSpec) DeepCopy() *AdmiralSpec { - if in == nil { - return nil - } - out := new(AdmiralSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdmiralStatus) DeepCopyInto(out *AdmiralStatus) { - *out = *in - in.CommonStatus.DeepCopyInto(&out.CommonStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralStatus. -func (in *AdmiralStatus) DeepCopy() *AdmiralStatus { - if in == nil { - return nil - } - out := new(AdmiralStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Captain) DeepCopyInto(out *Captain) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Captain. -func (in *Captain) DeepCopy() *Captain { - if in == nil { - return nil - } - out := new(Captain) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Captain) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptainList) DeepCopyInto(out *CaptainList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Captain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainList. -func (in *CaptainList) DeepCopy() *CaptainList { - if in == nil { - return nil - } - out := new(CaptainList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CaptainList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptainSpec) DeepCopyInto(out *CaptainSpec) { - *out = *in - out.CommonSpec = in.CommonSpec - in.PatchSpec.DeepCopyInto(&out.PatchSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainSpec. -func (in *CaptainSpec) DeepCopy() *CaptainSpec { - if in == nil { - return nil - } - out := new(CaptainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptainStatus) DeepCopyInto(out *CaptainStatus) { - *out = *in - in.CommonStatus.DeepCopyInto(&out.CommonStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainStatus. -func (in *CaptainStatus) DeepCopy() *CaptainStatus { - if in == nil { - return nil - } - out := new(CaptainStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirstMate) DeepCopyInto(out *FirstMate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMate. -func (in *FirstMate) DeepCopy() *FirstMate { - if in == nil { - return nil - } - out := new(FirstMate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FirstMate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirstMateList) DeepCopyInto(out *FirstMateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]FirstMate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateList. -func (in *FirstMateList) DeepCopy() *FirstMateList { - if in == nil { - return nil - } - out := new(FirstMateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FirstMateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirstMateSpec) DeepCopyInto(out *FirstMateSpec) { - *out = *in - out.CommonSpec = in.CommonSpec - in.PatchSpec.DeepCopyInto(&out.PatchSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateSpec. -func (in *FirstMateSpec) DeepCopy() *FirstMateSpec { - if in == nil { - return nil - } - out := new(FirstMateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirstMateStatus) DeepCopyInto(out *FirstMateStatus) { - *out = *in - in.CommonStatus.DeepCopyInto(&out.CommonStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateStatus. -func (in *FirstMateStatus) DeepCopy() *FirstMateStatus { - if in == nil { - return nil - } - out := new(FirstMateStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-addon/channels/packages/admiral/0.0.1/manifest.yaml b/testdata/project-v2-addon/channels/packages/admiral/0.0.1/manifest.yaml deleted file mode 100644 index af9a253c582..00000000000 --- a/testdata/project-v2-addon/channels/packages/admiral/0.0.1/manifest.yaml +++ /dev/null @@ -1 +0,0 @@ -# Placeholder manifest - replace with the manifest for your addon diff --git a/testdata/project-v2-addon/channels/packages/captain/0.0.1/manifest.yaml b/testdata/project-v2-addon/channels/packages/captain/0.0.1/manifest.yaml deleted file mode 100644 index af9a253c582..00000000000 --- a/testdata/project-v2-addon/channels/packages/captain/0.0.1/manifest.yaml +++ /dev/null @@ -1 +0,0 @@ -# Placeholder manifest - replace with the manifest for your addon diff --git a/testdata/project-v2-addon/channels/packages/firstmate/0.0.1/manifest.yaml b/testdata/project-v2-addon/channels/packages/firstmate/0.0.1/manifest.yaml deleted file mode 100644 index af9a253c582..00000000000 --- a/testdata/project-v2-addon/channels/packages/firstmate/0.0.1/manifest.yaml +++ /dev/null @@ -1 +0,0 @@ -# Placeholder manifest - replace with the manifest for your addon diff --git a/testdata/project-v2-addon/channels/stable b/testdata/project-v2-addon/channels/stable deleted file mode 100644 index 31216a4aca9..00000000000 --- a/testdata/project-v2-addon/channels/stable +++ /dev/null @@ -1,3 +0,0 @@ -# Versions for the stable channel -manifests: -- version: 0.0.1 diff --git a/testdata/project-v2-addon/config/certmanager/certificate.yaml b/testdata/project-v2-addon/config/certmanager/certificate.yaml deleted file mode 100644 index 58db114fa05..00000000000 --- a/testdata/project-v2-addon/config/certmanager/certificate.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# The following manifests contain a self-signed issuer CR and a certificate CR. -# More document can be found at https://docs.cert-manager.io -# WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for -# breaking changes -apiVersion: cert-manager.io/v1alpha2 -kind: Issuer -metadata: - name: selfsigned-issuer - namespace: system -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml - namespace: system -spec: - # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize - dnsNames: - - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc - - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local - issuerRef: - kind: Issuer - name: selfsigned-issuer - secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize diff --git a/testdata/project-v2-addon/config/certmanager/kustomization.yaml b/testdata/project-v2-addon/config/certmanager/kustomization.yaml deleted file mode 100644 index bebea5a595e..00000000000 --- a/testdata/project-v2-addon/config/certmanager/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -resources: -- certificate.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v2-addon/config/certmanager/kustomizeconfig.yaml b/testdata/project-v2-addon/config/certmanager/kustomizeconfig.yaml deleted file mode 100644 index 90d7c313ca1..00000000000 --- a/testdata/project-v2-addon/config/certmanager/kustomizeconfig.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# This configuration is for teaching kustomize how to update name ref and var substitution -nameReference: -- kind: Issuer - group: cert-manager.io - fieldSpecs: - - kind: Certificate - group: cert-manager.io - path: spec/issuerRef/name - -varReference: -- kind: Certificate - group: cert-manager.io - path: spec/commonName -- kind: Certificate - group: cert-manager.io - path: spec/dnsNames diff --git a/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_admirals.yaml b/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_admirals.yaml deleted file mode 100644 index 1f2d191413e..00000000000 --- a/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_admirals.yaml +++ /dev/null @@ -1,75 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: admirals.crew.testproject.org -spec: - group: crew.testproject.org - names: - kind: Admiral - listKind: AdmiralList - plural: admirals - singular: admiral - scope: Cluster - subresources: - status: {} - validation: - openAPIV3Schema: - description: Admiral is the Schema for the admirals API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: AdmiralSpec defines the desired state of Admiral - properties: - channel: - description: 'Channel specifies a channel that can be used to resolve - a specific addon, eg: stable It will be ignored if Version is specified' - type: string - patches: - items: - type: object - type: array - version: - description: Version specifies the exact addon version to be deployed, - eg 1.2.3 It should not be specified if Channel is specified - type: string - type: object - status: - description: AdmiralStatus defines the observed state of Admiral - properties: - errors: - items: - type: string - type: array - healthy: - type: boolean - required: - - healthy - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_captains.yaml deleted file mode 100644 index 6d7c7916b28..00000000000 --- a/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_captains.yaml +++ /dev/null @@ -1,75 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: captains.crew.testproject.org -spec: - group: crew.testproject.org - names: - kind: Captain - listKind: CaptainList - plural: captains - singular: captain - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Captain is the Schema for the captains API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CaptainSpec defines the desired state of Captain - properties: - channel: - description: 'Channel specifies a channel that can be used to resolve - a specific addon, eg: stable It will be ignored if Version is specified' - type: string - patches: - items: - type: object - type: array - version: - description: Version specifies the exact addon version to be deployed, - eg 1.2.3 It should not be specified if Channel is specified - type: string - type: object - status: - description: CaptainStatus defines the observed state of Captain - properties: - errors: - items: - type: string - type: array - healthy: - type: boolean - required: - - healthy - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_firstmates.yaml deleted file mode 100644 index c2f3d91c436..00000000000 --- a/testdata/project-v2-addon/config/crd/bases/crew.testproject.org_firstmates.yaml +++ /dev/null @@ -1,75 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: firstmates.crew.testproject.org -spec: - group: crew.testproject.org - names: - kind: FirstMate - listKind: FirstMateList - plural: firstmates - singular: firstmate - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: FirstMate is the Schema for the firstmates API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: FirstMateSpec defines the desired state of FirstMate - properties: - channel: - description: 'Channel specifies a channel that can be used to resolve - a specific addon, eg: stable It will be ignored if Version is specified' - type: string - patches: - items: - type: object - type: array - version: - description: Version specifies the exact addon version to be deployed, - eg 1.2.3 It should not be specified if Channel is specified - type: string - type: object - status: - description: FirstMateStatus defines the observed state of FirstMate - properties: - errors: - items: - type: string - type: array - healthy: - type: boolean - required: - - healthy - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-addon/config/crd/kustomization.yaml b/testdata/project-v2-addon/config/crd/kustomization.yaml deleted file mode 100644 index 37c36ffdebd..00000000000 --- a/testdata/project-v2-addon/config/crd/kustomization.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default -resources: -- bases/crew.testproject.org_captains.yaml -- bases/crew.testproject.org_firstmates.yaml -- bases/crew.testproject.org_admirals.yaml -#+kubebuilder:scaffold:crdkustomizeresource - -patchesStrategicMerge: -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. -# patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_captains.yaml -#- patches/webhook_in_firstmates.yaml -#- patches/webhook_in_admirals.yaml -#+kubebuilder:scaffold:crdkustomizewebhookpatch - -# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. -# patches here are for enabling the CA injection for each CRD -#- patches/cainjection_in_captains.yaml -#- patches/cainjection_in_firstmates.yaml -#- patches/cainjection_in_admirals.yaml -#+kubebuilder:scaffold:crdkustomizecainjectionpatch - -# the following config is for teaching kustomize how to do kustomization for CRDs. -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v2-addon/config/crd/kustomizeconfig.yaml b/testdata/project-v2-addon/config/crd/kustomizeconfig.yaml deleted file mode 100644 index 6f83d9a94bc..00000000000 --- a/testdata/project-v2-addon/config/crd/kustomizeconfig.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# This file is for teaching kustomize how to substitute name and namespace reference in CRD -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: CustomResourceDefinition - group: apiextensions.k8s.io - path: spec/conversion/webhookClientConfig/service/name - -namespace: -- kind: CustomResourceDefinition - group: apiextensions.k8s.io - path: spec/conversion/webhookClientConfig/service/namespace - create: false - -varReference: -- path: metadata/annotations diff --git a/testdata/project-v2-addon/config/crd/patches/cainjection_in_admirals.yaml b/testdata/project-v2-addon/config/crd/patches/cainjection_in_admirals.yaml deleted file mode 100644 index 8573317f652..00000000000 --- a/testdata/project-v2-addon/config/crd/patches/cainjection_in_admirals.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: admirals.crew.testproject.org diff --git a/testdata/project-v2-addon/config/crd/patches/cainjection_in_captains.yaml b/testdata/project-v2-addon/config/crd/patches/cainjection_in_captains.yaml deleted file mode 100644 index 72918ce20f4..00000000000 --- a/testdata/project-v2-addon/config/crd/patches/cainjection_in_captains.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: captains.crew.testproject.org diff --git a/testdata/project-v2-addon/config/crd/patches/cainjection_in_firstmates.yaml b/testdata/project-v2-addon/config/crd/patches/cainjection_in_firstmates.yaml deleted file mode 100644 index 271b973cb56..00000000000 --- a/testdata/project-v2-addon/config/crd/patches/cainjection_in_firstmates.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: firstmates.crew.testproject.org diff --git a/testdata/project-v2-addon/config/crd/patches/webhook_in_admirals.yaml b/testdata/project-v2-addon/config/crd/patches/webhook_in_admirals.yaml deleted file mode 100644 index 2b9bf612404..00000000000 --- a/testdata/project-v2-addon/config/crd/patches/webhook_in_admirals.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: admirals.crew.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-addon/config/crd/patches/webhook_in_captains.yaml b/testdata/project-v2-addon/config/crd/patches/webhook_in_captains.yaml deleted file mode 100644 index c515517131e..00000000000 --- a/testdata/project-v2-addon/config/crd/patches/webhook_in_captains.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: captains.crew.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-addon/config/crd/patches/webhook_in_firstmates.yaml b/testdata/project-v2-addon/config/crd/patches/webhook_in_firstmates.yaml deleted file mode 100644 index 05c23fd1e8b..00000000000 --- a/testdata/project-v2-addon/config/crd/patches/webhook_in_firstmates.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: firstmates.crew.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-addon/config/default/kustomization.yaml b/testdata/project-v2-addon/config/default/kustomization.yaml deleted file mode 100644 index 01da6c2670f..00000000000 --- a/testdata/project-v2-addon/config/default/kustomization.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# Adds namespace to all resources. -namespace: project-v2-addon-system - -# Value of this field is prepended to the -# names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". -# Note that it should also match with the prefix (text before '-') of the namespace -# field above. -namePrefix: project-v2-addon- - -# Labels to add to all resources and selectors. -#commonLabels: -# someName: someValue - -bases: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus - -patchesStrategicMerge: - # Protect the /metrics endpoint by putting it behind auth. - # If you want your controller-manager to expose the /metrics - # endpoint w/o any authn/z, please comment the following line. -- manager_auth_proxy_patch.yaml - -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- manager_webhook_patch.yaml - -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. -# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. -# 'CERTMANAGER' needs to be enabled to use ca injection -#- webhookcainjection_patch.yaml - -# the following config is for teaching kustomize how to do var substitution -vars: -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1alpha2 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldref: -# fieldpath: metadata.namespace -#- name: CERTIFICATE_NAME -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1alpha2 -# name: serving-cert # this name should match the one in certificate.yaml -#- name: SERVICE_NAMESPACE # namespace of the service -# objref: -# kind: Service -# version: v1 -# name: webhook-service -# fieldref: -# fieldpath: metadata.namespace -#- name: SERVICE_NAME -# objref: -# kind: Service -# version: v1 -# name: webhook-service diff --git a/testdata/project-v2-addon/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v2-addon/config/default/manager_auth_proxy_patch.yaml deleted file mode 100644 index 27a25b56726..00000000000 --- a/testdata/project-v2-addon/config/default/manager_auth_proxy_patch.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# This patch inject a sidecar container which is a HTTP proxy for the -# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: kube-rbac-proxy - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0 - args: - - "--secure-listen-address=0.0.0.0:8443" - - "--upstream=http://127.0.0.1:8080/" - - "--logtostderr=true" - - "--v=10" - ports: - - containerPort: 8443 - name: https - - name: manager - args: - - "--metrics-addr=127.0.0.1:8080" - - "--enable-leader-election" diff --git a/testdata/project-v2-addon/config/default/manager_webhook_patch.yaml b/testdata/project-v2-addon/config/default/manager_webhook_patch.yaml deleted file mode 100644 index 738de350b71..00000000000 --- a/testdata/project-v2-addon/config/default/manager_webhook_patch.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager - ports: - - containerPort: 9443 - name: webhook-server - protocol: TCP - volumeMounts: - - mountPath: /tmp/k8s-webhook-server/serving-certs - name: cert - readOnly: true - volumes: - - name: cert - secret: - defaultMode: 420 - secretName: webhook-server-cert diff --git a/testdata/project-v2-addon/config/default/webhookcainjection_patch.yaml b/testdata/project-v2-addon/config/default/webhookcainjection_patch.yaml deleted file mode 100644 index 7e79bf9955a..00000000000 --- a/testdata/project-v2-addon/config/default/webhookcainjection_patch.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# This patch add annotation to admission webhook config and -# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: MutatingWebhookConfiguration -metadata: - name: mutating-webhook-configuration - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) ---- -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: ValidatingWebhookConfiguration -metadata: - name: validating-webhook-configuration - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) diff --git a/testdata/project-v2-addon/config/manager/kustomization.yaml b/testdata/project-v2-addon/config/manager/kustomization.yaml deleted file mode 100644 index 5c5f0b84cba..00000000000 --- a/testdata/project-v2-addon/config/manager/kustomization.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resources: -- manager.yaml diff --git a/testdata/project-v2-addon/config/manager/manager.yaml b/testdata/project-v2-addon/config/manager/manager.yaml deleted file mode 100644 index b6c85a52d5f..00000000000 --- a/testdata/project-v2-addon/config/manager/manager.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - labels: - control-plane: controller-manager - name: system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system - labels: - control-plane: controller-manager -spec: - selector: - matchLabels: - control-plane: controller-manager - replicas: 1 - template: - metadata: - labels: - control-plane: controller-manager - spec: - containers: - - command: - - /manager - args: - - --enable-leader-election - image: controller:latest - name: manager - resources: - limits: - cpu: 100m - memory: 30Mi - requests: - cpu: 100m - memory: 20Mi - terminationGracePeriodSeconds: 10 diff --git a/testdata/project-v2-addon/config/prometheus/kustomization.yaml b/testdata/project-v2-addon/config/prometheus/kustomization.yaml deleted file mode 100644 index ed137168a1d..00000000000 --- a/testdata/project-v2-addon/config/prometheus/kustomization.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resources: -- monitor.yaml diff --git a/testdata/project-v2-addon/config/prometheus/monitor.yaml b/testdata/project-v2-addon/config/prometheus/monitor.yaml deleted file mode 100644 index d19136ae710..00000000000 --- a/testdata/project-v2-addon/config/prometheus/monitor.yaml +++ /dev/null @@ -1,20 +0,0 @@ - -# Prometheus Monitor Service (Metrics) -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-monitor - namespace: system -spec: - endpoints: - - path: /metrics - port: https - scheme: https - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - tlsConfig: - insecureSkipVerify: true - selector: - matchLabels: - control-plane: controller-manager diff --git a/testdata/project-v2-addon/config/rbac/admiral_editor_role.yaml b/testdata/project-v2-addon/config/rbac/admiral_editor_role.yaml deleted file mode 100644 index 7f2cc5cd99f..00000000000 --- a/testdata/project-v2-addon/config/rbac/admiral_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit admirals. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: admiral-editor-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - admirals - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - admirals/status - verbs: - - get diff --git a/testdata/project-v2-addon/config/rbac/admiral_viewer_role.yaml b/testdata/project-v2-addon/config/rbac/admiral_viewer_role.yaml deleted file mode 100644 index ddbb0c2a85b..00000000000 --- a/testdata/project-v2-addon/config/rbac/admiral_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view admirals. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: admiral-viewer-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - admirals - verbs: - - get - - list - - watch -- apiGroups: - - crew.testproject.org - resources: - - admirals/status - verbs: - - get diff --git a/testdata/project-v2-addon/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v2-addon/config/rbac/auth_proxy_client_clusterrole.yaml deleted file mode 100644 index bd4af137a9f..00000000000 --- a/testdata/project-v2-addon/config/rbac/auth_proxy_client_clusterrole.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: metrics-reader -rules: -- nonResourceURLs: ["/metrics"] - verbs: ["get"] diff --git a/testdata/project-v2-addon/config/rbac/auth_proxy_role.yaml b/testdata/project-v2-addon/config/rbac/auth_proxy_role.yaml deleted file mode 100644 index 618f5e4177c..00000000000 --- a/testdata/project-v2-addon/config/rbac/auth_proxy_role.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: proxy-role -rules: -- apiGroups: ["authentication.k8s.io"] - resources: - - tokenreviews - verbs: ["create"] -- apiGroups: ["authorization.k8s.io"] - resources: - - subjectaccessreviews - verbs: ["create"] diff --git a/testdata/project-v2-addon/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v2-addon/config/rbac/auth_proxy_role_binding.yaml deleted file mode 100644 index 48ed1e4b85c..00000000000 --- a/testdata/project-v2-addon/config/rbac/auth_proxy_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: proxy-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: proxy-role -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/testdata/project-v2-addon/config/rbac/auth_proxy_service.yaml b/testdata/project-v2-addon/config/rbac/auth_proxy_service.yaml deleted file mode 100644 index 6cf656be149..00000000000 --- a/testdata/project-v2-addon/config/rbac/auth_proxy_service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-service - namespace: system -spec: - ports: - - name: https - port: 8443 - targetPort: https - selector: - control-plane: controller-manager diff --git a/testdata/project-v2-addon/config/rbac/captain_editor_role.yaml b/testdata/project-v2-addon/config/rbac/captain_editor_role.yaml deleted file mode 100644 index 4b53ae38ffa..00000000000 --- a/testdata/project-v2-addon/config/rbac/captain_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit captains. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: captain-editor-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - captains - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - captains/status - verbs: - - get diff --git a/testdata/project-v2-addon/config/rbac/captain_viewer_role.yaml b/testdata/project-v2-addon/config/rbac/captain_viewer_role.yaml deleted file mode 100644 index f19e10439d2..00000000000 --- a/testdata/project-v2-addon/config/rbac/captain_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view captains. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: captain-viewer-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - captains - verbs: - - get - - list - - watch -- apiGroups: - - crew.testproject.org - resources: - - captains/status - verbs: - - get diff --git a/testdata/project-v2-addon/config/rbac/firstmate_editor_role.yaml b/testdata/project-v2-addon/config/rbac/firstmate_editor_role.yaml deleted file mode 100644 index 22a08be29dd..00000000000 --- a/testdata/project-v2-addon/config/rbac/firstmate_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit firstmates. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: firstmate-editor-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - firstmates - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - firstmates/status - verbs: - - get diff --git a/testdata/project-v2-addon/config/rbac/firstmate_viewer_role.yaml b/testdata/project-v2-addon/config/rbac/firstmate_viewer_role.yaml deleted file mode 100644 index 9fd6ba933c7..00000000000 --- a/testdata/project-v2-addon/config/rbac/firstmate_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view firstmates. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: firstmate-viewer-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - firstmates - verbs: - - get - - list - - watch -- apiGroups: - - crew.testproject.org - resources: - - firstmates/status - verbs: - - get diff --git a/testdata/project-v2-addon/config/rbac/kustomization.yaml b/testdata/project-v2-addon/config/rbac/kustomization.yaml deleted file mode 100644 index 66c28338fe0..00000000000 --- a/testdata/project-v2-addon/config/rbac/kustomization.yaml +++ /dev/null @@ -1,12 +0,0 @@ -resources: -- role.yaml -- role_binding.yaml -- leader_election_role.yaml -- leader_election_role_binding.yaml -# Comment the following 4 lines if you want to disable -# the auth proxy (https://github.com/brancz/kube-rbac-proxy) -# which protects your /metrics endpoint. -- auth_proxy_service.yaml -- auth_proxy_role.yaml -- auth_proxy_role_binding.yaml -- auth_proxy_client_clusterrole.yaml diff --git a/testdata/project-v2-addon/config/rbac/leader_election_role.yaml b/testdata/project-v2-addon/config/rbac/leader_election_role.yaml deleted file mode 100644 index 7dc16c420ec..00000000000 --- a/testdata/project-v2-addon/config/rbac/leader_election_role.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# permissions to do leader election. -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: leader-election-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - configmaps/status - verbs: - - get - - update - - patch -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/testdata/project-v2-addon/config/rbac/leader_election_role_binding.yaml b/testdata/project-v2-addon/config/rbac/leader_election_role_binding.yaml deleted file mode 100644 index eed16906f4d..00000000000 --- a/testdata/project-v2-addon/config/rbac/leader_election_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: leader-election-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: leader-election-role -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/testdata/project-v2-addon/config/rbac/role.yaml b/testdata/project-v2-addon/config/rbac/role.yaml deleted file mode 100644 index a1cd43c89d2..00000000000 --- a/testdata/project-v2-addon/config/rbac/role.yaml +++ /dev/null @@ -1,68 +0,0 @@ - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: manager-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - admirals - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - admirals/status - verbs: - - get - - patch - - update -- apiGroups: - - crew.testproject.org - resources: - - captains - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - captains/status - verbs: - - get - - patch - - update -- apiGroups: - - crew.testproject.org - resources: - - firstmates - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - firstmates/status - verbs: - - get - - patch - - update diff --git a/testdata/project-v2-addon/config/rbac/role_binding.yaml b/testdata/project-v2-addon/config/rbac/role_binding.yaml deleted file mode 100644 index 8f2658702c8..00000000000 --- a/testdata/project-v2-addon/config/rbac/role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: manager-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: manager-role -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/testdata/project-v2-addon/config/samples/crew_v1_admiral.yaml b/testdata/project-v2-addon/config/samples/crew_v1_admiral.yaml deleted file mode 100644 index 588448f7801..00000000000 --- a/testdata/project-v2-addon/config/samples/crew_v1_admiral.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: crew.testproject.org/v1 -kind: Admiral -metadata: - name: admiral-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-addon/config/samples/crew_v1_captain.yaml b/testdata/project-v2-addon/config/samples/crew_v1_captain.yaml deleted file mode 100644 index d0dcfc6cb4d..00000000000 --- a/testdata/project-v2-addon/config/samples/crew_v1_captain.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: crew.testproject.org/v1 -kind: Captain -metadata: - name: captain-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-addon/config/samples/crew_v1_firstmate.yaml b/testdata/project-v2-addon/config/samples/crew_v1_firstmate.yaml deleted file mode 100644 index 61749572695..00000000000 --- a/testdata/project-v2-addon/config/samples/crew_v1_firstmate.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: crew.testproject.org/v1 -kind: FirstMate -metadata: - name: firstmate-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-addon/config/webhook/kustomization.yaml b/testdata/project-v2-addon/config/webhook/kustomization.yaml deleted file mode 100644 index 9cf26134e4d..00000000000 --- a/testdata/project-v2-addon/config/webhook/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -resources: -- manifests.yaml -- service.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v2-addon/config/webhook/kustomizeconfig.yaml b/testdata/project-v2-addon/config/webhook/kustomizeconfig.yaml deleted file mode 100644 index 25e21e3c963..00000000000 --- a/testdata/project-v2-addon/config/webhook/kustomizeconfig.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# the following config is for teaching kustomize where to look at when substituting vars. -# It requires kustomize v2.1.0 or newer to work properly. -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - - kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - -namespace: -- kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true -- kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true - -varReference: -- path: metadata/annotations diff --git a/testdata/project-v2-addon/config/webhook/service.yaml b/testdata/project-v2-addon/config/webhook/service.yaml deleted file mode 100644 index 31e0f829591..00000000000 --- a/testdata/project-v2-addon/config/webhook/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ - -apiVersion: v1 -kind: Service -metadata: - name: webhook-service - namespace: system -spec: - ports: - - port: 443 - targetPort: 9443 - selector: - control-plane: controller-manager diff --git a/testdata/project-v2-addon/controllers/admiral_controller.go b/testdata/project-v2-addon/controllers/admiral_controller.go deleted file mode 100644 index 746527d62ca..00000000000 --- a/testdata/project-v2-addon/controllers/admiral_controller.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1" -) - -var _ reconcile.Reconciler = &AdmiralReconciler{} - -// AdmiralReconciler reconciles a Admiral object -type AdmiralReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme - - declarative.Reconciler -} - -//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals/status,verbs=get;update;patch - -// SetupWithManager sets up the controller with the Manager. -func (r *AdmiralReconciler) SetupWithManager(mgr ctrl.Manager) error { - addon.Init() - - labels := map[string]string{ - "k8s-app": "admiral", - } - - watchLabels := declarative.SourceLabel(mgr.GetScheme()) - - if err := r.Reconciler.Init(mgr, &crewv1.Admiral{}, - declarative.WithObjectTransform(declarative.AddLabels(labels)), - declarative.WithOwner(declarative.SourceAsOwner), - declarative.WithLabels(watchLabels), - declarative.WithStatus(status.NewBasic(mgr.GetClient())), - // TODO: add an application to your manifest: declarative.WithObjectTransform(addon.TransformApplicationFromStatus), - // TODO: add an application to your manifest: declarative.WithManagedApplication(watchLabels), - declarative.WithObjectTransform(addon.ApplyPatches), - ); err != nil { - return err - } - - c, err := controller.New("admiral-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to Admiral - err = c.Watch(&source.Kind{Type: &crewv1.Admiral{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - // Watch for changes to deployed objects - _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) - if err != nil { - return err - } - - return nil -} diff --git a/testdata/project-v2-addon/controllers/captain_controller.go b/testdata/project-v2-addon/controllers/captain_controller.go deleted file mode 100644 index a294c6f590c..00000000000 --- a/testdata/project-v2-addon/controllers/captain_controller.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1" -) - -var _ reconcile.Reconciler = &CaptainReconciler{} - -// CaptainReconciler reconciles a Captain object -type CaptainReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme - - declarative.Reconciler -} - -//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains/status,verbs=get;update;patch - -// SetupWithManager sets up the controller with the Manager. -func (r *CaptainReconciler) SetupWithManager(mgr ctrl.Manager) error { - addon.Init() - - labels := map[string]string{ - "k8s-app": "captain", - } - - watchLabels := declarative.SourceLabel(mgr.GetScheme()) - - if err := r.Reconciler.Init(mgr, &crewv1.Captain{}, - declarative.WithObjectTransform(declarative.AddLabels(labels)), - declarative.WithOwner(declarative.SourceAsOwner), - declarative.WithLabels(watchLabels), - declarative.WithStatus(status.NewBasic(mgr.GetClient())), - // TODO: add an application to your manifest: declarative.WithObjectTransform(addon.TransformApplicationFromStatus), - // TODO: add an application to your manifest: declarative.WithManagedApplication(watchLabels), - declarative.WithObjectTransform(addon.ApplyPatches), - ); err != nil { - return err - } - - c, err := controller.New("captain-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to Captain - err = c.Watch(&source.Kind{Type: &crewv1.Captain{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - // Watch for changes to deployed objects - _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) - if err != nil { - return err - } - - return nil -} diff --git a/testdata/project-v2-addon/controllers/firstmate_controller.go b/testdata/project-v2-addon/controllers/firstmate_controller.go deleted file mode 100644 index f92f02f6760..00000000000 --- a/testdata/project-v2-addon/controllers/firstmate_controller.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status" - "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1" -) - -var _ reconcile.Reconciler = &FirstMateReconciler{} - -// FirstMateReconciler reconciles a FirstMate object -type FirstMateReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme - - declarative.Reconciler -} - -//+kubebuilder:rbac:groups=crew.testproject.org,resources=firstmates,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=crew.testproject.org,resources=firstmates/status,verbs=get;update;patch - -// SetupWithManager sets up the controller with the Manager. -func (r *FirstMateReconciler) SetupWithManager(mgr ctrl.Manager) error { - addon.Init() - - labels := map[string]string{ - "k8s-app": "firstmate", - } - - watchLabels := declarative.SourceLabel(mgr.GetScheme()) - - if err := r.Reconciler.Init(mgr, &crewv1.FirstMate{}, - declarative.WithObjectTransform(declarative.AddLabels(labels)), - declarative.WithOwner(declarative.SourceAsOwner), - declarative.WithLabels(watchLabels), - declarative.WithStatus(status.NewBasic(mgr.GetClient())), - // TODO: add an application to your manifest: declarative.WithObjectTransform(addon.TransformApplicationFromStatus), - // TODO: add an application to your manifest: declarative.WithManagedApplication(watchLabels), - declarative.WithObjectTransform(addon.ApplyPatches), - ); err != nil { - return err - } - - c, err := controller.New("firstmate-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to FirstMate - err = c.Watch(&source.Kind{Type: &crewv1.FirstMate{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - // Watch for changes to deployed objects - _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) - if err != nil { - return err - } - - return nil -} diff --git a/testdata/project-v2-addon/controllers/suite_test.go b/testdata/project-v2-addon/controllers/suite_test.go deleted file mode 100644 index a0f15184633..00000000000 --- a/testdata/project-v2-addon/controllers/suite_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = crewv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-addon/go.mod b/testdata/project-v2-addon/go.mod deleted file mode 100644 index 158ead9deb9..00000000000 --- a/testdata/project-v2-addon/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module sigs.k8s.io/kubebuilder/testdata/project-v2-addon - -go 1.13 - -require ( - github.com/go-logr/logr v0.1.0 - github.com/onsi/ginkgo v1.12.1 - github.com/onsi/gomega v1.10.1 - k8s.io/apimachinery v0.18.6 - k8s.io/client-go v0.18.6 - sigs.k8s.io/controller-runtime v0.6.4 - sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200522144838-848d48e5b073 -) diff --git a/testdata/project-v2-addon/hack/boilerplate.go.txt b/testdata/project-v2-addon/hack/boilerplate.go.txt deleted file mode 100644 index b54e305f300..00000000000 --- a/testdata/project-v2-addon/hack/boilerplate.go.txt +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ \ No newline at end of file diff --git a/testdata/project-v2-addon/main.go b/testdata/project-v2-addon/main.go deleted file mode 100644 index 70a31af5643..00000000000 --- a/testdata/project-v2-addon/main.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "os" - - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-addon/api/v1" - "sigs.k8s.io/kubebuilder/testdata/project-v2-addon/controllers" - //+kubebuilder:scaffold:imports -) - -var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") -) - -func init() { - utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - - utilruntime.Must(crewv1.AddToScheme(scheme)) - //+kubebuilder:scaffold:scheme -} - -func main() { - var metricsAddr string - var enableLeaderElection bool - flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, - "Enable leader election for controller manager. "+ - "Enabling this will ensure there is only one active controller manager.") - flag.Parse() - - ctrl.SetLogger(zap.New(zap.UseDevMode(true))) - - mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ - Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, - LeaderElection: enableLeaderElection, - LeaderElectionID: "3a3badaf.testproject.org", - }) - if err != nil { - setupLog.Error(err, "unable to start manager") - os.Exit(1) - } - - if err = (&controllers.CaptainReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Captain"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Captain") - os.Exit(1) - } - if err = (&controllers.FirstMateReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("FirstMate"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "FirstMate") - os.Exit(1) - } - if err = (&controllers.AdmiralReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Admiral"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Admiral") - os.Exit(1) - } - //+kubebuilder:scaffold:builder - - setupLog.Info("starting manager") - if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { - setupLog.Error(err, "problem running manager") - os.Exit(1) - } -} diff --git a/testdata/project-v2-multigroup/.gitignore b/testdata/project-v2-multigroup/.gitignore deleted file mode 100644 index d97ffc5159b..00000000000 --- a/testdata/project-v2-multigroup/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ - -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -bin - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Kubernetes Generated files - skip generated files, except for vendored files - -!vendor/**/zz_generated.* - -# editor and IDE paraphernalia -.idea -*.swp -*.swo -*~ diff --git a/testdata/project-v2-multigroup/Dockerfile b/testdata/project-v2-multigroup/Dockerfile deleted file mode 100644 index a765127fb4b..00000000000 --- a/testdata/project-v2-multigroup/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Build the manager binary -FROM golang:1.13 as builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY main.go main.go -COPY apis/ apis/ -COPY controllers/ controllers/ - -# Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go - -# Use distroless as minimal base image to package the manager binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot -WORKDIR / -COPY --from=builder /workspace/manager . -USER nonroot:nonroot - -ENTRYPOINT ["/manager"] diff --git a/testdata/project-v2-multigroup/Makefile b/testdata/project-v2-multigroup/Makefile deleted file mode 100644 index 2de8bc9a1d6..00000000000 --- a/testdata/project-v2-multigroup/Makefile +++ /dev/null @@ -1,125 +0,0 @@ - -# Image URL to use all building/pushing image targets -IMG ?= controller:latest -# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) -CRD_OPTIONS ?= "crd:trivialVersions=true" - -# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) -ifeq (,$(shell go env GOBIN)) -GOBIN=$(shell go env GOPATH)/bin -else -GOBIN=$(shell go env GOBIN) -endif - -.PHONY: all -all: build - -##@ General - -# The help target prints out all targets with their descriptions organized -# beneath their categories. The categories are represented by '##@' and the -# target descriptions by '##'. The awk commands is responsible for reading the -# entire set of makefiles included in this invocation, looking for lines of the -# file as xyz: ## something, and then pretty-format the target and help. Then, -# if there's a line with ##@ something, that gets pretty-printed as a category. -# More info on the usage of ANSI control characters for terminal formatting: -# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters -# More info on the awk command: -# http://linuxcommand.org/lc3_adv_awk.php - -.PHONY: help -help: ## Display this help. - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) - -##@ Development - -.PHONY: manifests -manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases - -.PHONY: generate -generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. - $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." - -.PHONY: fmt -fmt: ## Run go fmt against code. - go fmt ./... - -.PHONY: vet -vet: ## Run go vet against code. - go vet ./... - -.PHONY: test -test: manifests generate fmt vet ## Run tests. - go test ./... -coverprofile cover.out - -##@ Build - -.PHONY: build -build: generate fmt vet ## Build manager binary. - go build -o bin/manager main.go - -# Backwards compatibility -.PHONY: manager -manager: build ## Build manager binary (alias for build target). - -.PHONY: run -run: manifests generate fmt vet ## Run a controller from your host. - go run ./main.go - -.PHONY: docker-build -docker-build: test ## Build docker image with the manager. - docker build -t ${IMG} . - -.PHONY: docker-push -docker-push: ## Push docker image with the manager. - docker push ${IMG} - -##@ Deployment - -ifndef ignore-not-found - ignore-not-found = false -endif - -.PHONY: install -install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl apply -f - - -.PHONY: uninstall -uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - - -.PHONY: deploy -deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - $(KUSTOMIZE) build config/default | kubectl apply -f - - -.PHONY: undeploy -undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - - -##@ Build Dependencies - -## Location to install dependencies to -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): ## Ensure that the directory exists - mkdir -p $(LOCALBIN) - -## Tool Binaries -KUSTOMIZE ?= $(LOCALBIN)/kustomize -CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen - -## Tool Versions -KUSTOMIZE_VERSION ?= v3.5.4 -CONTROLLER_TOOLS_VERSION ?= v0.3.0 - -KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" -.PHONY: kustomize -kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. -$(KUSTOMIZE): $(LOCALBIN) - curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN) - -.PHONY: controller-gen -controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. -$(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) diff --git a/testdata/project-v2-multigroup/PROJECT b/testdata/project-v2-multigroup/PROJECT deleted file mode 100644 index de2471edb9c..00000000000 --- a/testdata/project-v2-multigroup/PROJECT +++ /dev/null @@ -1,32 +0,0 @@ -domain: testproject.org -multigroup: true -repo: sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup -resources: -- group: crew - kind: Captain - version: v1 -- group: ship - kind: Frigate - version: v1beta1 -- group: ship - kind: Destroyer - version: v1 -- group: ship - kind: Cruiser - version: v2alpha1 -- group: sea-creatures - kind: Kraken - version: v1beta1 -- group: sea-creatures - kind: Leviathan - version: v1beta2 -- group: foo.policy - kind: HealthCheckPolicy - version: v1 -- group: foo - kind: Bar - version: v1 -- group: fiz - kind: Bar - version: v1 -version: "2" diff --git a/testdata/project-v2-multigroup/apis/crew/v1/captain_types.go b/testdata/project-v2-multigroup/apis/crew/v1/captain_types.go deleted file mode 100644 index e81debb719c..00000000000 --- a/testdata/project-v2-multigroup/apis/crew/v1/captain_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// CaptainSpec defines the desired state of Captain -type CaptainSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Captain. Edit captain_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// CaptainStatus defines the observed state of Captain -type CaptainStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Captain is the Schema for the captains API -type Captain struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CaptainSpec `json:"spec,omitempty"` - Status CaptainStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// CaptainList contains a list of Captain -type CaptainList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Captain `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Captain{}, &CaptainList{}) -} diff --git a/testdata/project-v2-multigroup/apis/crew/v1/captain_webhook.go b/testdata/project-v2-multigroup/apis/crew/v1/captain_webhook.go deleted file mode 100644 index 0c10648727b..00000000000 --- a/testdata/project-v2-multigroup/apis/crew/v1/captain_webhook.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var captainlog = logf.Log.WithName("captain-resource") - -func (r *Captain) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! - -//+kubebuilder:webhook:path=/mutate-crew-testproject-org-v1-captain,mutating=true,failurePolicy=fail,groups=crew.testproject.org,resources=captains,verbs=create;update,versions=v1,name=mcaptain.kb.io - -var _ webhook.Defaulter = &Captain{} - -// Default implements webhook.Defaulter so a webhook will be registered for the type -func (r *Captain) Default() { - captainlog.Info("default", "name", r.Name) - - // TODO(user): fill in your defaulting logic. -} - -// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation. -//+kubebuilder:webhook:verbs=create;update,path=/validate-crew-testproject-org-v1-captain,mutating=false,failurePolicy=fail,groups=crew.testproject.org,resources=captains,versions=v1,name=vcaptain.kb.io - -var _ webhook.Validator = &Captain{} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type -func (r *Captain) ValidateCreate() error { - captainlog.Info("validate create", "name", r.Name) - - // TODO(user): fill in your validation logic upon object creation. - return nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type -func (r *Captain) ValidateUpdate(old runtime.Object) error { - captainlog.Info("validate update", "name", r.Name) - - // TODO(user): fill in your validation logic upon object update. - return nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type -func (r *Captain) ValidateDelete() error { - captainlog.Info("validate delete", "name", r.Name) - - // TODO(user): fill in your validation logic upon object deletion. - return nil -} diff --git a/testdata/project-v2-multigroup/apis/crew/v1/groupversion_info.go b/testdata/project-v2-multigroup/apis/crew/v1/groupversion_info.go deleted file mode 100644 index 33458c7506e..00000000000 --- a/testdata/project-v2-multigroup/apis/crew/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the crew v1 API group -//+kubebuilder:object:generate=true -//+groupName=crew.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "crew.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/crew/v1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/crew/v1/zz_generated.deepcopy.go deleted file mode 100644 index 3d19f0cd037..00000000000 --- a/testdata/project-v2-multigroup/apis/crew/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Captain) DeepCopyInto(out *Captain) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Captain. -func (in *Captain) DeepCopy() *Captain { - if in == nil { - return nil - } - out := new(Captain) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Captain) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptainList) DeepCopyInto(out *CaptainList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Captain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainList. -func (in *CaptainList) DeepCopy() *CaptainList { - if in == nil { - return nil - } - out := new(CaptainList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CaptainList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptainSpec) DeepCopyInto(out *CaptainSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainSpec. -func (in *CaptainSpec) DeepCopy() *CaptainSpec { - if in == nil { - return nil - } - out := new(CaptainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptainStatus) DeepCopyInto(out *CaptainStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainStatus. -func (in *CaptainStatus) DeepCopy() *CaptainStatus { - if in == nil { - return nil - } - out := new(CaptainStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/fiz/v1/bar_types.go b/testdata/project-v2-multigroup/apis/fiz/v1/bar_types.go deleted file mode 100644 index 398da384cda..00000000000 --- a/testdata/project-v2-multigroup/apis/fiz/v1/bar_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// BarSpec defines the desired state of Bar -type BarSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Bar. Edit bar_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// BarStatus defines the observed state of Bar -type BarStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Bar is the Schema for the bars API -type Bar struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec BarSpec `json:"spec,omitempty"` - Status BarStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// BarList contains a list of Bar -type BarList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Bar `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Bar{}, &BarList{}) -} diff --git a/testdata/project-v2-multigroup/apis/fiz/v1/groupversion_info.go b/testdata/project-v2-multigroup/apis/fiz/v1/groupversion_info.go deleted file mode 100644 index 8fbae6ea708..00000000000 --- a/testdata/project-v2-multigroup/apis/fiz/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the fiz v1 API group -//+kubebuilder:object:generate=true -//+groupName=fiz.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "fiz.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/fiz/v1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/fiz/v1/zz_generated.deepcopy.go deleted file mode 100644 index f46b6a1cb10..00000000000 --- a/testdata/project-v2-multigroup/apis/fiz/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bar) DeepCopyInto(out *Bar) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bar. -func (in *Bar) DeepCopy() *Bar { - if in == nil { - return nil - } - out := new(Bar) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Bar) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarList) DeepCopyInto(out *BarList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Bar, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarList. -func (in *BarList) DeepCopy() *BarList { - if in == nil { - return nil - } - out := new(BarList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BarList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarSpec) DeepCopyInto(out *BarSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarSpec. -func (in *BarSpec) DeepCopy() *BarSpec { - if in == nil { - return nil - } - out := new(BarSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarStatus) DeepCopyInto(out *BarStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarStatus. -func (in *BarStatus) DeepCopy() *BarStatus { - if in == nil { - return nil - } - out := new(BarStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/foo.policy/v1/groupversion_info.go b/testdata/project-v2-multigroup/apis/foo.policy/v1/groupversion_info.go deleted file mode 100644 index 29bb003c035..00000000000 --- a/testdata/project-v2-multigroup/apis/foo.policy/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the foo.policy v1 API group -//+kubebuilder:object:generate=true -//+groupName=foo.policy.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "foo.policy.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go b/testdata/project-v2-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go deleted file mode 100644 index db63b3139a5..00000000000 --- a/testdata/project-v2-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// HealthCheckPolicySpec defines the desired state of HealthCheckPolicy -type HealthCheckPolicySpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of HealthCheckPolicy. Edit healthcheckpolicy_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// HealthCheckPolicyStatus defines the observed state of HealthCheckPolicy -type HealthCheckPolicyStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// HealthCheckPolicy is the Schema for the healthcheckpolicies API -type HealthCheckPolicy struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec HealthCheckPolicySpec `json:"spec,omitempty"` - Status HealthCheckPolicyStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// HealthCheckPolicyList contains a list of HealthCheckPolicy -type HealthCheckPolicyList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []HealthCheckPolicy `json:"items"` -} - -func init() { - SchemeBuilder.Register(&HealthCheckPolicy{}, &HealthCheckPolicyList{}) -} diff --git a/testdata/project-v2-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go deleted file mode 100644 index 384b31870fe..00000000000 --- a/testdata/project-v2-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheckPolicy) DeepCopyInto(out *HealthCheckPolicy) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicy. -func (in *HealthCheckPolicy) DeepCopy() *HealthCheckPolicy { - if in == nil { - return nil - } - out := new(HealthCheckPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *HealthCheckPolicy) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheckPolicyList) DeepCopyInto(out *HealthCheckPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]HealthCheckPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicyList. -func (in *HealthCheckPolicyList) DeepCopy() *HealthCheckPolicyList { - if in == nil { - return nil - } - out := new(HealthCheckPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *HealthCheckPolicyList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheckPolicySpec) DeepCopyInto(out *HealthCheckPolicySpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicySpec. -func (in *HealthCheckPolicySpec) DeepCopy() *HealthCheckPolicySpec { - if in == nil { - return nil - } - out := new(HealthCheckPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheckPolicyStatus) DeepCopyInto(out *HealthCheckPolicyStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicyStatus. -func (in *HealthCheckPolicyStatus) DeepCopy() *HealthCheckPolicyStatus { - if in == nil { - return nil - } - out := new(HealthCheckPolicyStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/foo/v1/bar_types.go b/testdata/project-v2-multigroup/apis/foo/v1/bar_types.go deleted file mode 100644 index 398da384cda..00000000000 --- a/testdata/project-v2-multigroup/apis/foo/v1/bar_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// BarSpec defines the desired state of Bar -type BarSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Bar. Edit bar_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// BarStatus defines the observed state of Bar -type BarStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Bar is the Schema for the bars API -type Bar struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec BarSpec `json:"spec,omitempty"` - Status BarStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// BarList contains a list of Bar -type BarList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Bar `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Bar{}, &BarList{}) -} diff --git a/testdata/project-v2-multigroup/apis/foo/v1/groupversion_info.go b/testdata/project-v2-multigroup/apis/foo/v1/groupversion_info.go deleted file mode 100644 index 06774db9bf0..00000000000 --- a/testdata/project-v2-multigroup/apis/foo/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the foo v1 API group -//+kubebuilder:object:generate=true -//+groupName=foo.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "foo.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/foo/v1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/foo/v1/zz_generated.deepcopy.go deleted file mode 100644 index f46b6a1cb10..00000000000 --- a/testdata/project-v2-multigroup/apis/foo/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bar) DeepCopyInto(out *Bar) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bar. -func (in *Bar) DeepCopy() *Bar { - if in == nil { - return nil - } - out := new(Bar) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Bar) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarList) DeepCopyInto(out *BarList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Bar, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarList. -func (in *BarList) DeepCopy() *BarList { - if in == nil { - return nil - } - out := new(BarList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BarList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarSpec) DeepCopyInto(out *BarSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarSpec. -func (in *BarSpec) DeepCopy() *BarSpec { - if in == nil { - return nil - } - out := new(BarSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BarStatus) DeepCopyInto(out *BarStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarStatus. -func (in *BarStatus) DeepCopy() *BarStatus { - if in == nil { - return nil - } - out := new(BarStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go b/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go deleted file mode 100644 index 7613a89964a..00000000000 --- a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta1 contains API Schema definitions for the sea-creatures v1beta1 API group -//+kubebuilder:object:generate=true -//+groupName=sea-creatures.testproject.org -package v1beta1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "sea-creatures.testproject.org", Version: "v1beta1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/kraken_types.go b/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/kraken_types.go deleted file mode 100644 index afb57fff4b0..00000000000 --- a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/kraken_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// KrakenSpec defines the desired state of Kraken -type KrakenSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Kraken. Edit kraken_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// KrakenStatus defines the observed state of Kraken -type KrakenStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Kraken is the Schema for the krakens API -type Kraken struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KrakenSpec `json:"spec,omitempty"` - Status KrakenStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// KrakenList contains a list of Kraken -type KrakenList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Kraken `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Kraken{}, &KrakenList{}) -} diff --git a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index e8b5ea29fc8..00000000000 --- a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Kraken) DeepCopyInto(out *Kraken) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kraken. -func (in *Kraken) DeepCopy() *Kraken { - if in == nil { - return nil - } - out := new(Kraken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Kraken) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KrakenList) DeepCopyInto(out *KrakenList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Kraken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KrakenList. -func (in *KrakenList) DeepCopy() *KrakenList { - if in == nil { - return nil - } - out := new(KrakenList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KrakenList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KrakenSpec) DeepCopyInto(out *KrakenSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KrakenSpec. -func (in *KrakenSpec) DeepCopy() *KrakenSpec { - if in == nil { - return nil - } - out := new(KrakenSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KrakenStatus) DeepCopyInto(out *KrakenStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KrakenStatus. -func (in *KrakenStatus) DeepCopy() *KrakenStatus { - if in == nil { - return nil - } - out := new(KrakenStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go b/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go deleted file mode 100644 index 4334497f3a0..00000000000 --- a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta2 contains API Schema definitions for the sea-creatures v1beta2 API group -//+kubebuilder:object:generate=true -//+groupName=sea-creatures.testproject.org -package v1beta2 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "sea-creatures.testproject.org", Version: "v1beta2"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go b/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go deleted file mode 100644 index 47da45524f6..00000000000 --- a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// LeviathanSpec defines the desired state of Leviathan -type LeviathanSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Leviathan. Edit leviathan_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// LeviathanStatus defines the observed state of Leviathan -type LeviathanStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Leviathan is the Schema for the leviathans API -type Leviathan struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec LeviathanSpec `json:"spec,omitempty"` - Status LeviathanStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// LeviathanList contains a list of Leviathan -type LeviathanList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Leviathan `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Leviathan{}, &LeviathanList{}) -} diff --git a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go deleted file mode 100644 index e5a09f90a46..00000000000 --- a/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Leviathan) DeepCopyInto(out *Leviathan) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Leviathan. -func (in *Leviathan) DeepCopy() *Leviathan { - if in == nil { - return nil - } - out := new(Leviathan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Leviathan) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeviathanList) DeepCopyInto(out *LeviathanList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Leviathan, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeviathanList. -func (in *LeviathanList) DeepCopy() *LeviathanList { - if in == nil { - return nil - } - out := new(LeviathanList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeviathanList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeviathanSpec) DeepCopyInto(out *LeviathanSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeviathanSpec. -func (in *LeviathanSpec) DeepCopy() *LeviathanSpec { - if in == nil { - return nil - } - out := new(LeviathanSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeviathanStatus) DeepCopyInto(out *LeviathanStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeviathanStatus. -func (in *LeviathanStatus) DeepCopy() *LeviathanStatus { - if in == nil { - return nil - } - out := new(LeviathanStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/ship/v1/destroyer_types.go b/testdata/project-v2-multigroup/apis/ship/v1/destroyer_types.go deleted file mode 100644 index 8efa6fad827..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1/destroyer_types.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// DestroyerSpec defines the desired state of Destroyer -type DestroyerSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Destroyer. Edit destroyer_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// DestroyerStatus defines the observed state of Destroyer -type DestroyerStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status -//+kubebuilder:resource:scope=Cluster - -// Destroyer is the Schema for the destroyers API -type Destroyer struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DestroyerSpec `json:"spec,omitempty"` - Status DestroyerStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// DestroyerList contains a list of Destroyer -type DestroyerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Destroyer `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Destroyer{}, &DestroyerList{}) -} diff --git a/testdata/project-v2-multigroup/apis/ship/v1/destroyer_webhook.go b/testdata/project-v2-multigroup/apis/ship/v1/destroyer_webhook.go deleted file mode 100644 index 5c769aa4ae8..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1/destroyer_webhook.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var destroyerlog = logf.Log.WithName("destroyer-resource") - -func (r *Destroyer) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! - -//+kubebuilder:webhook:path=/mutate-ship-testproject-org-v1-destroyer,mutating=true,failurePolicy=fail,groups=ship.testproject.org,resources=destroyers,verbs=create;update,versions=v1,name=mdestroyer.kb.io - -var _ webhook.Defaulter = &Destroyer{} - -// Default implements webhook.Defaulter so a webhook will be registered for the type -func (r *Destroyer) Default() { - destroyerlog.Info("default", "name", r.Name) - - // TODO(user): fill in your defaulting logic. -} diff --git a/testdata/project-v2-multigroup/apis/ship/v1/groupversion_info.go b/testdata/project-v2-multigroup/apis/ship/v1/groupversion_info.go deleted file mode 100644 index 633f5a4e398..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the ship v1 API group -//+kubebuilder:object:generate=true -//+groupName=ship.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "ship.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/ship/v1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/ship/v1/zz_generated.deepcopy.go deleted file mode 100644 index c02c174f0d0..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destroyer) DeepCopyInto(out *Destroyer) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destroyer. -func (in *Destroyer) DeepCopy() *Destroyer { - if in == nil { - return nil - } - out := new(Destroyer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Destroyer) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DestroyerList) DeepCopyInto(out *DestroyerList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Destroyer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestroyerList. -func (in *DestroyerList) DeepCopy() *DestroyerList { - if in == nil { - return nil - } - out := new(DestroyerList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DestroyerList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DestroyerSpec) DeepCopyInto(out *DestroyerSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestroyerSpec. -func (in *DestroyerSpec) DeepCopy() *DestroyerSpec { - if in == nil { - return nil - } - out := new(DestroyerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DestroyerStatus) DeepCopyInto(out *DestroyerStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestroyerStatus. -func (in *DestroyerStatus) DeepCopy() *DestroyerStatus { - if in == nil { - return nil - } - out := new(DestroyerStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_types.go b/testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_types.go deleted file mode 100644 index c8734a6cf9e..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// FrigateSpec defines the desired state of Frigate -type FrigateSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Frigate. Edit frigate_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// FrigateStatus defines the observed state of Frigate -type FrigateStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Frigate is the Schema for the frigates API -type Frigate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec FrigateSpec `json:"spec,omitempty"` - Status FrigateStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// FrigateList contains a list of Frigate -type FrigateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Frigate `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Frigate{}, &FrigateList{}) -} diff --git a/testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_webhook.go b/testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_webhook.go deleted file mode 100644 index 5e4c482ead0..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1beta1/frigate_webhook.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// log is for logging in this package. -var frigatelog = logf.Log.WithName("frigate-resource") - -func (r *Frigate) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! diff --git a/testdata/project-v2-multigroup/apis/ship/v1beta1/groupversion_info.go b/testdata/project-v2-multigroup/apis/ship/v1beta1/groupversion_info.go deleted file mode 100644 index 26b0fbd2752..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1beta1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta1 contains API Schema definitions for the ship v1beta1 API group -//+kubebuilder:object:generate=true -//+groupName=ship.testproject.org -package v1beta1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "ship.testproject.org", Version: "v1beta1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index d1ac770b5c7..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Frigate) DeepCopyInto(out *Frigate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Frigate. -func (in *Frigate) DeepCopy() *Frigate { - if in == nil { - return nil - } - out := new(Frigate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Frigate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FrigateList) DeepCopyInto(out *FrigateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Frigate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrigateList. -func (in *FrigateList) DeepCopy() *FrigateList { - if in == nil { - return nil - } - out := new(FrigateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FrigateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FrigateSpec) DeepCopyInto(out *FrigateSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrigateSpec. -func (in *FrigateSpec) DeepCopy() *FrigateSpec { - if in == nil { - return nil - } - out := new(FrigateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FrigateStatus) DeepCopyInto(out *FrigateStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrigateStatus. -func (in *FrigateStatus) DeepCopy() *FrigateStatus { - if in == nil { - return nil - } - out := new(FrigateStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_types.go b/testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_types.go deleted file mode 100644 index 6160dc14b1d..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_types.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v2alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// CruiserSpec defines the desired state of Cruiser -type CruiserSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Cruiser. Edit cruiser_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// CruiserStatus defines the observed state of Cruiser -type CruiserStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status -//+kubebuilder:resource:scope=Cluster - -// Cruiser is the Schema for the cruisers API -type Cruiser struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CruiserSpec `json:"spec,omitempty"` - Status CruiserStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// CruiserList contains a list of Cruiser -type CruiserList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cruiser `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Cruiser{}, &CruiserList{}) -} diff --git a/testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_webhook.go b/testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_webhook.go deleted file mode 100644 index bda86bdb977..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v2alpha1/cruiser_webhook.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v2alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var cruiserlog = logf.Log.WithName("cruiser-resource") - -func (r *Cruiser) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! - -// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation. -//+kubebuilder:webhook:verbs=create;update,path=/validate-ship-testproject-org-v2alpha1-cruiser,mutating=false,failurePolicy=fail,groups=ship.testproject.org,resources=cruisers,versions=v2alpha1,name=vcruiser.kb.io - -var _ webhook.Validator = &Cruiser{} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type -func (r *Cruiser) ValidateCreate() error { - cruiserlog.Info("validate create", "name", r.Name) - - // TODO(user): fill in your validation logic upon object creation. - return nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type -func (r *Cruiser) ValidateUpdate(old runtime.Object) error { - cruiserlog.Info("validate update", "name", r.Name) - - // TODO(user): fill in your validation logic upon object update. - return nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type -func (r *Cruiser) ValidateDelete() error { - cruiserlog.Info("validate delete", "name", r.Name) - - // TODO(user): fill in your validation logic upon object deletion. - return nil -} diff --git a/testdata/project-v2-multigroup/apis/ship/v2alpha1/groupversion_info.go b/testdata/project-v2-multigroup/apis/ship/v2alpha1/groupversion_info.go deleted file mode 100644 index ac5d9ee826a..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v2alpha1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v2alpha1 contains API Schema definitions for the ship v2alpha1 API group -//+kubebuilder:object:generate=true -//+groupName=ship.testproject.org -package v2alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "ship.testproject.org", Version: "v2alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v2-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go b/testdata/project-v2-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go deleted file mode 100644 index e335a81bb7d..00000000000 --- a/testdata/project-v2-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v2alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cruiser) DeepCopyInto(out *Cruiser) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cruiser. -func (in *Cruiser) DeepCopy() *Cruiser { - if in == nil { - return nil - } - out := new(Cruiser) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cruiser) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CruiserList) DeepCopyInto(out *CruiserList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cruiser, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CruiserList. -func (in *CruiserList) DeepCopy() *CruiserList { - if in == nil { - return nil - } - out := new(CruiserList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CruiserList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CruiserSpec) DeepCopyInto(out *CruiserSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CruiserSpec. -func (in *CruiserSpec) DeepCopy() *CruiserSpec { - if in == nil { - return nil - } - out := new(CruiserSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CruiserStatus) DeepCopyInto(out *CruiserStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CruiserStatus. -func (in *CruiserStatus) DeepCopy() *CruiserStatus { - if in == nil { - return nil - } - out := new(CruiserStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v2-multigroup/config/certmanager/certificate.yaml b/testdata/project-v2-multigroup/config/certmanager/certificate.yaml deleted file mode 100644 index 58db114fa05..00000000000 --- a/testdata/project-v2-multigroup/config/certmanager/certificate.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# The following manifests contain a self-signed issuer CR and a certificate CR. -# More document can be found at https://docs.cert-manager.io -# WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for -# breaking changes -apiVersion: cert-manager.io/v1alpha2 -kind: Issuer -metadata: - name: selfsigned-issuer - namespace: system -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml - namespace: system -spec: - # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize - dnsNames: - - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc - - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local - issuerRef: - kind: Issuer - name: selfsigned-issuer - secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize diff --git a/testdata/project-v2-multigroup/config/certmanager/kustomization.yaml b/testdata/project-v2-multigroup/config/certmanager/kustomization.yaml deleted file mode 100644 index bebea5a595e..00000000000 --- a/testdata/project-v2-multigroup/config/certmanager/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -resources: -- certificate.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v2-multigroup/config/certmanager/kustomizeconfig.yaml b/testdata/project-v2-multigroup/config/certmanager/kustomizeconfig.yaml deleted file mode 100644 index 90d7c313ca1..00000000000 --- a/testdata/project-v2-multigroup/config/certmanager/kustomizeconfig.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# This configuration is for teaching kustomize how to update name ref and var substitution -nameReference: -- kind: Issuer - group: cert-manager.io - fieldSpecs: - - kind: Certificate - group: cert-manager.io - path: spec/issuerRef/name - -varReference: -- kind: Certificate - group: cert-manager.io - path: spec/commonName -- kind: Certificate - group: cert-manager.io - path: spec/dnsNames diff --git a/testdata/project-v2-multigroup/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v2-multigroup/config/crd/bases/crew.testproject.org_captains.yaml deleted file mode 100644 index 5b0580f100e..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/crew.testproject.org_captains.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: captains.crew.testproject.org -spec: - group: crew.testproject.org - names: - kind: Captain - listKind: CaptainList - plural: captains - singular: captain - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Captain is the Schema for the captains API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CaptainSpec defines the desired state of Captain - properties: - foo: - description: Foo is an example field of Captain. Edit captain_types.go - to remove/update - type: string - type: object - status: - description: CaptainStatus defines the observed state of Captain - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml b/testdata/project-v2-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml deleted file mode 100644 index cfdbb86c839..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml +++ /dev/null @@ -1,57 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: bars.fiz.testproject.org -spec: - group: fiz.testproject.org - names: - kind: Bar - listKind: BarList - plural: bars - singular: bar - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Bar is the Schema for the bars API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: BarSpec defines the desired state of Bar - properties: - foo: - description: Foo is an example field of Bar. Edit bar_types.go to remove/update - type: string - type: object - status: - description: BarStatus defines the observed state of Bar - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml b/testdata/project-v2-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml deleted file mode 100644 index 94ef4aea2a4..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: healthcheckpolicies.foo.policy.testproject.org -spec: - group: foo.policy.testproject.org - names: - kind: HealthCheckPolicy - listKind: HealthCheckPolicyList - plural: healthcheckpolicies - singular: healthcheckpolicy - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: HealthCheckPolicy is the Schema for the healthcheckpolicies API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: HealthCheckPolicySpec defines the desired state of HealthCheckPolicy - properties: - foo: - description: Foo is an example field of HealthCheckPolicy. Edit healthcheckpolicy_types.go - to remove/update - type: string - type: object - status: - description: HealthCheckPolicyStatus defines the observed state of HealthCheckPolicy - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/foo.testproject.org_bars.yaml b/testdata/project-v2-multigroup/config/crd/bases/foo.testproject.org_bars.yaml deleted file mode 100644 index 6795b94d0a8..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/foo.testproject.org_bars.yaml +++ /dev/null @@ -1,57 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: bars.foo.testproject.org -spec: - group: foo.testproject.org - names: - kind: Bar - listKind: BarList - plural: bars - singular: bar - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Bar is the Schema for the bars API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: BarSpec defines the desired state of Bar - properties: - foo: - description: Foo is an example field of Bar. Edit bar_types.go to remove/update - type: string - type: object - status: - description: BarStatus defines the observed state of Bar - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml b/testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml deleted file mode 100644 index 73b0bb4c018..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: krakens.sea-creatures.testproject.org -spec: - group: sea-creatures.testproject.org - names: - kind: Kraken - listKind: KrakenList - plural: krakens - singular: kraken - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Kraken is the Schema for the krakens API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KrakenSpec defines the desired state of Kraken - properties: - foo: - description: Foo is an example field of Kraken. Edit kraken_types.go - to remove/update - type: string - type: object - status: - description: KrakenStatus defines the observed state of Kraken - type: object - type: object - version: v1beta1 - versions: - - name: v1beta1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml b/testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml deleted file mode 100644 index cf018dcba83..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: leviathans.sea-creatures.testproject.org -spec: - group: sea-creatures.testproject.org - names: - kind: Leviathan - listKind: LeviathanList - plural: leviathans - singular: leviathan - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Leviathan is the Schema for the leviathans API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: LeviathanSpec defines the desired state of Leviathan - properties: - foo: - description: Foo is an example field of Leviathan. Edit leviathan_types.go - to remove/update - type: string - type: object - status: - description: LeviathanStatus defines the observed state of Leviathan - type: object - type: object - version: v1beta2 - versions: - - name: v1beta2 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml b/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml deleted file mode 100644 index 9b5f3a709d4..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: cruisers.ship.testproject.org -spec: - group: ship.testproject.org - names: - kind: Cruiser - listKind: CruiserList - plural: cruisers - singular: cruiser - scope: Cluster - subresources: - status: {} - validation: - openAPIV3Schema: - description: Cruiser is the Schema for the cruisers API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CruiserSpec defines the desired state of Cruiser - properties: - foo: - description: Foo is an example field of Cruiser. Edit cruiser_types.go - to remove/update - type: string - type: object - status: - description: CruiserStatus defines the observed state of Cruiser - type: object - type: object - version: v2alpha1 - versions: - - name: v2alpha1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml b/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml deleted file mode 100644 index f169adbfe4c..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: destroyers.ship.testproject.org -spec: - group: ship.testproject.org - names: - kind: Destroyer - listKind: DestroyerList - plural: destroyers - singular: destroyer - scope: Cluster - subresources: - status: {} - validation: - openAPIV3Schema: - description: Destroyer is the Schema for the destroyers API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: DestroyerSpec defines the desired state of Destroyer - properties: - foo: - description: Foo is an example field of Destroyer. Edit destroyer_types.go - to remove/update - type: string - type: object - status: - description: DestroyerStatus defines the observed state of Destroyer - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml b/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml deleted file mode 100644 index f32c4975a34..00000000000 --- a/testdata/project-v2-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml +++ /dev/null @@ -1,58 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: frigates.ship.testproject.org -spec: - group: ship.testproject.org - names: - kind: Frigate - listKind: FrigateList - plural: frigates - singular: frigate - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Frigate is the Schema for the frigates API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: FrigateSpec defines the desired state of Frigate - properties: - foo: - description: Foo is an example field of Frigate. Edit frigate_types.go - to remove/update - type: string - type: object - status: - description: FrigateStatus defines the observed state of Frigate - type: object - type: object - version: v1beta1 - versions: - - name: v1beta1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v2-multigroup/config/crd/kustomization.yaml b/testdata/project-v2-multigroup/config/crd/kustomization.yaml deleted file mode 100644 index 4adeb7a0fa2..00000000000 --- a/testdata/project-v2-multigroup/config/crd/kustomization.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default -resources: -- bases/crew.testproject.org_captains.yaml -- bases/ship.testproject.org_frigates.yaml -- bases/ship.testproject.org_destroyers.yaml -- bases/ship.testproject.org_cruisers.yaml -- bases/sea-creatures.testproject.org_krakens.yaml -- bases/sea-creatures.testproject.org_leviathans.yaml -- bases/foo.policy.testproject.org_healthcheckpolicies.yaml -- bases/foo.testproject.org_bars.yaml -- bases/fiz.testproject.org_bars.yaml -#+kubebuilder:scaffold:crdkustomizeresource - -patchesStrategicMerge: -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. -# patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_captains.yaml -#- patches/webhook_in_frigates.yaml -#- patches/webhook_in_destroyers.yaml -#- patches/webhook_in_cruisers.yaml -#- patches/webhook_in_krakens.yaml -#- patches/webhook_in_leviathans.yaml -#- patches/webhook_in_healthcheckpolicies.yaml -#- patches/webhook_in_bars.yaml -#+kubebuilder:scaffold:crdkustomizewebhookpatch - -# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. -# patches here are for enabling the CA injection for each CRD -#- patches/cainjection_in_captains.yaml -#- patches/cainjection_in_frigates.yaml -#- patches/cainjection_in_destroyers.yaml -#- patches/cainjection_in_cruisers.yaml -#- patches/cainjection_in_krakens.yaml -#- patches/cainjection_in_leviathans.yaml -#- patches/cainjection_in_healthcheckpolicies.yaml -#- patches/cainjection_in_bars.yaml -#+kubebuilder:scaffold:crdkustomizecainjectionpatch - -# the following config is for teaching kustomize how to do kustomization for CRDs. -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v2-multigroup/config/crd/kustomizeconfig.yaml b/testdata/project-v2-multigroup/config/crd/kustomizeconfig.yaml deleted file mode 100644 index 6f83d9a94bc..00000000000 --- a/testdata/project-v2-multigroup/config/crd/kustomizeconfig.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# This file is for teaching kustomize how to substitute name and namespace reference in CRD -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: CustomResourceDefinition - group: apiextensions.k8s.io - path: spec/conversion/webhookClientConfig/service/name - -namespace: -- kind: CustomResourceDefinition - group: apiextensions.k8s.io - path: spec/conversion/webhookClientConfig/service/namespace - create: false - -varReference: -- path: metadata/annotations diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_bars.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_bars.yaml deleted file mode 100644 index b70829763ab..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_bars.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: bars.foo.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_captains.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_captains.yaml deleted file mode 100644 index 72918ce20f4..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_captains.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: captains.crew.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_cruisers.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_cruisers.yaml deleted file mode 100644 index 57fbbaa0edc..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_cruisers.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: cruisers.ship.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_destroyers.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_destroyers.yaml deleted file mode 100644 index a6876308d2e..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_destroyers.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: destroyers.ship.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_frigates.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_frigates.yaml deleted file mode 100644 index 1945956fc7f..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_frigates.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: frigates.ship.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_healthcheckpolicies.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_healthcheckpolicies.yaml deleted file mode 100644 index 47895401dd4..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_healthcheckpolicies.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: healthcheckpolicies.foo.policy.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_krakens.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_krakens.yaml deleted file mode 100644 index 66ce9ed3c3d..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_krakens.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: krakens.sea-creatures.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_leviathans.yaml b/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_leviathans.yaml deleted file mode 100644 index 06212739413..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/cainjection_in_leviathans.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: leviathans.sea-creatures.testproject.org diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_bars.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_bars.yaml deleted file mode 100644 index 19154af0fbd..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_bars.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: bars.foo.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_captains.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_captains.yaml deleted file mode 100644 index c515517131e..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_captains.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: captains.crew.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_cruisers.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_cruisers.yaml deleted file mode 100644 index ba4b3924279..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_cruisers.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: cruisers.ship.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_destroyers.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_destroyers.yaml deleted file mode 100644 index 6413f3706fc..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_destroyers.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: destroyers.ship.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_frigates.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_frigates.yaml deleted file mode 100644 index 206145f1ba2..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_frigates.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: frigates.ship.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_healthcheckpolicies.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_healthcheckpolicies.yaml deleted file mode 100644 index 2f64333c88a..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_healthcheckpolicies.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: healthcheckpolicies.foo.policy.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_krakens.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_krakens.yaml deleted file mode 100644 index 4e00143d00c..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_krakens.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: krakens.sea-creatures.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_leviathans.yaml b/testdata/project-v2-multigroup/config/crd/patches/webhook_in_leviathans.yaml deleted file mode 100644 index 9746df71926..00000000000 --- a/testdata/project-v2-multigroup/config/crd/patches/webhook_in_leviathans.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: leviathans.sea-creatures.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v2-multigroup/config/default/kustomization.yaml b/testdata/project-v2-multigroup/config/default/kustomization.yaml deleted file mode 100644 index a66a85f7cd7..00000000000 --- a/testdata/project-v2-multigroup/config/default/kustomization.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# Adds namespace to all resources. -namespace: project-v2-multigroup-system - -# Value of this field is prepended to the -# names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". -# Note that it should also match with the prefix (text before '-') of the namespace -# field above. -namePrefix: project-v2-multigroup- - -# Labels to add to all resources and selectors. -#commonLabels: -# someName: someValue - -bases: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus - -patchesStrategicMerge: - # Protect the /metrics endpoint by putting it behind auth. - # If you want your controller-manager to expose the /metrics - # endpoint w/o any authn/z, please comment the following line. -- manager_auth_proxy_patch.yaml - -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- manager_webhook_patch.yaml - -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. -# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. -# 'CERTMANAGER' needs to be enabled to use ca injection -#- webhookcainjection_patch.yaml - -# the following config is for teaching kustomize how to do var substitution -vars: -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1alpha2 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldref: -# fieldpath: metadata.namespace -#- name: CERTIFICATE_NAME -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1alpha2 -# name: serving-cert # this name should match the one in certificate.yaml -#- name: SERVICE_NAMESPACE # namespace of the service -# objref: -# kind: Service -# version: v1 -# name: webhook-service -# fieldref: -# fieldpath: metadata.namespace -#- name: SERVICE_NAME -# objref: -# kind: Service -# version: v1 -# name: webhook-service diff --git a/testdata/project-v2-multigroup/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v2-multigroup/config/default/manager_auth_proxy_patch.yaml deleted file mode 100644 index 27a25b56726..00000000000 --- a/testdata/project-v2-multigroup/config/default/manager_auth_proxy_patch.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# This patch inject a sidecar container which is a HTTP proxy for the -# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: kube-rbac-proxy - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0 - args: - - "--secure-listen-address=0.0.0.0:8443" - - "--upstream=http://127.0.0.1:8080/" - - "--logtostderr=true" - - "--v=10" - ports: - - containerPort: 8443 - name: https - - name: manager - args: - - "--metrics-addr=127.0.0.1:8080" - - "--enable-leader-election" diff --git a/testdata/project-v2-multigroup/config/default/manager_webhook_patch.yaml b/testdata/project-v2-multigroup/config/default/manager_webhook_patch.yaml deleted file mode 100644 index 738de350b71..00000000000 --- a/testdata/project-v2-multigroup/config/default/manager_webhook_patch.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager - ports: - - containerPort: 9443 - name: webhook-server - protocol: TCP - volumeMounts: - - mountPath: /tmp/k8s-webhook-server/serving-certs - name: cert - readOnly: true - volumes: - - name: cert - secret: - defaultMode: 420 - secretName: webhook-server-cert diff --git a/testdata/project-v2-multigroup/config/default/webhookcainjection_patch.yaml b/testdata/project-v2-multigroup/config/default/webhookcainjection_patch.yaml deleted file mode 100644 index 7e79bf9955a..00000000000 --- a/testdata/project-v2-multigroup/config/default/webhookcainjection_patch.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# This patch add annotation to admission webhook config and -# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: MutatingWebhookConfiguration -metadata: - name: mutating-webhook-configuration - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) ---- -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: ValidatingWebhookConfiguration -metadata: - name: validating-webhook-configuration - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) diff --git a/testdata/project-v2-multigroup/config/manager/kustomization.yaml b/testdata/project-v2-multigroup/config/manager/kustomization.yaml deleted file mode 100644 index 5c5f0b84cba..00000000000 --- a/testdata/project-v2-multigroup/config/manager/kustomization.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resources: -- manager.yaml diff --git a/testdata/project-v2-multigroup/config/manager/manager.yaml b/testdata/project-v2-multigroup/config/manager/manager.yaml deleted file mode 100644 index b6c85a52d5f..00000000000 --- a/testdata/project-v2-multigroup/config/manager/manager.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - labels: - control-plane: controller-manager - name: system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system - labels: - control-plane: controller-manager -spec: - selector: - matchLabels: - control-plane: controller-manager - replicas: 1 - template: - metadata: - labels: - control-plane: controller-manager - spec: - containers: - - command: - - /manager - args: - - --enable-leader-election - image: controller:latest - name: manager - resources: - limits: - cpu: 100m - memory: 30Mi - requests: - cpu: 100m - memory: 20Mi - terminationGracePeriodSeconds: 10 diff --git a/testdata/project-v2-multigroup/config/prometheus/kustomization.yaml b/testdata/project-v2-multigroup/config/prometheus/kustomization.yaml deleted file mode 100644 index ed137168a1d..00000000000 --- a/testdata/project-v2-multigroup/config/prometheus/kustomization.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resources: -- monitor.yaml diff --git a/testdata/project-v2-multigroup/config/prometheus/monitor.yaml b/testdata/project-v2-multigroup/config/prometheus/monitor.yaml deleted file mode 100644 index d19136ae710..00000000000 --- a/testdata/project-v2-multigroup/config/prometheus/monitor.yaml +++ /dev/null @@ -1,20 +0,0 @@ - -# Prometheus Monitor Service (Metrics) -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-monitor - namespace: system -spec: - endpoints: - - path: /metrics - port: https - scheme: https - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - tlsConfig: - insecureSkipVerify: true - selector: - matchLabels: - control-plane: controller-manager diff --git a/testdata/project-v2-multigroup/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v2-multigroup/config/rbac/auth_proxy_client_clusterrole.yaml deleted file mode 100644 index bd4af137a9f..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/auth_proxy_client_clusterrole.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: metrics-reader -rules: -- nonResourceURLs: ["/metrics"] - verbs: ["get"] diff --git a/testdata/project-v2-multigroup/config/rbac/auth_proxy_role.yaml b/testdata/project-v2-multigroup/config/rbac/auth_proxy_role.yaml deleted file mode 100644 index 618f5e4177c..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/auth_proxy_role.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: proxy-role -rules: -- apiGroups: ["authentication.k8s.io"] - resources: - - tokenreviews - verbs: ["create"] -- apiGroups: ["authorization.k8s.io"] - resources: - - subjectaccessreviews - verbs: ["create"] diff --git a/testdata/project-v2-multigroup/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v2-multigroup/config/rbac/auth_proxy_role_binding.yaml deleted file mode 100644 index 48ed1e4b85c..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/auth_proxy_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: proxy-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: proxy-role -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/testdata/project-v2-multigroup/config/rbac/auth_proxy_service.yaml b/testdata/project-v2-multigroup/config/rbac/auth_proxy_service.yaml deleted file mode 100644 index 6cf656be149..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/auth_proxy_service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-service - namespace: system -spec: - ports: - - name: https - port: 8443 - targetPort: https - selector: - control-plane: controller-manager diff --git a/testdata/project-v2-multigroup/config/rbac/bar_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/bar_editor_role.yaml deleted file mode 100644 index e9915a5b9c3..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/bar_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit bars. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: bar-editor-role -rules: -- apiGroups: - - foo.testproject.org - resources: - - bars - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - foo.testproject.org - resources: - - bars/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/bar_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/bar_viewer_role.yaml deleted file mode 100644 index a4569ac9654..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/bar_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view bars. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: bar-viewer-role -rules: -- apiGroups: - - foo.testproject.org - resources: - - bars - verbs: - - get - - list - - watch -- apiGroups: - - foo.testproject.org - resources: - - bars/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/captain_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/captain_editor_role.yaml deleted file mode 100644 index 4b53ae38ffa..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/captain_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit captains. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: captain-editor-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - captains - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - captains/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/captain_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/captain_viewer_role.yaml deleted file mode 100644 index f19e10439d2..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/captain_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view captains. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: captain-viewer-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - captains - verbs: - - get - - list - - watch -- apiGroups: - - crew.testproject.org - resources: - - captains/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/cruiser_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/cruiser_editor_role.yaml deleted file mode 100644 index 2bbc0e18027..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/cruiser_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit cruisers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cruiser-editor-role -rules: -- apiGroups: - - ship.testproject.org - resources: - - cruisers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ship.testproject.org - resources: - - cruisers/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/cruiser_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/cruiser_viewer_role.yaml deleted file mode 100644 index bc0afd3335b..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/cruiser_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view cruisers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cruiser-viewer-role -rules: -- apiGroups: - - ship.testproject.org - resources: - - cruisers - verbs: - - get - - list - - watch -- apiGroups: - - ship.testproject.org - resources: - - cruisers/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/destroyer_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/destroyer_editor_role.yaml deleted file mode 100644 index 36533983918..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/destroyer_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit destroyers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: destroyer-editor-role -rules: -- apiGroups: - - ship.testproject.org - resources: - - destroyers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ship.testproject.org - resources: - - destroyers/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/destroyer_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/destroyer_viewer_role.yaml deleted file mode 100644 index bf71d1276cb..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/destroyer_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view destroyers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: destroyer-viewer-role -rules: -- apiGroups: - - ship.testproject.org - resources: - - destroyers - verbs: - - get - - list - - watch -- apiGroups: - - ship.testproject.org - resources: - - destroyers/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/frigate_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/frigate_editor_role.yaml deleted file mode 100644 index 4191d6c22f6..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/frigate_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit frigates. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: frigate-editor-role -rules: -- apiGroups: - - ship.testproject.org - resources: - - frigates - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ship.testproject.org - resources: - - frigates/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/frigate_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/frigate_viewer_role.yaml deleted file mode 100644 index 155416066b8..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/frigate_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view frigates. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: frigate-viewer-role -rules: -- apiGroups: - - ship.testproject.org - resources: - - frigates - verbs: - - get - - list - - watch -- apiGroups: - - ship.testproject.org - resources: - - frigates/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_editor_role.yaml deleted file mode 100644 index bbec63d13e8..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit healthcheckpolicies. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: healthcheckpolicy-editor-role -rules: -- apiGroups: - - foo.policy.testproject.org - resources: - - healthcheckpolicies - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - foo.policy.testproject.org - resources: - - healthcheckpolicies/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_viewer_role.yaml deleted file mode 100644 index 66acbe3a35f..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/healthcheckpolicy_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view healthcheckpolicies. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: healthcheckpolicy-viewer-role -rules: -- apiGroups: - - foo.policy.testproject.org - resources: - - healthcheckpolicies - verbs: - - get - - list - - watch -- apiGroups: - - foo.policy.testproject.org - resources: - - healthcheckpolicies/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/kraken_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/kraken_editor_role.yaml deleted file mode 100644 index c0601ecc6d7..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/kraken_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit krakens. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kraken-editor-role -rules: -- apiGroups: - - sea-creatures.testproject.org - resources: - - krakens - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - sea-creatures.testproject.org - resources: - - krakens/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/kraken_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/kraken_viewer_role.yaml deleted file mode 100644 index f9c55e9dafe..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/kraken_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view krakens. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kraken-viewer-role -rules: -- apiGroups: - - sea-creatures.testproject.org - resources: - - krakens - verbs: - - get - - list - - watch -- apiGroups: - - sea-creatures.testproject.org - resources: - - krakens/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/kustomization.yaml b/testdata/project-v2-multigroup/config/rbac/kustomization.yaml deleted file mode 100644 index 66c28338fe0..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/kustomization.yaml +++ /dev/null @@ -1,12 +0,0 @@ -resources: -- role.yaml -- role_binding.yaml -- leader_election_role.yaml -- leader_election_role_binding.yaml -# Comment the following 4 lines if you want to disable -# the auth proxy (https://github.com/brancz/kube-rbac-proxy) -# which protects your /metrics endpoint. -- auth_proxy_service.yaml -- auth_proxy_role.yaml -- auth_proxy_role_binding.yaml -- auth_proxy_client_clusterrole.yaml diff --git a/testdata/project-v2-multigroup/config/rbac/leader_election_role.yaml b/testdata/project-v2-multigroup/config/rbac/leader_election_role.yaml deleted file mode 100644 index 7dc16c420ec..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/leader_election_role.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# permissions to do leader election. -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: leader-election-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - configmaps/status - verbs: - - get - - update - - patch -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/testdata/project-v2-multigroup/config/rbac/leader_election_role_binding.yaml b/testdata/project-v2-multigroup/config/rbac/leader_election_role_binding.yaml deleted file mode 100644 index eed16906f4d..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/leader_election_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: leader-election-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: leader-election-role -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/testdata/project-v2-multigroup/config/rbac/leviathan_editor_role.yaml b/testdata/project-v2-multigroup/config/rbac/leviathan_editor_role.yaml deleted file mode 100644 index a062a277fca..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/leviathan_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit leviathans. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: leviathan-editor-role -rules: -- apiGroups: - - sea-creatures.testproject.org - resources: - - leviathans - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - sea-creatures.testproject.org - resources: - - leviathans/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/leviathan_viewer_role.yaml b/testdata/project-v2-multigroup/config/rbac/leviathan_viewer_role.yaml deleted file mode 100644 index 9791727c656..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/leviathan_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view leviathans. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: leviathan-viewer-role -rules: -- apiGroups: - - sea-creatures.testproject.org - resources: - - leviathans - verbs: - - get - - list - - watch -- apiGroups: - - sea-creatures.testproject.org - resources: - - leviathans/status - verbs: - - get diff --git a/testdata/project-v2-multigroup/config/rbac/role.yaml b/testdata/project-v2-multigroup/config/rbac/role.yaml deleted file mode 100644 index e15ab18ab92..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/role.yaml +++ /dev/null @@ -1,208 +0,0 @@ - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: manager-role -rules: -- apiGroups: - - apps - resources: - - deployments - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - apps - resources: - - deployments/status - verbs: - - get - - patch - - update -- apiGroups: - - crew.testproject.org - resources: - - captains - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - captains/status - verbs: - - get - - patch - - update -- apiGroups: - - fiz.testproject.org - resources: - - bars - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - fiz.testproject.org - resources: - - bars/status - verbs: - - get - - patch - - update -- apiGroups: - - foo.policy.testproject.org - resources: - - healthcheckpolicies - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - foo.policy.testproject.org - resources: - - healthcheckpolicies/status - verbs: - - get - - patch - - update -- apiGroups: - - foo.testproject.org - resources: - - bars - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - foo.testproject.org - resources: - - bars/status - verbs: - - get - - patch - - update -- apiGroups: - - sea-creatures.testproject.org - resources: - - krakens - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - sea-creatures.testproject.org - resources: - - krakens/status - verbs: - - get - - patch - - update -- apiGroups: - - sea-creatures.testproject.org - resources: - - leviathans - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - sea-creatures.testproject.org - resources: - - leviathans/status - verbs: - - get - - patch - - update -- apiGroups: - - ship.testproject.org - resources: - - cruisers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ship.testproject.org - resources: - - cruisers/status - verbs: - - get - - patch - - update -- apiGroups: - - ship.testproject.org - resources: - - destroyers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ship.testproject.org - resources: - - destroyers/status - verbs: - - get - - patch - - update -- apiGroups: - - ship.testproject.org - resources: - - frigates - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ship.testproject.org - resources: - - frigates/status - verbs: - - get - - patch - - update diff --git a/testdata/project-v2-multigroup/config/rbac/role_binding.yaml b/testdata/project-v2-multigroup/config/rbac/role_binding.yaml deleted file mode 100644 index 8f2658702c8..00000000000 --- a/testdata/project-v2-multigroup/config/rbac/role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: manager-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: manager-role -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/testdata/project-v2-multigroup/config/samples/crew_v1_captain.yaml b/testdata/project-v2-multigroup/config/samples/crew_v1_captain.yaml deleted file mode 100644 index d0dcfc6cb4d..00000000000 --- a/testdata/project-v2-multigroup/config/samples/crew_v1_captain.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: crew.testproject.org/v1 -kind: Captain -metadata: - name: captain-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/fiz_v1_bar.yaml b/testdata/project-v2-multigroup/config/samples/fiz_v1_bar.yaml deleted file mode 100644 index 5f4d6ced1e2..00000000000 --- a/testdata/project-v2-multigroup/config/samples/fiz_v1_bar.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: fiz.testproject.org/v1 -kind: Bar -metadata: - name: bar-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/foo.policy_v1_healthcheckpolicy.yaml b/testdata/project-v2-multigroup/config/samples/foo.policy_v1_healthcheckpolicy.yaml deleted file mode 100644 index 6e6d5e572ea..00000000000 --- a/testdata/project-v2-multigroup/config/samples/foo.policy_v1_healthcheckpolicy.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: foo.policy.testproject.org/v1 -kind: HealthCheckPolicy -metadata: - name: healthcheckpolicy-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/foo_v1_bar.yaml b/testdata/project-v2-multigroup/config/samples/foo_v1_bar.yaml deleted file mode 100644 index f43fb43849f..00000000000 --- a/testdata/project-v2-multigroup/config/samples/foo_v1_bar.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: foo.testproject.org/v1 -kind: Bar -metadata: - name: bar-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta1_kraken.yaml b/testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta1_kraken.yaml deleted file mode 100644 index 7d6055ff7a2..00000000000 --- a/testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta1_kraken.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: sea-creatures.testproject.org/v1beta1 -kind: Kraken -metadata: - name: kraken-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta2_leviathan.yaml b/testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta2_leviathan.yaml deleted file mode 100644 index afcf8bc87fd..00000000000 --- a/testdata/project-v2-multigroup/config/samples/sea-creatures_v1beta2_leviathan.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: sea-creatures.testproject.org/v1beta2 -kind: Leviathan -metadata: - name: leviathan-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/ship_v1_destroyer.yaml b/testdata/project-v2-multigroup/config/samples/ship_v1_destroyer.yaml deleted file mode 100644 index a5bfa12cc0c..00000000000 --- a/testdata/project-v2-multigroup/config/samples/ship_v1_destroyer.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: ship.testproject.org/v1 -kind: Destroyer -metadata: - name: destroyer-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/ship_v1beta1_frigate.yaml b/testdata/project-v2-multigroup/config/samples/ship_v1beta1_frigate.yaml deleted file mode 100644 index 1aa9f130cf5..00000000000 --- a/testdata/project-v2-multigroup/config/samples/ship_v1beta1_frigate.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: ship.testproject.org/v1beta1 -kind: Frigate -metadata: - name: frigate-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/samples/ship_v2alpha1_cruiser.yaml b/testdata/project-v2-multigroup/config/samples/ship_v2alpha1_cruiser.yaml deleted file mode 100644 index d87858cb882..00000000000 --- a/testdata/project-v2-multigroup/config/samples/ship_v2alpha1_cruiser.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: ship.testproject.org/v2alpha1 -kind: Cruiser -metadata: - name: cruiser-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v2-multigroup/config/webhook/kustomization.yaml b/testdata/project-v2-multigroup/config/webhook/kustomization.yaml deleted file mode 100644 index 9cf26134e4d..00000000000 --- a/testdata/project-v2-multigroup/config/webhook/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -resources: -- manifests.yaml -- service.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v2-multigroup/config/webhook/kustomizeconfig.yaml b/testdata/project-v2-multigroup/config/webhook/kustomizeconfig.yaml deleted file mode 100644 index 25e21e3c963..00000000000 --- a/testdata/project-v2-multigroup/config/webhook/kustomizeconfig.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# the following config is for teaching kustomize where to look at when substituting vars. -# It requires kustomize v2.1.0 or newer to work properly. -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - - kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - -namespace: -- kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true -- kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true - -varReference: -- path: metadata/annotations diff --git a/testdata/project-v2-multigroup/config/webhook/manifests.yaml b/testdata/project-v2-multigroup/config/webhook/manifests.yaml deleted file mode 100644 index 50c03663000..00000000000 --- a/testdata/project-v2-multigroup/config/webhook/manifests.yaml +++ /dev/null @@ -1,88 +0,0 @@ - ---- -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: MutatingWebhookConfiguration -metadata: - creationTimestamp: null - name: mutating-webhook-configuration -webhooks: -- clientConfig: - caBundle: Cg== - service: - name: webhook-service - namespace: system - path: /mutate-crew-testproject-org-v1-captain - failurePolicy: Fail - name: mcaptain.kb.io - rules: - - apiGroups: - - crew.testproject.org - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - captains -- clientConfig: - caBundle: Cg== - service: - name: webhook-service - namespace: system - path: /mutate-ship-testproject-org-v1-destroyer - failurePolicy: Fail - name: mdestroyer.kb.io - rules: - - apiGroups: - - ship.testproject.org - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - destroyers - ---- -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: ValidatingWebhookConfiguration -metadata: - creationTimestamp: null - name: validating-webhook-configuration -webhooks: -- clientConfig: - caBundle: Cg== - service: - name: webhook-service - namespace: system - path: /validate-crew-testproject-org-v1-captain - failurePolicy: Fail - name: vcaptain.kb.io - rules: - - apiGroups: - - crew.testproject.org - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - captains -- clientConfig: - caBundle: Cg== - service: - name: webhook-service - namespace: system - path: /validate-ship-testproject-org-v2alpha1-cruiser - failurePolicy: Fail - name: vcruiser.kb.io - rules: - - apiGroups: - - ship.testproject.org - apiVersions: - - v2alpha1 - operations: - - CREATE - - UPDATE - resources: - - cruisers diff --git a/testdata/project-v2-multigroup/config/webhook/service.yaml b/testdata/project-v2-multigroup/config/webhook/service.yaml deleted file mode 100644 index 31e0f829591..00000000000 --- a/testdata/project-v2-multigroup/config/webhook/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ - -apiVersion: v1 -kind: Service -metadata: - name: webhook-service - namespace: system -spec: - ports: - - port: 443 - targetPort: 9443 - selector: - control-plane: controller-manager diff --git a/testdata/project-v2-multigroup/controllers/apps/deployment_controller.go b/testdata/project-v2-multigroup/controllers/apps/deployment_controller.go deleted file mode 100644 index 2e375e1ff89..00000000000 --- a/testdata/project-v2-multigroup/controllers/apps/deployment_controller.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - appsv1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// DeploymentReconciler reconciles a Deployment object -type DeploymentReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Deployment object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *DeploymentReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("deployment", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *DeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&appsv1.Deployment{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/apps/suite_test.go b/testdata/project-v2-multigroup/controllers/apps/suite_test.go deleted file mode 100644 index a3da8d68447..00000000000 --- a/testdata/project-v2-multigroup/controllers/apps/suite_test.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - appsv1 "k8s.io/api/apps/v1" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = appsv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/controllers/crew/captain_controller.go b/testdata/project-v2-multigroup/controllers/crew/captain_controller.go deleted file mode 100644 index 8c7754f4586..00000000000 --- a/testdata/project-v2-multigroup/controllers/crew/captain_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/crew/v1" -) - -// CaptainReconciler reconciles a Captain object -type CaptainReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Captain object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *CaptainReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("captain", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *CaptainReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&crewv1.Captain{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/crew/suite_test.go b/testdata/project-v2-multigroup/controllers/crew/suite_test.go deleted file mode 100644 index 9da8f9f77dd..00000000000 --- a/testdata/project-v2-multigroup/controllers/crew/suite_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/crew/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = crewv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/controllers/fiz/bar_controller.go b/testdata/project-v2-multigroup/controllers/fiz/bar_controller.go deleted file mode 100644 index 621df6df8bd..00000000000 --- a/testdata/project-v2-multigroup/controllers/fiz/bar_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/fiz/v1" -) - -// BarReconciler reconciles a Bar object -type BarReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=fiz.testproject.org,resources=bars,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=fiz.testproject.org,resources=bars/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Bar object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *BarReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("bar", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *BarReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&fizv1.Bar{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/fiz/suite_test.go b/testdata/project-v2-multigroup/controllers/fiz/suite_test.go deleted file mode 100644 index c0072276bce..00000000000 --- a/testdata/project-v2-multigroup/controllers/fiz/suite_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/fiz/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = fizv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v2-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go deleted file mode 100644 index 0c8b45c0a61..00000000000 --- a/testdata/project-v2-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/foo.policy/v1" -) - -// HealthCheckPolicyReconciler reconciles a HealthCheckPolicy object -type HealthCheckPolicyReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=foo.policy.testproject.org,resources=healthcheckpolicies,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=foo.policy.testproject.org,resources=healthcheckpolicies/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the HealthCheckPolicy object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *HealthCheckPolicyReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("healthcheckpolicy", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *HealthCheckPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&foopolicyv1.HealthCheckPolicy{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/foo.policy/suite_test.go b/testdata/project-v2-multigroup/controllers/foo.policy/suite_test.go deleted file mode 100644 index 46212dfb8d7..00000000000 --- a/testdata/project-v2-multigroup/controllers/foo.policy/suite_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/foo.policy/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = foopolicyv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/controllers/foo/bar_controller.go b/testdata/project-v2-multigroup/controllers/foo/bar_controller.go deleted file mode 100644 index 0bc99b0dd3d..00000000000 --- a/testdata/project-v2-multigroup/controllers/foo/bar_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - foov1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/foo/v1" -) - -// BarReconciler reconciles a Bar object -type BarReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=foo.testproject.org,resources=bars,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=foo.testproject.org,resources=bars/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Bar object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *BarReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("bar", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *BarReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&foov1.Bar{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/foo/suite_test.go b/testdata/project-v2-multigroup/controllers/foo/suite_test.go deleted file mode 100644 index 7cd71e39acc..00000000000 --- a/testdata/project-v2-multigroup/controllers/foo/suite_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - foov1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/foo/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = foov1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/controllers/sea-creatures/kraken_controller.go b/testdata/project-v2-multigroup/controllers/sea-creatures/kraken_controller.go deleted file mode 100644 index 22b843b6bcb..00000000000 --- a/testdata/project-v2-multigroup/controllers/sea-creatures/kraken_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1" -) - -// KrakenReconciler reconciles a Kraken object -type KrakenReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=krakens,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=krakens/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Kraken object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *KrakenReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("kraken", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *KrakenReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&seacreaturesv1beta1.Kraken{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/sea-creatures/leviathan_controller.go b/testdata/project-v2-multigroup/controllers/sea-creatures/leviathan_controller.go deleted file mode 100644 index 9113b06000c..00000000000 --- a/testdata/project-v2-multigroup/controllers/sea-creatures/leviathan_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2" -) - -// LeviathanReconciler reconciles a Leviathan object -type LeviathanReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=leviathans,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=leviathans/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Leviathan object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *LeviathanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("leviathan", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *LeviathanReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&seacreaturesv1beta2.Leviathan{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/sea-creatures/suite_test.go b/testdata/project-v2-multigroup/controllers/sea-creatures/suite_test.go deleted file mode 100644 index 7f97772743e..00000000000 --- a/testdata/project-v2-multigroup/controllers/sea-creatures/suite_test.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1" - seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = seacreaturesv1beta1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = seacreaturesv1beta2.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/controllers/ship/cruiser_controller.go b/testdata/project-v2-multigroup/controllers/ship/cruiser_controller.go deleted file mode 100644 index 204c23f7182..00000000000 --- a/testdata/project-v2-multigroup/controllers/ship/cruiser_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v2alpha1" -) - -// CruiserReconciler reconciles a Cruiser object -type CruiserReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=ship.testproject.org,resources=cruisers,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=ship.testproject.org,resources=cruisers/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Cruiser object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *CruiserReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("cruiser", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *CruiserReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&shipv2alpha1.Cruiser{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/ship/destroyer_controller.go b/testdata/project-v2-multigroup/controllers/ship/destroyer_controller.go deleted file mode 100644 index 5d22ad6e5ea..00000000000 --- a/testdata/project-v2-multigroup/controllers/ship/destroyer_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v1" -) - -// DestroyerReconciler reconciles a Destroyer object -type DestroyerReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=ship.testproject.org,resources=destroyers,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=ship.testproject.org,resources=destroyers/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Destroyer object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *DestroyerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("destroyer", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *DestroyerReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&shipv1.Destroyer{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/ship/frigate_controller.go b/testdata/project-v2-multigroup/controllers/ship/frigate_controller.go deleted file mode 100644 index ea90f2a5440..00000000000 --- a/testdata/project-v2-multigroup/controllers/ship/frigate_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v1beta1" -) - -// FrigateReconciler reconciles a Frigate object -type FrigateReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=ship.testproject.org,resources=frigates,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=ship.testproject.org,resources=frigates/status,verbs=get;update;patch - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Frigate object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile -func (r *FrigateReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - _ = context.Background() - _ = r.Log.WithValues("frigate", req.NamespacedName) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *FrigateReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&shipv1beta1.Frigate{}). - Complete(r) -} diff --git a/testdata/project-v2-multigroup/controllers/ship/suite_test.go b/testdata/project-v2-multigroup/controllers/ship/suite_test.go deleted file mode 100644 index 97e047e4210..00000000000 --- a/testdata/project-v2-multigroup/controllers/ship/suite_test.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v1" - shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v1beta1" - shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v2alpha1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).ToNot(HaveOccurred()) - Expect(cfg).ToNot(BeNil()) - - err = shipv1beta1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = shipv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = shipv2alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).ToNot(HaveOccurred()) - Expect(k8sClient).ToNot(BeNil()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).ToNot(HaveOccurred()) -}) diff --git a/testdata/project-v2-multigroup/go.mod b/testdata/project-v2-multigroup/go.mod deleted file mode 100644 index d0ffad76e06..00000000000 --- a/testdata/project-v2-multigroup/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup - -go 1.13 - -require ( - github.com/go-logr/logr v0.1.0 - github.com/onsi/ginkgo v1.12.1 - github.com/onsi/gomega v1.10.1 - k8s.io/api v0.18.6 - k8s.io/apimachinery v0.18.6 - k8s.io/client-go v0.18.6 - sigs.k8s.io/controller-runtime v0.6.4 -) diff --git a/testdata/project-v2-multigroup/hack/boilerplate.go.txt b/testdata/project-v2-multigroup/hack/boilerplate.go.txt deleted file mode 100644 index b54e305f300..00000000000 --- a/testdata/project-v2-multigroup/hack/boilerplate.go.txt +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ \ No newline at end of file diff --git a/testdata/project-v2-multigroup/main.go b/testdata/project-v2-multigroup/main.go deleted file mode 100644 index 61478e2f292..00000000000 --- a/testdata/project-v2-multigroup/main.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "os" - - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/crew/v1" - fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/fiz/v1" - foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/foo.policy/v1" - foov1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/foo/v1" - seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/sea-creatures/v1beta1" - seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/sea-creatures/v1beta2" - shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v1" - shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v1beta1" - shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/apis/ship/v2alpha1" - appscontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/apps" - crewcontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/crew" - fizcontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/fiz" - foocontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/foo" - foopolicycontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/foo.policy" - seacreaturescontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/sea-creatures" - shipcontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/ship" - //+kubebuilder:scaffold:imports -) - -var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") -) - -func init() { - utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - - utilruntime.Must(crewv1.AddToScheme(scheme)) - utilruntime.Must(shipv1beta1.AddToScheme(scheme)) - utilruntime.Must(shipv1.AddToScheme(scheme)) - utilruntime.Must(shipv2alpha1.AddToScheme(scheme)) - utilruntime.Must(seacreaturesv1beta1.AddToScheme(scheme)) - utilruntime.Must(seacreaturesv1beta2.AddToScheme(scheme)) - utilruntime.Must(foopolicyv1.AddToScheme(scheme)) - utilruntime.Must(foov1.AddToScheme(scheme)) - utilruntime.Must(fizv1.AddToScheme(scheme)) - //+kubebuilder:scaffold:scheme -} - -func main() { - var metricsAddr string - var enableLeaderElection bool - flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, - "Enable leader election for controller manager. "+ - "Enabling this will ensure there is only one active controller manager.") - flag.Parse() - - ctrl.SetLogger(zap.New(zap.UseDevMode(true))) - - mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ - Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, - LeaderElection: enableLeaderElection, - LeaderElectionID: "e9b53b87.testproject.org", - }) - if err != nil { - setupLog.Error(err, "unable to start manager") - os.Exit(1) - } - - if err = (&crewcontroller.CaptainReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Captain"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Captain") - os.Exit(1) - } - if err = (&crewv1.Captain{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "Captain") - os.Exit(1) - } - if err = (&shipcontroller.FrigateReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Frigate"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Frigate") - os.Exit(1) - } - if err = (&shipv1beta1.Frigate{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "Frigate") - os.Exit(1) - } - if err = (&shipcontroller.DestroyerReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Destroyer"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Destroyer") - os.Exit(1) - } - if err = (&shipv1.Destroyer{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "Destroyer") - os.Exit(1) - } - if err = (&shipcontroller.CruiserReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Cruiser"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Cruiser") - os.Exit(1) - } - if err = (&shipv2alpha1.Cruiser{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "Cruiser") - os.Exit(1) - } - if err = (&seacreaturescontroller.KrakenReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Kraken"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Kraken") - os.Exit(1) - } - if err = (&seacreaturescontroller.LeviathanReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Leviathan"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Leviathan") - os.Exit(1) - } - if err = (&foopolicycontroller.HealthCheckPolicyReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("HealthCheckPolicy"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "HealthCheckPolicy") - os.Exit(1) - } - if err = (&appscontroller.DeploymentReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Deployment"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Deployment") - os.Exit(1) - } - if err = (&foocontroller.BarReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Bar"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Bar") - os.Exit(1) - } - if err = (&fizcontroller.BarReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("Bar"), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Bar") - os.Exit(1) - } - //+kubebuilder:scaffold:builder - - setupLog.Info("starting manager") - if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { - setupLog.Error(err, "problem running manager") - os.Exit(1) - } -} diff --git a/testdata/project-v3-v1beta1/.dockerignore b/testdata/project-v3-v1beta1/.dockerignore deleted file mode 100644 index 0f046820f18..00000000000 --- a/testdata/project-v3-v1beta1/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file -# Ignore build and test binaries. -bin/ -testbin/ diff --git a/testdata/project-v3-v1beta1/.gitignore b/testdata/project-v3-v1beta1/.gitignore deleted file mode 100644 index c0a7a54cac5..00000000000 --- a/testdata/project-v3-v1beta1/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ - -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -bin -testbin/* - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Kubernetes Generated files - skip generated files, except for vendored files - -!vendor/**/zz_generated.* - -# editor and IDE paraphernalia -.idea -*.swp -*.swo -*~ diff --git a/testdata/project-v3-v1beta1/Dockerfile b/testdata/project-v3-v1beta1/Dockerfile deleted file mode 100644 index 5a355c21489..00000000000 --- a/testdata/project-v3-v1beta1/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Build the manager binary -FROM golang:1.18 as builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY main.go main.go -COPY api/ api/ -COPY controllers/ controllers/ - -# Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go - -# Use distroless as minimal base image to package the manager binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot -WORKDIR / -COPY --from=builder /workspace/manager . -USER 65532:65532 - -ENTRYPOINT ["/manager"] diff --git a/testdata/project-v3-v1beta1/Makefile b/testdata/project-v3-v1beta1/Makefile deleted file mode 100644 index fc483bd85a4..00000000000 --- a/testdata/project-v3-v1beta1/Makefile +++ /dev/null @@ -1,135 +0,0 @@ - -# Image URL to use all building/pushing image targets -IMG ?= controller:latest -# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.21 - -# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) -ifeq (,$(shell go env GOBIN)) -GOBIN=$(shell go env GOPATH)/bin -else -GOBIN=$(shell go env GOBIN) -endif - -# Setting SHELL to bash allows bash commands to be executed by recipes. -# This is a requirement for 'setup-envtest.sh' in the test target. -# Options are set to exit when a recipe line exits non-zero or a piped command fails. -SHELL = /usr/bin/env bash -o pipefail -.SHELLFLAGS = -ec - -.PHONY: all -all: build - -##@ General - -# The help target prints out all targets with their descriptions organized -# beneath their categories. The categories are represented by '##@' and the -# target descriptions by '##'. The awk commands is responsible for reading the -# entire set of makefiles included in this invocation, looking for lines of the -# file as xyz: ## something, and then pretty-format the target and help. Then, -# if there's a line with ##@ something, that gets pretty-printed as a category. -# More info on the usage of ANSI control characters for terminal formatting: -# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters -# More info on the awk command: -# http://linuxcommand.org/lc3_adv_awk.php - -.PHONY: help -help: ## Display this help. - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) - -##@ Development - -.PHONY: manifests -# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) -CRD_OPTIONS ?= "crd:crdVersions={v1beta1},trivialVersions=true,preserveUnknownFields=false" -manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases - -.PHONY: generate -generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. - $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." - -.PHONY: fmt -fmt: ## Run go fmt against code. - go fmt ./... - -.PHONY: vet -vet: ## Run go vet against code. - go vet ./... - -.PHONY: test -test: manifests generate fmt vet envtest ## Run tests. - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out - -##@ Build - -.PHONY: build -build: generate fmt vet ## Build manager binary. - go build -o bin/manager main.go - -.PHONY: run -run: manifests generate fmt vet ## Run a controller from your host. - go run ./main.go - -.PHONY: docker-build -docker-build: test ## Build docker image with the manager. - docker build -t ${IMG} . - -.PHONY: docker-push -docker-push: ## Push docker image with the manager. - docker push ${IMG} - -##@ Deployment - -ifndef ignore-not-found - ignore-not-found = false -endif - -.PHONY: install -install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl apply -f - - -.PHONY: uninstall -uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - - -.PHONY: deploy -deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - $(KUSTOMIZE) build config/default | kubectl apply -f - - -.PHONY: undeploy -undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - - -##@ Build Dependencies - -## Location to install dependencies to -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): - mkdir -p $(LOCALBIN) - -## Tool Binaries -KUSTOMIZE ?= $(LOCALBIN)/kustomize -CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen -ENVTEST ?= $(LOCALBIN)/setup-envtest - -## Tool Versions -KUSTOMIZE_VERSION ?= v3.8.7 -CONTROLLER_TOOLS_VERSION ?= v0.6.2 - -KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" -.PHONY: kustomize -kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. -$(KUSTOMIZE): $(LOCALBIN) - curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN) - -.PHONY: controller-gen -controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. -$(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) - -.PHONY: envtest -envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. -$(ENVTEST): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v3-v1beta1/PROJECT b/testdata/project-v3-v1beta1/PROJECT deleted file mode 100644 index 8d476bc06b0..00000000000 --- a/testdata/project-v3-v1beta1/PROJECT +++ /dev/null @@ -1,18 +0,0 @@ -domain: testproject.org -layout: -- go.kubebuilder.io/v3 -projectName: project-v3-v1beta1 -repo: sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1 -resources: -- api: - crdVersion: v1beta1 - controller: true - domain: testproject.org - group: crew - kind: Admiral - path: sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1/api/v1 - version: v1 - webhooks: - defaulting: true - webhookVersion: v1beta1 -version: "3" diff --git a/testdata/project-v3-v1beta1/README.md b/testdata/project-v3-v1beta1/README.md deleted file mode 100644 index 160a76fb75c..00000000000 --- a/testdata/project-v3-v1beta1/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# project-v3-v1beta1 -// TODO(user): Add simple overview of use/purpose - -## Description -// TODO(user): An in-depth paragraph about your project and overview of use - -## Getting Started -You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). - -### Running on the cluster -1. Install Instances of Custom Resources: - -```sh -kubectl apply -f config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: - -```sh -make docker-build docker-push IMG=/project-v3-v1beta1:tag -``` - -3. Deploy the controller to the cluster with the image specified by `IMG`: - -```sh -make deploy IMG=/project-v3-v1beta1:tag -``` - -### Uninstall CRDs -To delete the CRDs from the cluster: - -```sh -make uninstall -``` - -### Undeploy controller -UnDeploy the controller to the cluster: - -```sh -make undeploy -``` - -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) - -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/) -which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster - -### Test It Out -1. Install the CRDs into the cluster: - -```sh -make install -``` - -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): - -```sh -make run -``` - -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: - -```sh -make manifests -``` - -**NOTE:** Run `make --help` for more information on all potential `make` targets - -More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) - -## License - -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - diff --git a/testdata/project-v3-v1beta1/api/v1/admiral_types.go b/testdata/project-v3-v1beta1/api/v1/admiral_types.go deleted file mode 100644 index 55d2b767089..00000000000 --- a/testdata/project-v3-v1beta1/api/v1/admiral_types.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// AdmiralSpec defines the desired state of Admiral -type AdmiralSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Foo is an example field of Admiral. Edit admiral_types.go to remove/update - Foo string `json:"foo,omitempty"` -} - -// AdmiralStatus defines the observed state of Admiral -type AdmiralStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status -//+kubebuilder:resource:scope=Cluster - -// Admiral is the Schema for the admirals API -type Admiral struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AdmiralSpec `json:"spec,omitempty"` - Status AdmiralStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// AdmiralList contains a list of Admiral -type AdmiralList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Admiral `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Admiral{}, &AdmiralList{}) -} diff --git a/testdata/project-v3-v1beta1/api/v1/admiral_webhook.go b/testdata/project-v3-v1beta1/api/v1/admiral_webhook.go deleted file mode 100644 index 6e71c3f8a62..00000000000 --- a/testdata/project-v3-v1beta1/api/v1/admiral_webhook.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var admirallog = logf.Log.WithName("admiral-resource") - -func (r *Admiral) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! - -//+kubebuilder:webhook:webhookVersions={v1beta1},path=/mutate-crew-testproject-org-v1-admiral,mutating=true,failurePolicy=fail,sideEffects=None,groups=crew.testproject.org,resources=admirals,verbs=create;update,versions=v1,name=madmiral.kb.io,admissionReviewVersions={v1,v1beta1} - -var _ webhook.Defaulter = &Admiral{} - -// Default implements webhook.Defaulter so a webhook will be registered for the type -func (r *Admiral) Default() { - admirallog.Info("default", "name", r.Name) - - // TODO(user): fill in your defaulting logic. -} diff --git a/testdata/project-v3-v1beta1/api/v1/groupversion_info.go b/testdata/project-v3-v1beta1/api/v1/groupversion_info.go deleted file mode 100644 index 33458c7506e..00000000000 --- a/testdata/project-v3-v1beta1/api/v1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1 contains API Schema definitions for the crew v1 API group -//+kubebuilder:object:generate=true -//+groupName=crew.testproject.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "crew.testproject.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/testdata/project-v3-v1beta1/api/v1/webhook_suite_test.go b/testdata/project-v3-v1beta1/api/v1/webhook_suite_test.go deleted file mode 100644 index d1518569e92..00000000000 --- a/testdata/project-v3-v1beta1/api/v1/webhook_suite_test.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - "crypto/tls" - "fmt" - "net" - "path/filepath" - "testing" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - admissionv1beta1 "k8s.io/api/admission/v1beta1" - //+kubebuilder:scaffold:imports - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/rest" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment -var ctx context.Context -var cancel context.CancelFunc - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Webhook Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - ctx, cancel = context.WithCancel(context.TODO()) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - ErrorIfCRDPathMissing: false, - WebhookInstallOptions: envtest.WebhookInstallOptions{ - Paths: []string{filepath.Join("..", "..", "config", "webhook")}, - }, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) - - scheme := runtime.NewScheme() - err = AddToScheme(scheme) - Expect(err).NotTo(HaveOccurred()) - - err = admissionv1beta1.AddToScheme(scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme}) - Expect(err).NotTo(HaveOccurred()) - Expect(k8sClient).NotTo(BeNil()) - - // start webhook server using Manager - webhookInstallOptions := &testEnv.WebhookInstallOptions - mgr, err := ctrl.NewManager(cfg, ctrl.Options{ - Scheme: scheme, - Host: webhookInstallOptions.LocalServingHost, - Port: webhookInstallOptions.LocalServingPort, - CertDir: webhookInstallOptions.LocalServingCertDir, - LeaderElection: false, - MetricsBindAddress: "0", - }) - Expect(err).NotTo(HaveOccurred()) - - err = (&Admiral{}).SetupWebhookWithManager(mgr) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:webhook - - go func() { - defer GinkgoRecover() - err = mgr.Start(ctx) - Expect(err).NotTo(HaveOccurred()) - }() - - // wait for the webhook server to get ready - dialer := &net.Dialer{Timeout: time.Second} - addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort) - Eventually(func() error { - conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true}) - if err != nil { - return err - } - conn.Close() - return nil - }).Should(Succeed()) - -}, 60) - -var _ = AfterSuite(func() { - cancel() - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/testdata/project-v3-v1beta1/api/v1/zz_generated.deepcopy.go b/testdata/project-v3-v1beta1/api/v1/zz_generated.deepcopy.go deleted file mode 100644 index c51d9c3130f..00000000000 --- a/testdata/project-v3-v1beta1/api/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Admiral) DeepCopyInto(out *Admiral) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Admiral. -func (in *Admiral) DeepCopy() *Admiral { - if in == nil { - return nil - } - out := new(Admiral) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Admiral) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdmiralList) DeepCopyInto(out *AdmiralList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Admiral, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralList. -func (in *AdmiralList) DeepCopy() *AdmiralList { - if in == nil { - return nil - } - out := new(AdmiralList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdmiralList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdmiralSpec) DeepCopyInto(out *AdmiralSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralSpec. -func (in *AdmiralSpec) DeepCopy() *AdmiralSpec { - if in == nil { - return nil - } - out := new(AdmiralSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdmiralStatus) DeepCopyInto(out *AdmiralStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralStatus. -func (in *AdmiralStatus) DeepCopy() *AdmiralStatus { - if in == nil { - return nil - } - out := new(AdmiralStatus) - in.DeepCopyInto(out) - return out -} diff --git a/testdata/project-v3-v1beta1/config/certmanager/certificate.yaml b/testdata/project-v3-v1beta1/config/certmanager/certificate.yaml deleted file mode 100644 index 52d866183c7..00000000000 --- a/testdata/project-v3-v1beta1/config/certmanager/certificate.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# The following manifests contain a self-signed issuer CR and a certificate CR. -# More document can be found at https://docs.cert-manager.io -# WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes. -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: selfsigned-issuer - namespace: system -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml - namespace: system -spec: - # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize - dnsNames: - - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc - - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local - issuerRef: - kind: Issuer - name: selfsigned-issuer - secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize diff --git a/testdata/project-v3-v1beta1/config/certmanager/kustomization.yaml b/testdata/project-v3-v1beta1/config/certmanager/kustomization.yaml deleted file mode 100644 index bebea5a595e..00000000000 --- a/testdata/project-v3-v1beta1/config/certmanager/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -resources: -- certificate.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v3-v1beta1/config/certmanager/kustomizeconfig.yaml b/testdata/project-v3-v1beta1/config/certmanager/kustomizeconfig.yaml deleted file mode 100644 index 90d7c313ca1..00000000000 --- a/testdata/project-v3-v1beta1/config/certmanager/kustomizeconfig.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# This configuration is for teaching kustomize how to update name ref and var substitution -nameReference: -- kind: Issuer - group: cert-manager.io - fieldSpecs: - - kind: Certificate - group: cert-manager.io - path: spec/issuerRef/name - -varReference: -- kind: Certificate - group: cert-manager.io - path: spec/commonName -- kind: Certificate - group: cert-manager.io - path: spec/dnsNames diff --git a/testdata/project-v3-v1beta1/config/crd/bases/crew.testproject.org_admirals.yaml b/testdata/project-v3-v1beta1/config/crd/bases/crew.testproject.org_admirals.yaml deleted file mode 100644 index f6723487fdc..00000000000 --- a/testdata/project-v3-v1beta1/config/crd/bases/crew.testproject.org_admirals.yaml +++ /dev/null @@ -1,59 +0,0 @@ - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.6.2 - creationTimestamp: null - name: admirals.crew.testproject.org -spec: - group: crew.testproject.org - names: - kind: Admiral - listKind: AdmiralList - plural: admirals - singular: admiral - preserveUnknownFields: false - scope: Cluster - subresources: - status: {} - validation: - openAPIV3Schema: - description: Admiral is the Schema for the admirals API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: AdmiralSpec defines the desired state of Admiral - properties: - foo: - description: Foo is an example field of Admiral. Edit admiral_types.go - to remove/update - type: string - type: object - status: - description: AdmiralStatus defines the observed state of Admiral - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/testdata/project-v3-v1beta1/config/crd/kustomization.yaml b/testdata/project-v3-v1beta1/config/crd/kustomization.yaml deleted file mode 100644 index f1c9cc731ec..00000000000 --- a/testdata/project-v3-v1beta1/config/crd/kustomization.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default -resources: -- bases/crew.testproject.org_admirals.yaml -#+kubebuilder:scaffold:crdkustomizeresource - -patchesStrategicMerge: -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. -# patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_admirals.yaml -#+kubebuilder:scaffold:crdkustomizewebhookpatch - -# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. -# patches here are for enabling the CA injection for each CRD -#- patches/cainjection_in_admirals.yaml -#+kubebuilder:scaffold:crdkustomizecainjectionpatch - -# the following config is for teaching kustomize how to do kustomization for CRDs. -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v3-v1beta1/config/crd/kustomizeconfig.yaml b/testdata/project-v3-v1beta1/config/crd/kustomizeconfig.yaml deleted file mode 100644 index bcebe0475b2..00000000000 --- a/testdata/project-v3-v1beta1/config/crd/kustomizeconfig.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is for teaching kustomize how to substitute name and namespace reference in CRD -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: CustomResourceDefinition - version: v1beta1 - group: apiextensions.k8s.io - path: spec/conversion/webhookClientConfig/service/name - -namespace: -- kind: CustomResourceDefinition - version: v1beta1 - group: apiextensions.k8s.io - path: spec/conversion/webhookClientConfig/service/namespace - create: false - -varReference: -- path: metadata/annotations diff --git a/testdata/project-v3-v1beta1/config/crd/patches/cainjection_in_admirals.yaml b/testdata/project-v3-v1beta1/config/crd/patches/cainjection_in_admirals.yaml deleted file mode 100644 index 8573317f652..00000000000 --- a/testdata/project-v3-v1beta1/config/crd/patches/cainjection_in_admirals.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: admirals.crew.testproject.org diff --git a/testdata/project-v3-v1beta1/config/crd/patches/webhook_in_admirals.yaml b/testdata/project-v3-v1beta1/config/crd/patches/webhook_in_admirals.yaml deleted file mode 100644 index 90ac1c591d2..00000000000 --- a/testdata/project-v3-v1beta1/config/crd/patches/webhook_in_admirals.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: admirals.crew.testproject.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - service: - namespace: system - name: webhook-service - path: /convert diff --git a/testdata/project-v3-v1beta1/config/default/kustomization.yaml b/testdata/project-v3-v1beta1/config/default/kustomization.yaml deleted file mode 100644 index f25187cb05a..00000000000 --- a/testdata/project-v3-v1beta1/config/default/kustomization.yaml +++ /dev/null @@ -1,74 +0,0 @@ -# Adds namespace to all resources. -namespace: project-v3-v1beta1-system - -# Value of this field is prepended to the -# names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". -# Note that it should also match with the prefix (text before '-') of the namespace -# field above. -namePrefix: project-v3-v1beta1- - -# Labels to add to all resources and selectors. -#commonLabels: -# someName: someValue - -bases: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus - -patchesStrategicMerge: -# Protect the /metrics endpoint by putting it behind auth. -# If you want your controller-manager to expose the /metrics -# endpoint w/o any authn/z, please comment the following line. -- manager_auth_proxy_patch.yaml - -# Mount the controller config file for loading manager configurations -# through a ComponentConfig type -#- manager_config_patch.yaml - -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- manager_webhook_patch.yaml - -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. -# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. -# 'CERTMANAGER' needs to be enabled to use ca injection -#- webhookcainjection_patch.yaml - -# the following config is for teaching kustomize how to do var substitution -vars: -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldref: -# fieldpath: metadata.namespace -#- name: CERTIFICATE_NAME -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -#- name: SERVICE_NAMESPACE # namespace of the service -# objref: -# kind: Service -# version: v1 -# name: webhook-service -# fieldref: -# fieldpath: metadata.namespace -#- name: SERVICE_NAME -# objref: -# kind: Service -# version: v1 -# name: webhook-service diff --git a/testdata/project-v3-v1beta1/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v3-v1beta1/config/default/manager_auth_proxy_patch.yaml deleted file mode 100644 index bf7ce9de7a0..00000000000 --- a/testdata/project-v3-v1beta1/config/default/manager_auth_proxy_patch.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# This patch inject a sidecar container which is a HTTP proxy for the -# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: kube-rbac-proxy - securityContext: - allowPrivilegeEscalation: false - # TODO(user): uncomment for common cases that do not require escalating privileges - # capabilities: - # drop: - # - "ALL" - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0 - args: - - "--secure-listen-address=0.0.0.0:8443" - - "--upstream=http://127.0.0.1:8080/" - - "--logtostderr=true" - - "--v=0" - ports: - - containerPort: 8443 - protocol: TCP - name: https - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 5m - memory: 64Mi - - name: manager - args: - - "--health-probe-bind-address=:8081" - - "--metrics-bind-address=127.0.0.1:8080" - - "--leader-elect" diff --git a/testdata/project-v3-v1beta1/config/default/manager_config_patch.yaml b/testdata/project-v3-v1beta1/config/default/manager_config_patch.yaml deleted file mode 100644 index 6c400155cfb..00000000000 --- a/testdata/project-v3-v1beta1/config/default/manager_config_patch.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager - args: - - "--config=controller_manager_config.yaml" - volumeMounts: - - name: manager-config - mountPath: /controller_manager_config.yaml - subPath: controller_manager_config.yaml - volumes: - - name: manager-config - configMap: - name: manager-config diff --git a/testdata/project-v3-v1beta1/config/default/manager_webhook_patch.yaml b/testdata/project-v3-v1beta1/config/default/manager_webhook_patch.yaml deleted file mode 100644 index 738de350b71..00000000000 --- a/testdata/project-v3-v1beta1/config/default/manager_webhook_patch.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager - ports: - - containerPort: 9443 - name: webhook-server - protocol: TCP - volumeMounts: - - mountPath: /tmp/k8s-webhook-server/serving-certs - name: cert - readOnly: true - volumes: - - name: cert - secret: - defaultMode: 420 - secretName: webhook-server-cert diff --git a/testdata/project-v3-v1beta1/config/default/webhookcainjection_patch.yaml b/testdata/project-v3-v1beta1/config/default/webhookcainjection_patch.yaml deleted file mode 100644 index 7e79bf9955a..00000000000 --- a/testdata/project-v3-v1beta1/config/default/webhookcainjection_patch.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# This patch add annotation to admission webhook config and -# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: MutatingWebhookConfiguration -metadata: - name: mutating-webhook-configuration - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) ---- -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: ValidatingWebhookConfiguration -metadata: - name: validating-webhook-configuration - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) diff --git a/testdata/project-v3-v1beta1/config/manager/controller_manager_config.yaml b/testdata/project-v3-v1beta1/config/manager/controller_manager_config.yaml deleted file mode 100644 index 77d68fa1ad5..00000000000 --- a/testdata/project-v3-v1beta1/config/manager/controller_manager_config.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 -kind: ControllerManagerConfig -health: - healthProbeBindAddress: :8081 -metrics: - bindAddress: 127.0.0.1:8080 -webhook: - port: 9443 -leaderElection: - leaderElect: true - resourceName: 2eab85d8.testproject.org -# leaderElectionReleaseOnCancel defines if the leader should step down volume -# when the Manager ends. This requires the binary to immediately end when the -# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly -# speeds up voluntary leader transitions as the new leader don't have to wait -# LeaseDuration time first. -# In the default scaffold provided, the program ends immediately after -# the manager stops, so would be fine to enable this option. However, -# if you are doing or is intended to do any operation such as perform cleanups -# after the manager stops then its usage might be unsafe. -# leaderElectionReleaseOnCancel: true diff --git a/testdata/project-v3-v1beta1/config/manager/kustomization.yaml b/testdata/project-v3-v1beta1/config/manager/kustomization.yaml deleted file mode 100644 index 2bcd3eeaa94..00000000000 --- a/testdata/project-v3-v1beta1/config/manager/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ -resources: -- manager.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: manager-config - files: - - controller_manager_config.yaml diff --git a/testdata/project-v3-v1beta1/config/manager/manager.yaml b/testdata/project-v3-v1beta1/config/manager/manager.yaml deleted file mode 100644 index 7874768e5fb..00000000000 --- a/testdata/project-v3-v1beta1/config/manager/manager.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - labels: - control-plane: controller-manager - name: system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system - labels: - control-plane: controller-manager -spec: - selector: - matchLabels: - control-plane: controller-manager - replicas: 1 - template: - metadata: - annotations: - kubectl.kubernetes.io/default-container: manager - labels: - control-plane: controller-manager - spec: - securityContext: - runAsNonRoot: true - # TODO(user): For common cases that do not require escalating privileges - # it is recommended to ensure that all your Pods/Containers are restrictive. - # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted - # Please uncomment the following code if your project does NOT have to work on old Kubernetes - # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ). - # seccompProfile: - # type: RuntimeDefault - containers: - - command: - - /manager - args: - - --leader-elect - image: controller:latest - name: manager - securityContext: - allowPrivilegeEscalation: false - # TODO(user): uncomment for common cases that do not require escalating privileges - # capabilities: - # drop: - # - "ALL" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi - serviceAccountName: controller-manager - terminationGracePeriodSeconds: 10 diff --git a/testdata/project-v3-v1beta1/config/prometheus/kustomization.yaml b/testdata/project-v3-v1beta1/config/prometheus/kustomization.yaml deleted file mode 100644 index ed137168a1d..00000000000 --- a/testdata/project-v3-v1beta1/config/prometheus/kustomization.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resources: -- monitor.yaml diff --git a/testdata/project-v3-v1beta1/config/prometheus/monitor.yaml b/testdata/project-v3-v1beta1/config/prometheus/monitor.yaml deleted file mode 100644 index d19136ae710..00000000000 --- a/testdata/project-v3-v1beta1/config/prometheus/monitor.yaml +++ /dev/null @@ -1,20 +0,0 @@ - -# Prometheus Monitor Service (Metrics) -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-monitor - namespace: system -spec: - endpoints: - - path: /metrics - port: https - scheme: https - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - tlsConfig: - insecureSkipVerify: true - selector: - matchLabels: - control-plane: controller-manager diff --git a/testdata/project-v3-v1beta1/config/rbac/admiral_editor_role.yaml b/testdata/project-v3-v1beta1/config/rbac/admiral_editor_role.yaml deleted file mode 100644 index 7f2cc5cd99f..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/admiral_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit admirals. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: admiral-editor-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - admirals - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - admirals/status - verbs: - - get diff --git a/testdata/project-v3-v1beta1/config/rbac/admiral_viewer_role.yaml b/testdata/project-v3-v1beta1/config/rbac/admiral_viewer_role.yaml deleted file mode 100644 index ddbb0c2a85b..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/admiral_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view admirals. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: admiral-viewer-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - admirals - verbs: - - get - - list - - watch -- apiGroups: - - crew.testproject.org - resources: - - admirals/status - verbs: - - get diff --git a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v3-v1beta1/config/rbac/auth_proxy_client_clusterrole.yaml deleted file mode 100644 index 51a75db47a5..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_client_clusterrole.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: metrics-reader -rules: -- nonResourceURLs: - - "/metrics" - verbs: - - get diff --git a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_role.yaml b/testdata/project-v3-v1beta1/config/rbac/auth_proxy_role.yaml deleted file mode 100644 index 80e1857c594..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_role.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: proxy-role -rules: -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create diff --git a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v3-v1beta1/config/rbac/auth_proxy_role_binding.yaml deleted file mode 100644 index ec7acc0a1b7..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: proxy-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: proxy-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system diff --git a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_service.yaml b/testdata/project-v3-v1beta1/config/rbac/auth_proxy_service.yaml deleted file mode 100644 index 71f1797279e..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/auth_proxy_service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-service - namespace: system -spec: - ports: - - name: https - port: 8443 - protocol: TCP - targetPort: https - selector: - control-plane: controller-manager diff --git a/testdata/project-v3-v1beta1/config/rbac/kustomization.yaml b/testdata/project-v3-v1beta1/config/rbac/kustomization.yaml deleted file mode 100644 index 731832a6ac3..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -# All RBAC will be applied under this service account in -# the deployment namespace. You may comment out this resource -# if your manager will use a service account that exists at -# runtime. Be sure to update RoleBinding and ClusterRoleBinding -# subjects if changing service account names. -- service_account.yaml -- role.yaml -- role_binding.yaml -- leader_election_role.yaml -- leader_election_role_binding.yaml -# Comment the following 4 lines if you want to disable -# the auth proxy (https://github.com/brancz/kube-rbac-proxy) -# which protects your /metrics endpoint. -- auth_proxy_service.yaml -- auth_proxy_role.yaml -- auth_proxy_role_binding.yaml -- auth_proxy_client_clusterrole.yaml diff --git a/testdata/project-v3-v1beta1/config/rbac/leader_election_role.yaml b/testdata/project-v3-v1beta1/config/rbac/leader_election_role.yaml deleted file mode 100644 index 4190ec8059e..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/leader_election_role.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# permissions to do leader election. -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: leader-election-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/testdata/project-v3-v1beta1/config/rbac/leader_election_role_binding.yaml b/testdata/project-v3-v1beta1/config/rbac/leader_election_role_binding.yaml deleted file mode 100644 index 1d1321ed4f0..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/leader_election_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: leader-election-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: leader-election-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system diff --git a/testdata/project-v3-v1beta1/config/rbac/role.yaml b/testdata/project-v3-v1beta1/config/rbac/role.yaml deleted file mode 100644 index 45370a113eb..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/role.yaml +++ /dev/null @@ -1,34 +0,0 @@ - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: manager-role -rules: -- apiGroups: - - crew.testproject.org - resources: - - admirals - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - crew.testproject.org - resources: - - admirals/finalizers - verbs: - - update -- apiGroups: - - crew.testproject.org - resources: - - admirals/status - verbs: - - get - - patch - - update diff --git a/testdata/project-v3-v1beta1/config/rbac/role_binding.yaml b/testdata/project-v3-v1beta1/config/rbac/role_binding.yaml deleted file mode 100644 index 2070ede4462..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: manager-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: manager-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system diff --git a/testdata/project-v3-v1beta1/config/rbac/service_account.yaml b/testdata/project-v3-v1beta1/config/rbac/service_account.yaml deleted file mode 100644 index 7cd6025bfc4..00000000000 --- a/testdata/project-v3-v1beta1/config/rbac/service_account.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: controller-manager - namespace: system diff --git a/testdata/project-v3-v1beta1/config/samples/crew_v1_admiral.yaml b/testdata/project-v3-v1beta1/config/samples/crew_v1_admiral.yaml deleted file mode 100644 index 588448f7801..00000000000 --- a/testdata/project-v3-v1beta1/config/samples/crew_v1_admiral.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: crew.testproject.org/v1 -kind: Admiral -metadata: - name: admiral-sample -spec: - # TODO(user): Add fields here diff --git a/testdata/project-v3-v1beta1/config/webhook/kustomization.yaml b/testdata/project-v3-v1beta1/config/webhook/kustomization.yaml deleted file mode 100644 index c9c56a61a65..00000000000 --- a/testdata/project-v3-v1beta1/config/webhook/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -resources: -- manifests.v1beta1.yaml -- service.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/testdata/project-v3-v1beta1/config/webhook/kustomizeconfig.yaml b/testdata/project-v3-v1beta1/config/webhook/kustomizeconfig.yaml deleted file mode 100644 index 25e21e3c963..00000000000 --- a/testdata/project-v3-v1beta1/config/webhook/kustomizeconfig.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# the following config is for teaching kustomize where to look at when substituting vars. -# It requires kustomize v2.1.0 or newer to work properly. -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - - kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - -namespace: -- kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true -- kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true - -varReference: -- path: metadata/annotations diff --git a/testdata/project-v3-v1beta1/config/webhook/manifests.v1beta1.yaml b/testdata/project-v3-v1beta1/config/webhook/manifests.v1beta1.yaml deleted file mode 100644 index 85773a244c3..00000000000 --- a/testdata/project-v3-v1beta1/config/webhook/manifests.v1beta1.yaml +++ /dev/null @@ -1,29 +0,0 @@ - ---- -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: MutatingWebhookConfiguration -metadata: - creationTimestamp: null - name: mutating-webhook-configuration -webhooks: -- admissionReviewVersions: - - v1 - - v1beta1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /mutate-crew-testproject-org-v1-admiral - failurePolicy: Fail - name: madmiral.kb.io - rules: - - apiGroups: - - crew.testproject.org - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - admirals - sideEffects: None diff --git a/testdata/project-v3-v1beta1/config/webhook/service.yaml b/testdata/project-v3-v1beta1/config/webhook/service.yaml deleted file mode 100644 index 3f638bd9c68..00000000000 --- a/testdata/project-v3-v1beta1/config/webhook/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ - -apiVersion: v1 -kind: Service -metadata: - name: webhook-service - namespace: system -spec: - ports: - - port: 443 - protocol: TCP - targetPort: 9443 - selector: - control-plane: controller-manager diff --git a/testdata/project-v3-v1beta1/controllers/admiral_controller.go b/testdata/project-v3-v1beta1/controllers/admiral_controller.go deleted file mode 100644 index e23fb30f400..00000000000 --- a/testdata/project-v3-v1beta1/controllers/admiral_controller.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1/api/v1" -) - -// AdmiralReconciler reconciles a Admiral object -type AdmiralReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Admiral object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.1/pkg/reconcile -func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = log.FromContext(ctx) - - // TODO(user): your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *AdmiralReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&crewv1.Admiral{}). - Complete(r) -} diff --git a/testdata/project-v3-v1beta1/controllers/suite_test.go b/testdata/project-v3-v1beta1/controllers/suite_test.go deleted file mode 100644 index ae2a422328b..00000000000 --- a/testdata/project-v3-v1beta1/controllers/suite_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1/api/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, - ErrorIfCRDPathMissing: true, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) - - err = crewv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).NotTo(HaveOccurred()) - Expect(k8sClient).NotTo(BeNil()) - -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/testdata/project-v3-v1beta1/go.mod b/testdata/project-v3-v1beta1/go.mod deleted file mode 100644 index f52a4b61cb7..00000000000 --- a/testdata/project-v3-v1beta1/go.mod +++ /dev/null @@ -1,74 +0,0 @@ -module sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1 - -go 1.18 - -require ( - github.com/onsi/ginkgo v1.16.4 - github.com/onsi/gomega v1.13.0 - k8s.io/api v0.21.2 - k8s.io/apimachinery v0.21.2 - k8s.io/client-go v0.21.2 - sigs.k8s.io/controller-runtime v0.9.2 -) - -require ( - cloud.google.com/go v0.54.0 // indirect - github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest v0.11.12 // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect - github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect - github.com/Azure/go-autorest/logger v0.2.0 // indirect - github.com/Azure/go-autorest/tracing v0.6.0 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.11.0+incompatible // indirect - github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/go-logr/logr v0.4.0 // indirect - github.com/go-logr/zapr v0.4.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.5 // indirect - github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/json-iterator/go v1.1.11 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/nxadm/tail v1.4.8 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.11.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.17.0 // indirect - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect - golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect - golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect - golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect - golang.org/x/text v0.3.6 // indirect - golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.26.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/apiextensions-apiserver v0.21.2 // indirect - k8s.io/component-base v0.21.2 // indirect - k8s.io/klog/v2 v2.8.0 // indirect - k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect - k8s.io/utils v0.0.0-20210527160623-6fdb442a123b // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect -) diff --git a/testdata/project-v3-v1beta1/hack/boilerplate.go.txt b/testdata/project-v3-v1beta1/hack/boilerplate.go.txt deleted file mode 100644 index b54e305f300..00000000000 --- a/testdata/project-v3-v1beta1/hack/boilerplate.go.txt +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ \ No newline at end of file diff --git a/testdata/project-v3-v1beta1/main.go b/testdata/project-v3-v1beta1/main.go deleted file mode 100644 index 5024e123b1b..00000000000 --- a/testdata/project-v3-v1beta1/main.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2022 The Kubernetes authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "os" - - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that exec-entrypoint and run can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/healthz" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1/api/v1" - "sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1/controllers" - //+kubebuilder:scaffold:imports -) - -var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") -) - -func init() { - utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - - utilruntime.Must(crewv1.AddToScheme(scheme)) - //+kubebuilder:scaffold:scheme -} - -func main() { - var metricsAddr string - var enableLeaderElection bool - var probeAddr string - flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") - flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "leader-elect", false, - "Enable leader election for controller manager. "+ - "Enabling this will ensure there is only one active controller manager.") - opts := zap.Options{ - Development: true, - } - opts.BindFlags(flag.CommandLine) - flag.Parse() - - ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) - - mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ - Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, - HealthProbeBindAddress: probeAddr, - LeaderElection: enableLeaderElection, - LeaderElectionID: "2eab85d8.testproject.org", - // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily - // when the Manager ends. This requires the binary to immediately end when the - // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly - // speeds up voluntary leader transitions as the new leader don't have to wait - // LeaseDuration time first. - // - // In the default scaffold provided, the program ends immediately after - // the manager stops, so would be fine to enable this option. However, - // if you are doing or is intended to do any operation such as perform cleanups - // after the manager stops then its usage might be unsafe. - // LeaderElectionReleaseOnCancel: true, - }) - if err != nil { - setupLog.Error(err, "unable to start manager") - os.Exit(1) - } - - if err = (&controllers.AdmiralReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "Admiral") - os.Exit(1) - } - if err = (&crewv1.Admiral{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "Admiral") - os.Exit(1) - } - //+kubebuilder:scaffold:builder - - if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up health check") - os.Exit(1) - } - if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up ready check") - os.Exit(1) - } - - setupLog.Info("starting manager") - if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { - setupLog.Error(err, "problem running manager") - os.Exit(1) - } -}