From 8e3462546ce86d9ef818f5b40f3938c1e3495879 Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Fri, 3 May 2019 18:56:34 -0700 Subject: [PATCH] Actually move test projects to testdata This performs the move of the actual files that's set up in the previous commit. --- .gitattributes | 2 +- test/data/docs/expected/config-annotated.yaml | 24 -- test/data/docs/expected/config.yaml | 22 -- test/data/docs/expected/includes/_ant.md | 5 - .../docs/expected/includes/_definitions.md | 5 - .../_generated_ant_v1beta1_ant_concept.md | 58 --- .../_generated_bee_v1beta1_insect_concept.md | 59 --- ...enerated_initializer_v1_meta_definition.md | 21 - ...nerated_initializers_v1_meta_definition.md | 22 -- .../_generated_listmeta_v1_meta_definition.md | 23 -- ...generated_objectmeta_v1_meta_definition.md | 38 -- ...rated_ownerreference_v1_meta_definition.md | 26 -- .../_generated_status_v1_meta_definition.md | 28 -- ...enerated_statuscause_v1_meta_definition.md | 23 -- ...erated_statusdetails_v1_meta_definition.md | 26 -- .../_generated_time_v1_meta_definition.md | 20 - .../_generated_wasp_v1beta1_insect_concept.md | 58 --- test/data/docs/expected/includes/_insect.md | 5 - .../docs/expected/includes/_oldversions.md | 5 - test/data/docs/expected/includes/_overview.md | 5 - test/data/docs/expected/manifest.json | 55 --- test/data/resource/expected/crd-expected.yaml | 72 ---- test/e2e/common.go | 73 ---- test/e2e/config.go | 83 ---- test/e2e/doc.go | 18 - test/e2e/e2e.go | 143 ------- test/e2e/e2e_test.go | 85 ----- test/e2e/framework/ginkgowrapper/wrapper.go | 134 ------- test/e2e/framework/test_context.go | 67 ---- test/e2e/framework/util.go | 145 ------- test/internal/e2e/kubebuildertest.go | 236 ------------ test/project/PROJECT | 3 - test/project/pkg/apis/crew/v1/doc.go | 23 -- test/project_v2/Gopkg.toml | 37 -- test/project_v2/PROJECT | 3 - test/project_v2/api/doc.go | 19 - test/project_v2/api/zz_generated.deepcopy.go | 20 - .../config/manager/kustomization.yaml | 17 - .../project_v2/config/rbac/kustomization.yaml | 9 - .../config/webhook/kustomization.yaml | 5 - test/vendor.v1.tgz | 3 - test/vendor.v2.tgz | 3 - .../gopath/src}/project/.gitignore | 0 .../gopath/src}/project/Dockerfile | 6 +- .../gopath/src}/project/Gopkg.toml | 2 +- .../gopath/src}/project/Makefile | 2 +- testdata/gopath/src/project/PROJECT | 3 + .../gopath/src}/project/cmd/manager/main.go | 7 +- .../crds/creatures_v2alpha1_kraken.yaml | 0 .../config/crds/crew_v1_firstmate.yaml | 0 .../policy_v1beta1_healthcheckpolicy.yaml | 0 .../config/crds/ship_v1beta1_frigate.yaml | 0 .../project/config/default/kustomization.yaml | 0 .../default/manager_auth_proxy_patch.yaml | 0 .../config/default/manager_image_patch.yaml | 0 .../manager_prometheus_metrics_patch.yaml | 0 .../project/config/manager/kustomization.yaml | 0 .../src}/project/config/manager/manager.yaml | 0 .../project/config/rbac/auth_proxy_role.yaml | 0 .../config/rbac/auth_proxy_role_binding.yaml | 0 .../config/rbac/auth_proxy_service.yaml | 0 .../project/config/rbac/kustomization.yaml | 0 .../src}/project/config/rbac/rbac_role.yaml | 0 .../config/rbac/rbac_role_binding.yaml | 0 .../samples/creatures_v2alpha1_kraken.yaml | 0 .../config/samples/crew_v1_firstmate.yaml | 0 .../policy_v1beta1_healthcheckpolicy.yaml | 0 .../config/samples/ship_v1beta1_frigate.yaml | 0 .../src}/project/hack/boilerplate.go.txt | 0 .../apis/addtoscheme_creatures_v2alpha1.go | 4 +- .../project/pkg/apis/addtoscheme_crew_v1.go | 4 +- .../pkg/apis/addtoscheme_policy_v1beta1.go | 4 +- .../pkg/apis/addtoscheme_ship_v1beta1.go | 4 +- .../gopath/src}/project/pkg/apis/apis.go | 0 .../src}/project/pkg/apis/creatures/group.go | 0 .../pkg/apis/creatures/v2alpha1/doc.go | 2 +- .../apis/creatures/v2alpha1/kraken_types.go | 0 .../creatures/v2alpha1/kraken_types_test.go | 0 .../pkg/apis/creatures/v2alpha1/register.go | 2 +- .../creatures/v2alpha1/v2alpha1_suite_test.go | 0 .../v2alpha1/zz_generated.deepcopy.go | 0 .../src}/project/pkg/apis/crew/group.go | 0 .../src/project/pkg/apis/crew}/v1/doc.go | 2 +- .../pkg/apis/crew/v1/firstmate_types.go | 0 .../pkg/apis/crew/v1/firstmate_types_test.go | 0 .../src}/project/pkg/apis/crew/v1/register.go | 2 +- .../project/pkg/apis/crew/v1/v1_suite_test.go | 0 .../pkg/apis/crew/v1/zz_generated.deepcopy.go | 0 .../src}/project/pkg/apis/policy/group.go | 0 .../project/pkg/apis/policy/v1beta1/doc.go | 2 +- .../policy/v1beta1/healthcheckpolicy_types.go | 0 .../v1beta1/healthcheckpolicy_types_test.go | 0 .../pkg/apis/policy/v1beta1/register.go | 2 +- .../apis/policy/v1beta1/v1beta1_suite_test.go | 0 .../policy/v1beta1/zz_generated.deepcopy.go | 0 .../src}/project/pkg/apis/ship/group.go | 0 .../src}/project/pkg/apis/ship/v1beta1/doc.go | 2 +- .../pkg/apis/ship/v1beta1/frigate_types.go | 0 .../apis/ship/v1beta1/frigate_types_test.go | 0 .../project/pkg/apis/ship/v1beta1/register.go | 2 +- .../apis/ship/v1beta1/v1beta1_suite_test.go | 0 .../ship/v1beta1/zz_generated.deepcopy.go | 0 .../project/pkg/controller/add_firstmate.go | 2 +- .../project/pkg/controller/add_frigate.go | 2 +- .../pkg/controller/add_healthcheckpolicy.go | 2 +- .../src}/project/pkg/controller/add_kraken.go | 2 +- .../project/pkg/controller/add_namespace.go | 2 +- .../src}/project/pkg/controller/controller.go | 0 .../firstmate/firstmate_controller.go | 3 +- .../firstmate_controller_suite_test.go | 3 +- .../firstmate/firstmate_controller_test.go | 3 +- .../controller/frigate/frigate_controller.go | 3 +- .../frigate/frigate_controller_suite_test.go | 3 +- .../frigate/frigate_controller_test.go | 3 +- .../healthcheckpolicy_controller.go | 3 +- ...healthcheckpolicy_controller_suite_test.go | 3 +- .../healthcheckpolicy_controller_test.go | 3 +- .../controller/kraken/kraken_controller.go | 3 +- .../kraken/kraken_controller_suite_test.go | 3 +- .../kraken/kraken_controller_test.go | 3 +- .../namespace/namespace_controller.go | 0 .../namespace_controller_suite_test.go | 3 +- .../namespace/namespace_controller_test.go | 0 .../project/pkg/webhook/add_default_server.go | 2 +- .../default_server/add_mutating_firstmate.go | 2 +- .../default_server/add_mutating_namespace.go | 2 +- .../default_server/add_validating_frigate.go | 2 +- .../default_server/add_validating_kraken.go | 2 +- .../mutating/create_update_webhook.go | 3 +- .../firstmate/mutating/delete_webhook.go | 3 +- .../firstmate_create_update_handler.go | 3 +- .../mutating/firstmate_delete_handler.go | 3 +- .../firstmate/mutating/webhooks.go | 0 .../validating/frigate_update_handler.go | 3 +- .../frigate/validating/update_webhook.go | 3 +- .../frigate/validating/webhooks.go | 0 .../kraken/validating/create_webhook.go | 3 +- .../validating/kraken_create_handler.go | 3 +- .../kraken/validating/webhooks.go | 0 .../mutating/namespace_update_handler.go | 0 .../namespace/mutating/update_webhook.go | 0 .../namespace/mutating/webhooks.go | 0 .../pkg/webhook/default_server/server.go | 0 .../src}/project/pkg/webhook/webhook.go | 0 {test => testdata}/project_v2/.gitignore | 0 {test => testdata}/project_v2/Dockerfile | 6 +- {test => testdata}/project_v2/Makefile | 36 +- testdata/project_v2/PROJECT | 3 + .../project_v2/api/v1/captain_types.go | 6 +- .../project_v2/api/v1/firstmate_types.go | 6 +- .../project_v2/api/v1/groupversion_info.go | 5 +- .../api/v1/zz_generated.deepcopy.go | 11 +- .../config/certmanager/certificate.yaml | 0 .../config/certmanager/kustomization.yaml | 0 .../config/certmanager/kustomizeconfig.yaml | 0 .../bases/crew.testproject.org_captains.yaml | 359 ++++++++++++++++++ .../crew.testproject.org_firstmates.yaml | 359 ++++++++++++++++++ .../project_v2/config/crd}/kustomization.yaml | 8 +- .../config/crd}/kustomizeconfig.yaml | 0 .../crd}/patches/webhook_in_captain.yaml | 0 .../crd}/patches/webhook_in_firstmate.yaml | 0 .../config/default/kustomization.yaml | 6 +- .../default/manager_auth_proxy_patch.yaml | 0 .../config/default/manager_image_patch.yaml | 0 .../manager_prometheus_metrics_patch.yaml | 0 .../config/default/manager_webhook_patch.yaml | 0 .../default/webhookcainjection_patch.yaml | 0 .../config/manager/kustomization.yaml | 17 + .../project_v2/config/manager/manager.yaml | 0 .../config/rbac/auth_proxy_role.yaml | 0 .../config/rbac/auth_proxy_role_binding.yaml | 0 .../config/rbac/auth_proxy_service.yaml | 0 .../project_v2/config/rbac/kustomization.yaml | 9 + testdata/project_v2/config/rbac/role.yaml | 66 ++++ .../project_v2/config/rbac/role_binding.yaml | 12 + .../config/samples/crew_v1_captain.yaml | 2 - .../config/samples/crew_v1_firstmate.yaml | 2 - .../config/webhook/kustomization.yaml | 5 + .../config/webhook/kustomizeconfig.yaml | 0 .../controllers/captain_controller.go | 5 +- .../controllers/firstmate_controller.go | 5 +- .../controllers/namespace_controller.go | 3 +- testdata/project_v2/go.mod | 12 + testdata/project_v2/go.sum | 177 +++++++++ .../project_v2/hack/boilerplate.go.txt | 0 {test => testdata}/project_v2/main.go | 10 +- testdata/vendor.v1.tgz | 3 + 187 files changed, 1154 insertions(+), 1842 deletions(-) delete mode 100644 test/data/docs/expected/config-annotated.yaml delete mode 100644 test/data/docs/expected/config.yaml delete mode 100644 test/data/docs/expected/includes/_ant.md delete mode 100644 test/data/docs/expected/includes/_definitions.md delete mode 100644 test/data/docs/expected/includes/_generated_ant_v1beta1_ant_concept.md delete mode 100644 test/data/docs/expected/includes/_generated_bee_v1beta1_insect_concept.md delete mode 100644 test/data/docs/expected/includes/_generated_initializer_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_initializers_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_listmeta_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_objectmeta_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_ownerreference_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_status_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_statuscause_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_statusdetails_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_time_v1_meta_definition.md delete mode 100644 test/data/docs/expected/includes/_generated_wasp_v1beta1_insect_concept.md delete mode 100644 test/data/docs/expected/includes/_insect.md delete mode 100644 test/data/docs/expected/includes/_oldversions.md delete mode 100644 test/data/docs/expected/includes/_overview.md delete mode 100644 test/data/docs/expected/manifest.json delete mode 100644 test/data/resource/expected/crd-expected.yaml delete mode 100644 test/e2e/common.go delete mode 100644 test/e2e/config.go delete mode 100644 test/e2e/doc.go delete mode 100644 test/e2e/e2e.go delete mode 100644 test/e2e/e2e_test.go delete mode 100644 test/e2e/framework/ginkgowrapper/wrapper.go delete mode 100644 test/e2e/framework/test_context.go delete mode 100644 test/e2e/framework/util.go delete mode 100644 test/internal/e2e/kubebuildertest.go delete mode 100644 test/project/PROJECT delete mode 100644 test/project/pkg/apis/crew/v1/doc.go delete mode 100644 test/project_v2/Gopkg.toml delete mode 100644 test/project_v2/PROJECT delete mode 100644 test/project_v2/api/doc.go delete mode 100644 test/project_v2/api/zz_generated.deepcopy.go delete mode 100644 test/project_v2/config/manager/kustomization.yaml delete mode 100644 test/project_v2/config/rbac/kustomization.yaml delete mode 100644 test/project_v2/config/webhook/kustomization.yaml delete mode 100644 test/vendor.v1.tgz delete mode 100644 test/vendor.v2.tgz rename {test => testdata/gopath/src}/project/.gitignore (100%) rename {test => testdata/gopath/src}/project/Dockerfile (63%) rename {test => testdata/gopath/src}/project/Gopkg.toml (98%) rename {test => testdata/gopath/src}/project/Makefile (94%) create mode 100644 testdata/gopath/src/project/PROJECT rename {test => testdata/gopath/src}/project/cmd/manager/main.go (93%) rename {test => testdata/gopath/src}/project/config/crds/creatures_v2alpha1_kraken.yaml (100%) rename {test => testdata/gopath/src}/project/config/crds/crew_v1_firstmate.yaml (100%) rename {test => testdata/gopath/src}/project/config/crds/policy_v1beta1_healthcheckpolicy.yaml (100%) rename {test => testdata/gopath/src}/project/config/crds/ship_v1beta1_frigate.yaml (100%) rename {test => testdata/gopath/src}/project/config/default/kustomization.yaml (100%) rename {test => testdata/gopath/src}/project/config/default/manager_auth_proxy_patch.yaml (100%) rename {test => testdata/gopath/src}/project/config/default/manager_image_patch.yaml (100%) rename {test => testdata/gopath/src}/project/config/default/manager_prometheus_metrics_patch.yaml (100%) rename {test => testdata/gopath/src}/project/config/manager/kustomization.yaml (100%) rename {test => testdata/gopath/src}/project/config/manager/manager.yaml (100%) rename {test => testdata/gopath/src}/project/config/rbac/auth_proxy_role.yaml (100%) rename {test => testdata/gopath/src}/project/config/rbac/auth_proxy_role_binding.yaml (100%) rename {test => testdata/gopath/src}/project/config/rbac/auth_proxy_service.yaml (100%) rename {test => testdata/gopath/src}/project/config/rbac/kustomization.yaml (100%) rename {test => testdata/gopath/src}/project/config/rbac/rbac_role.yaml (100%) rename {test => testdata/gopath/src}/project/config/rbac/rbac_role_binding.yaml (100%) rename {test => testdata/gopath/src}/project/config/samples/creatures_v2alpha1_kraken.yaml (100%) rename {test => testdata/gopath/src}/project/config/samples/crew_v1_firstmate.yaml (100%) rename {test => testdata/gopath/src}/project/config/samples/policy_v1beta1_healthcheckpolicy.yaml (100%) rename {test => testdata/gopath/src}/project/config/samples/ship_v1beta1_frigate.yaml (100%) rename {test => testdata/gopath/src}/project/hack/boilerplate.go.txt (100%) rename {test => testdata/gopath/src}/project/pkg/apis/addtoscheme_creatures_v2alpha1.go (83%) rename {test => testdata/gopath/src}/project/pkg/apis/addtoscheme_crew_v1.go (85%) rename {test => testdata/gopath/src}/project/pkg/apis/addtoscheme_policy_v1beta1.go (84%) rename {test => testdata/gopath/src}/project/pkg/apis/addtoscheme_ship_v1beta1.go (84%) rename {test => testdata/gopath/src}/project/pkg/apis/apis.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/group.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/v2alpha1/doc.go (91%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/v2alpha1/kraken_types.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/v2alpha1/kraken_types_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/v2alpha1/register.go (95%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/v2alpha1/v2alpha1_suite_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/creatures/v2alpha1/zz_generated.deepcopy.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/crew/group.go (100%) rename {test/project_v2/api => testdata/gopath/src/project/pkg/apis/crew}/v1/doc.go (91%) rename {test => testdata/gopath/src}/project/pkg/apis/crew/v1/firstmate_types.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/crew/v1/firstmate_types_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/crew/v1/register.go (95%) rename {test => testdata/gopath/src}/project/pkg/apis/crew/v1/v1_suite_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/crew/v1/zz_generated.deepcopy.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/group.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/v1beta1/doc.go (91%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/v1beta1/register.go (95%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/v1beta1/v1beta1_suite_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/group.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/v1beta1/doc.go (91%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/v1beta1/frigate_types.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/v1beta1/frigate_types_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/v1beta1/register.go (95%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/v1beta1/v1beta1_suite_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/apis/ship/v1beta1/zz_generated.deepcopy.go (100%) rename {test => testdata/gopath/src}/project/pkg/controller/add_firstmate.go (92%) rename {test => testdata/gopath/src}/project/pkg/controller/add_frigate.go (92%) rename {test => testdata/gopath/src}/project/pkg/controller/add_healthcheckpolicy.go (91%) rename {test => testdata/gopath/src}/project/pkg/controller/add_kraken.go (92%) rename {test => testdata/gopath/src}/project/pkg/controller/add_namespace.go (92%) rename {test => testdata/gopath/src}/project/pkg/controller/controller.go (100%) rename {test => testdata/gopath/src}/project/pkg/controller/firstmate/firstmate_controller.go (98%) rename {test => testdata/gopath/src}/project/pkg/controller/firstmate/firstmate_controller_suite_test.go (97%) rename {test => testdata/gopath/src}/project/pkg/controller/firstmate/firstmate_controller_test.go (98%) rename {test => testdata/gopath/src}/project/pkg/controller/frigate/frigate_controller.go (98%) rename {test => testdata/gopath/src}/project/pkg/controller/frigate/frigate_controller_suite_test.go (97%) rename {test => testdata/gopath/src}/project/pkg/controller/frigate/frigate_controller_test.go (96%) rename {test => testdata/gopath/src}/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go (98%) rename {test => testdata/gopath/src}/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go (97%) rename {test => testdata/gopath/src}/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go (96%) rename {test => testdata/gopath/src}/project/pkg/controller/kraken/kraken_controller.go (97%) rename {test => testdata/gopath/src}/project/pkg/controller/kraken/kraken_controller_suite_test.go (97%) rename {test => testdata/gopath/src}/project/pkg/controller/kraken/kraken_controller_test.go (96%) rename {test => testdata/gopath/src}/project/pkg/controller/namespace/namespace_controller.go (100%) rename {test => testdata/gopath/src}/project/pkg/controller/namespace/namespace_controller_suite_test.go (97%) rename {test => testdata/gopath/src}/project/pkg/controller/namespace/namespace_controller_test.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/add_default_server.go (91%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/add_mutating_firstmate.go (93%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/add_mutating_namespace.go (93%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/add_validating_frigate.go (93%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/add_validating_kraken.go (93%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go (94%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go (94%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go (97%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go (97%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/firstmate/mutating/webhooks.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go (97%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/frigate/validating/update_webhook.go (93%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/frigate/validating/webhooks.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/kraken/validating/create_webhook.go (92%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go (96%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/kraken/validating/webhooks.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/namespace/mutating/namespace_update_handler.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/namespace/mutating/update_webhook.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/namespace/mutating/webhooks.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/default_server/server.go (100%) rename {test => testdata/gopath/src}/project/pkg/webhook/webhook.go (100%) rename {test => testdata}/project_v2/.gitignore (100%) rename {test => testdata}/project_v2/Dockerfile (64%) rename {test => testdata}/project_v2/Makefile (54%) create mode 100644 testdata/project_v2/PROJECT rename {test => testdata}/project_v2/api/v1/captain_types.go (90%) rename {test => testdata}/project_v2/api/v1/firstmate_types.go (90%) rename {test => testdata}/project_v2/api/v1/groupversion_info.go (87%) rename {test => testdata}/project_v2/api/v1/zz_generated.deepcopy.go (98%) rename {test => testdata}/project_v2/config/certmanager/certificate.yaml (100%) rename {test => testdata}/project_v2/config/certmanager/kustomization.yaml (100%) rename {test => testdata}/project_v2/config/certmanager/kustomizeconfig.yaml (100%) create mode 100644 testdata/project_v2/config/crd/bases/crew.testproject.org_captains.yaml create mode 100644 testdata/project_v2/config/crd/bases/crew.testproject.org_firstmates.yaml rename {test/project_v2/config/crds => testdata/project_v2/config/crd}/kustomization.yaml (74%) rename {test/project_v2/config/crds => testdata/project_v2/config/crd}/kustomizeconfig.yaml (100%) rename {test/project_v2/config/crds => testdata/project_v2/config/crd}/patches/webhook_in_captain.yaml (100%) rename {test/project_v2/config/crds => testdata/project_v2/config/crd}/patches/webhook_in_firstmate.yaml (100%) rename {test => testdata}/project_v2/config/default/kustomization.yaml (96%) rename {test => testdata}/project_v2/config/default/manager_auth_proxy_patch.yaml (100%) rename {test => testdata}/project_v2/config/default/manager_image_patch.yaml (100%) rename {test => testdata}/project_v2/config/default/manager_prometheus_metrics_patch.yaml (100%) rename {test => testdata}/project_v2/config/default/manager_webhook_patch.yaml (100%) rename {test => testdata}/project_v2/config/default/webhookcainjection_patch.yaml (100%) create mode 100644 testdata/project_v2/config/manager/kustomization.yaml rename {test => testdata}/project_v2/config/manager/manager.yaml (100%) rename {test => testdata}/project_v2/config/rbac/auth_proxy_role.yaml (100%) rename {test => testdata}/project_v2/config/rbac/auth_proxy_role_binding.yaml (100%) rename {test => testdata}/project_v2/config/rbac/auth_proxy_service.yaml (100%) create mode 100644 testdata/project_v2/config/rbac/kustomization.yaml create mode 100644 testdata/project_v2/config/rbac/role.yaml create mode 100644 testdata/project_v2/config/rbac/role_binding.yaml rename {test => testdata}/project_v2/config/samples/crew_v1_captain.yaml (72%) rename {test => testdata}/project_v2/config/samples/crew_v1_firstmate.yaml (73%) create mode 100644 testdata/project_v2/config/webhook/kustomization.yaml rename {test => testdata}/project_v2/config/webhook/kustomizeconfig.yaml (100%) rename {test => testdata}/project_v2/controllers/captain_controller.go (92%) rename {test => testdata}/project_v2/controllers/firstmate_controller.go (92%) rename {test => testdata}/project_v2/controllers/namespace_controller.go (96%) create mode 100644 testdata/project_v2/go.mod create mode 100644 testdata/project_v2/go.sum rename {test => testdata}/project_v2/hack/boilerplate.go.txt (100%) rename {test => testdata}/project_v2/main.go (87%) create mode 100644 testdata/vendor.v1.tgz diff --git a/.gitattributes b/.gitattributes index a060bd481c1..80acc32e093 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -test/*.tgz filter=lfs diff=lfs merge=lfs -text +testdata/*.tgz filter=lfs diff=lfs merge=lfs -text diff --git a/test/data/docs/expected/config-annotated.yaml b/test/data/docs/expected/config-annotated.yaml deleted file mode 100644 index 0a769c8e692..00000000000 --- a/test/data/docs/expected/config-annotated.yaml +++ /dev/null @@ -1,24 +0,0 @@ -example_location: "examples" -api_groups: - - "Ant" - - - "Insect" -resource_categories: -- name: "Ant" - include: "ant" - resources: - - name: "Ant" - version: "v1beta1" - group: "ant" - -- name: "Insect" - include: "insect" - resources: - - name: "Bee" - version: "v1beta1" - group: "insect" - description_warning: "test warnings message annotations" - description_note: "test notes message annotations" - - name: "Wasp" - version: "v1beta1" - group: "insect" diff --git a/test/data/docs/expected/config.yaml b/test/data/docs/expected/config.yaml deleted file mode 100644 index 612636b20a7..00000000000 --- a/test/data/docs/expected/config.yaml +++ /dev/null @@ -1,22 +0,0 @@ -example_location: "examples" -api_groups: - - "Ant" - - - "Insect" -resource_categories: -- name: "Ant" - include: "ant" - resources: - - name: "Ant" - version: "v1beta1" - group: "ant" - -- name: "Insect" - include: "insect" - resources: - - name: "Bee" - version: "v1beta1" - group: "insect" - - name: "Wasp" - version: "v1beta1" - group: "insect" diff --git a/test/data/docs/expected/includes/_ant.md b/test/data/docs/expected/includes/_ant.md deleted file mode 100644 index b6839cb8ca9..00000000000 --- a/test/data/docs/expected/includes/_ant.md +++ /dev/null @@ -1,5 +0,0 @@ - -# Ant - ------------- - diff --git a/test/data/docs/expected/includes/_definitions.md b/test/data/docs/expected/includes/_definitions.md deleted file mode 100644 index 091e5a53de8..00000000000 --- a/test/data/docs/expected/includes/_definitions.md +++ /dev/null @@ -1,5 +0,0 @@ - -# Field Definitions - ------------- - diff --git a/test/data/docs/expected/includes/_generated_ant_v1beta1_ant_concept.md b/test/data/docs/expected/includes/_generated_ant_v1beta1_ant_concept.md deleted file mode 100644 index b29f34e3c99..00000000000 --- a/test/data/docs/expected/includes/_generated_ant_v1beta1_ant_concept.md +++ /dev/null @@ -1,58 +0,0 @@ - - ------------ -# Ant v1beta1 - - - -Group | Version | Kind ------------- | ---------- | ----------- -`ant` | `v1beta1` | `Ant` - - - - - - - -Ant - - - -Field | Description ------------- | ----------- -`apiVersion`
*string* | 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/api-conventions.md#resources -`kind`
*string* | 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/api-conventions.md#types-kinds -`metadata`
*[ObjectMeta](#objectmeta-v1)* | -`spec`
*[AntSpec](#antspec-v1beta1)* | -`status`
*[AntStatus](#antstatus-v1beta1)* | - - -### AntSpec v1beta1 - - - -Field | Description ------------- | ----------- - -### AntStatus v1beta1 - - - -Field | Description ------------- | ----------- - - - - - diff --git a/test/data/docs/expected/includes/_generated_bee_v1beta1_insect_concept.md b/test/data/docs/expected/includes/_generated_bee_v1beta1_insect_concept.md deleted file mode 100644 index 580f444ba14..00000000000 --- a/test/data/docs/expected/includes/_generated_bee_v1beta1_insect_concept.md +++ /dev/null @@ -1,59 +0,0 @@ - - ------------ -# Bee v1beta1 - - - -Group | Version | Kind ------------- | ---------- | ----------- -`insect` | `v1beta1` | `Bee` - - - - - - - -Bee - - - -Field | Description ------------- | ----------- -`apiVersion`
*string* | 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/api-conventions.md#resources -`kind`
*string* | 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/api-conventions.md#types-kinds -`metadata`
*[ObjectMeta](#objectmeta-v1)* | -`spec`
*[BeeSpec](#beespec-v1beta1)* | -`status`
*[BeeStatus](#beestatus-v1beta1)* | - - -### BeeSpec v1beta1 - - - -Field | Description ------------- | ----------- -`request`
*object* | - -### BeeStatus v1beta1 - - - -Field | Description ------------- | ----------- - - - - - diff --git a/test/data/docs/expected/includes/_generated_initializer_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_initializer_v1_meta_definition.md deleted file mode 100644 index 6c8a9d6f4d9..00000000000 --- a/test/data/docs/expected/includes/_generated_initializer_v1_meta_definition.md +++ /dev/null @@ -1,21 +0,0 @@ -## Initializer v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `Initializer` - - - -Initializer is information about an initializer that has not yet completed. - - - -Field | Description ------------- | ----------- -`name`
*string* | name of the process that is responsible for initializing this object. - diff --git a/test/data/docs/expected/includes/_generated_initializers_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_initializers_v1_meta_definition.md deleted file mode 100644 index aeca11484b8..00000000000 --- a/test/data/docs/expected/includes/_generated_initializers_v1_meta_definition.md +++ /dev/null @@ -1,22 +0,0 @@ -## Initializers v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `Initializers` - - - -Initializers tracks the progress of initialization. - - - -Field | Description ------------- | ----------- -`pending`
*[Initializer](#initializer-v1) array*
**patch type**: *merge*
**patch merge key**: *name* | Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients. -`result`
*[Status](#status-v1)* | If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion. - diff --git a/test/data/docs/expected/includes/_generated_listmeta_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_listmeta_v1_meta_definition.md deleted file mode 100644 index 0e35bc5faf5..00000000000 --- a/test/data/docs/expected/includes/_generated_listmeta_v1_meta_definition.md +++ /dev/null @@ -1,23 +0,0 @@ -## ListMeta v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `ListMeta` - - - -ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. - - - -Field | Description ------------- | ----------- -`continue`
*string* | continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response. -`resourceVersion`
*string* | String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency -`selfLink`
*string* | selfLink is a URL representing this object. Populated by the system. Read-only. - diff --git a/test/data/docs/expected/includes/_generated_objectmeta_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_objectmeta_v1_meta_definition.md deleted file mode 100644 index 9822043fdf4..00000000000 --- a/test/data/docs/expected/includes/_generated_objectmeta_v1_meta_definition.md +++ /dev/null @@ -1,38 +0,0 @@ -## ObjectMeta v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `ObjectMeta` - - - -ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. - - - -Field | Description ------------- | ----------- -`annotations`
*object* | Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations -`clusterName`
*string* | The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. -`creationTimestamp`
*[Time](#time-v1)* | CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata -`deletionGracePeriodSeconds`
*integer* | Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. -`deletionTimestamp`
*[Time](#time-v1)* | DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata -`finalizers`
*string array*
**patch type**: *merge* | Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. -`generateName`
*string* | GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency -`generation`
*integer* | A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. -`initializers`
*[Initializers](#initializers-v1)* | An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects. When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user. -`labels`
*object* | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels -`name`
*string* | Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names -`namespace`
*string* | Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces -`ownerReferences`
*[OwnerReference](#ownerreference-v1) array*
**patch type**: *merge*
**patch merge key**: *uid* | List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. -`resourceVersion`
*string* | An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency -`selfLink`
*string* | SelfLink is a URL representing this object. Populated by the system. Read-only. -`uid`
*string* | UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids - diff --git a/test/data/docs/expected/includes/_generated_ownerreference_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_ownerreference_v1_meta_definition.md deleted file mode 100644 index 7ace183c403..00000000000 --- a/test/data/docs/expected/includes/_generated_ownerreference_v1_meta_definition.md +++ /dev/null @@ -1,26 +0,0 @@ -## OwnerReference v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `OwnerReference` - - - -OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field. - - - -Field | Description ------------- | ----------- -`apiVersion`
*string* | API version of the referent. -`blockOwnerDeletion`
*boolean* | If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. -`controller`
*boolean* | If true, this reference points to the managing controller. -`kind`
*string* | Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds -`name`
*string* | Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names -`uid`
*string* | UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids - diff --git a/test/data/docs/expected/includes/_generated_status_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_status_v1_meta_definition.md deleted file mode 100644 index bff09ebe85b..00000000000 --- a/test/data/docs/expected/includes/_generated_status_v1_meta_definition.md +++ /dev/null @@ -1,28 +0,0 @@ -## Status v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `Status` - - - -Status is a return value for calls that don't return other objects. - - - -Field | Description ------------- | ----------- -`apiVersion`
*string* | 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/api-conventions.md#resources -`code`
*integer* | Suggested HTTP return code for this status, 0 if not set. -`details`
*[StatusDetails](#statusdetails-v1)* | Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. -`kind`
*string* | 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/api-conventions.md#types-kinds -`message`
*string* | A human-readable description of the status of this operation. -`metadata`
*[ListMeta](#listmeta-v1)* | Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds -`reason`
*string* | A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. -`status`
*string* | Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status - diff --git a/test/data/docs/expected/includes/_generated_statuscause_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_statuscause_v1_meta_definition.md deleted file mode 100644 index f873cb78d12..00000000000 --- a/test/data/docs/expected/includes/_generated_statuscause_v1_meta_definition.md +++ /dev/null @@ -1,23 +0,0 @@ -## StatusCause v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `StatusCause` - - - -StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered. - - - -Field | Description ------------- | ----------- -`field`
*string* | The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: "name" - the field "name" on the current resource "items[0].name" - the field "name" on the first array entry in "items" -`message`
*string* | A human-readable description of the cause of the error. This field may be presented as-is to a reader. -`reason`
*string* | A machine-readable description of the cause of the error. If this value is empty there is no information available. - diff --git a/test/data/docs/expected/includes/_generated_statusdetails_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_statusdetails_v1_meta_definition.md deleted file mode 100644 index 18f2a17cd46..00000000000 --- a/test/data/docs/expected/includes/_generated_statusdetails_v1_meta_definition.md +++ /dev/null @@ -1,26 +0,0 @@ -## StatusDetails v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `StatusDetails` - - - -StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined. - - - -Field | Description ------------- | ----------- -`causes`
*[StatusCause](#statuscause-v1) array* | The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. -`group`
*string* | The group attribute of the resource associated with the status StatusReason. -`kind`
*string* | The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds -`name`
*string* | The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). -`retryAfterSeconds`
*integer* | If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action. -`uid`
*string* | UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids - diff --git a/test/data/docs/expected/includes/_generated_time_v1_meta_definition.md b/test/data/docs/expected/includes/_generated_time_v1_meta_definition.md deleted file mode 100644 index 66db20e1602..00000000000 --- a/test/data/docs/expected/includes/_generated_time_v1_meta_definition.md +++ /dev/null @@ -1,20 +0,0 @@ -## Time v1 - -Group | Version | Kind ------------- | ---------- | ----------- -`meta` | `v1` | `Time` - - - - - - - -Field | Description ------------- | ----------- - diff --git a/test/data/docs/expected/includes/_generated_wasp_v1beta1_insect_concept.md b/test/data/docs/expected/includes/_generated_wasp_v1beta1_insect_concept.md deleted file mode 100644 index bbd7673f0d4..00000000000 --- a/test/data/docs/expected/includes/_generated_wasp_v1beta1_insect_concept.md +++ /dev/null @@ -1,58 +0,0 @@ - - ------------ -# Wasp v1beta1 - - - -Group | Version | Kind ------------- | ---------- | ----------- -`insect` | `v1beta1` | `Wasp` - - - - - - - -Wasp - - - -Field | Description ------------- | ----------- -`apiVersion`
*string* | 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/api-conventions.md#resources -`kind`
*string* | 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/api-conventions.md#types-kinds -`metadata`
*[ObjectMeta](#objectmeta-v1)* | -`spec`
*[WaspSpec](#waspspec-v1beta1)* | -`status`
*[WaspStatus](#waspstatus-v1beta1)* | - - -### WaspSpec v1beta1 - - - -Field | Description ------------- | ----------- - -### WaspStatus v1beta1 - - - -Field | Description ------------- | ----------- - - - - - diff --git a/test/data/docs/expected/includes/_insect.md b/test/data/docs/expected/includes/_insect.md deleted file mode 100644 index 586aa17bf24..00000000000 --- a/test/data/docs/expected/includes/_insect.md +++ /dev/null @@ -1,5 +0,0 @@ - -# Insect - ------------- - diff --git a/test/data/docs/expected/includes/_oldversions.md b/test/data/docs/expected/includes/_oldversions.md deleted file mode 100644 index 5b434aeafc8..00000000000 --- a/test/data/docs/expected/includes/_oldversions.md +++ /dev/null @@ -1,5 +0,0 @@ - -# Old API Versions - ------------- - diff --git a/test/data/docs/expected/includes/_overview.md b/test/data/docs/expected/includes/_overview.md deleted file mode 100644 index 077c51f803a..00000000000 --- a/test/data/docs/expected/includes/_overview.md +++ /dev/null @@ -1,5 +0,0 @@ - -# Overview - ------------- - diff --git a/test/data/docs/expected/manifest.json b/test/data/docs/expected/manifest.json deleted file mode 100644 index 1d0465a2550..00000000000 --- a/test/data/docs/expected/manifest.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "table_of_contents": {}, - "docs": [ - { - "filename": "_ant.md" - }, - { - "filename": "_generated_ant_v1beta1_ant_concept.md" - }, - { - "filename": "_insect.md" - }, - { - "filename": "_generated_bee_v1beta1_insect_concept.md" - }, - { - "filename": "_generated_wasp_v1beta1_insect_concept.md" - }, - { - "filename": "_oldversions.md" - }, - { - "filename": "_definitions.md" - }, - { - "filename": "_generated_initializer_v1_meta_definition.md" - }, - { - "filename": "_generated_initializers_v1_meta_definition.md" - }, - { - "filename": "_generated_listmeta_v1_meta_definition.md" - }, - { - "filename": "_generated_objectmeta_v1_meta_definition.md" - }, - { - "filename": "_generated_ownerreference_v1_meta_definition.md" - }, - { - "filename": "_generated_status_v1_meta_definition.md" - }, - { - "filename": "_generated_statuscause_v1_meta_definition.md" - }, - { - "filename": "_generated_statusdetails_v1_meta_definition.md" - }, - { - "filename": "_generated_time_v1_meta_definition.md" - } - ], - "title": "World", - "copyright": "Hello" -} \ No newline at end of file diff --git a/test/data/resource/expected/crd-expected.yaml b/test/data/resource/expected/crd-expected.yaml deleted file mode 100644 index 33974a715f1..00000000000 --- a/test/data/resource/expected/crd-expected.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - api: "" - kubebuilder.k8s.io: unknown - name: houses.got.sample.kubernetes.io -spec: - group: got.sample.kubernetes.io - names: - kind: House - plural: houses - scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - alias: - enum: - - Lion - - Wolf - - Dragon - type: string - bricks: - format: int32 - type: integer - comment: - format: byte - type: string - knights: - items: - type: string - maxItems: 500 - minItems: 1 - type: array - name: - maxLength: 15 - minLength: 1 - type: string - power: - exclusiveMinimum: true - format: float - maximum: 100 - type: number - rank: - enum: - - 1 - - 2 - - 3 - format: int64 - type: integer - winner: - type: boolean - required: - - rank - type: object - status: - type: object - version: v1beta1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: null diff --git a/test/e2e/common.go b/test/e2e/common.go deleted file mode 100644 index e7fb4309ea6..00000000000 --- a/test/e2e/common.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2018 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 e2e - -import ( - "log" - "os" - "path/filepath" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "sigs.k8s.io/kubebuilder/test/e2e/framework" - e2einternal "sigs.k8s.io/kubebuilder/test/internal/e2e" -) - -func prepare(workDir string) { - By("create a path under given project dir, as the test work dir") - err := os.MkdirAll(workDir, 0755) - Expect(err).NotTo(HaveOccurred()) -} - -func cleanupv0(builderTest *e2einternal.KubebuilderTest, workDir string, imageName string) { - By("clean up created API objects during test process") - inputFile := filepath.Join(workDir, "hack", "install.yaml") - deleteOptions := []string{"delete", "-f", inputFile} - builderTest.RunKubectlCommand(framework.GetKubectlArgs(deleteOptions)) - - By("remove container image created during test") - builderTest.CleanupImage([]string{imageName}) - - By("remove test work dir") - os.RemoveAll(workDir) -} - -func cleanupv1(builderTest *e2einternal.KubebuilderTest, workDir string, imageName string) { - By("clean up created API objects during test process") - - kustomizeOptions := []string{"build", filepath.Join("config", "default")} - resources, err := builderTest.RunKustomizeCommand(kustomizeOptions) - if err != nil { - log.Printf("error when running kustomize build during cleaning up: %v", err) - } - - deleteOptions := []string{"delete", "--recursive", "-f", "-"} - _, err = builderTest.RunKubectlCommandWithInput(framework.GetKubectlArgs(deleteOptions), resources) - if err != nil { - log.Printf("error when running kubectl delete during cleaning up: %v", err) - } - - deleteOptions = []string{"delete", "--recursive", "-f", filepath.Join("config", "crds")} - _, err = builderTest.RunKubectlCommand(framework.GetKubectlArgs(deleteOptions)) - - By("remove container image created during test") - builderTest.CleanupImage([]string{imageName}) - - By("remove test work dir") - os.RemoveAll(workDir) -} diff --git a/test/e2e/config.go b/test/e2e/config.go deleted file mode 100644 index d5c7f3572bc..00000000000 --- a/test/e2e/config.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2018 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 e2e - -import ( - "path/filepath" - - "sigs.k8s.io/kubebuilder/test/e2e/framework" -) - -// runtime config specified to run e2e tests -type config struct { - domain string - group string - version string - kind string - installName string - namespace string - controllerImageName string - workDir string -} - -// initConfig init with a random suffix for test config stuff, -// to avoid conflict when running tests synchronously. -func initConfig(testSuffix string) *config { - testGroup := "bar" + testSuffix - installName := "kube" + testGroup - testNamespace := installName + "-system" - - return &config{ - domain: "example.com" + testSuffix, - group: testGroup, - version: "v1alpha1", - kind: "Foo" + testSuffix, - installName: installName, - namespace: testNamespace, - controllerImageName: "e2e-test/controller-manager:" + testSuffix, - workDir: filepath.Join(framework.TestContext.ProjectDir, "e2e-"+testSuffix), - } -} - -type deploymentTemplateArguments struct { - Namespace string -} - -var deploymentTemplate = ` -apiVersion: apps/v1beta1 -kind: Deployment -metadata: - name: deployment-example - namespace: {{ .Namespace }} - labels: - name: deployment-example -spec: - replicas: 3 - selector: - matchLabels: - name: nginx - template: - metadata: - labels: - name: nginx - spec: - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 -` diff --git a/test/e2e/doc.go b/test/e2e/doc.go deleted file mode 100644 index 3aaaacb9650..00000000000 --- a/test/e2e/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 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. -*/ - -// The signals package contains e2e tests for kubebuilder -package e2e diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go deleted file mode 100644 index 05ebed703b7..00000000000 --- a/test/e2e/e2e.go +++ /dev/null @@ -1,143 +0,0 @@ -/* -Copyright 2018 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 e2e - -import ( - "fmt" - "os/exec" - "path/filepath" - "strings" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "sigs.k8s.io/kubebuilder/test/e2e/framework" - e2einternal "sigs.k8s.io/kubebuilder/test/internal/e2e" -) - -var _ = Describe("v1 main workflow", func() { - It("should perform main kubebuilder workflow successfully", func() { - testSuffix := framework.RandomSuffix() - c := initConfig(testSuffix) - kubebuilderTest := e2einternal.NewKubebuilderTest(c.workDir, framework.TestContext.BinariesDir) - - prepare(c.workDir) - defer cleanupv1(kubebuilderTest, c.workDir, c.controllerImageName) - - var controllerPodName string - - output, errrr := exec.Command("which", "kubebuilder").Output() - fmt.Printf("output of which: %s", output) - Expect(errrr).NotTo(HaveOccurred()) - - By("init v1 project") - initOptions := []string{ - "--project-version", "v1", - "--domain", c.domain, - "--dep", "true", - } - err := kubebuilderTest.Init(initOptions) - Expect(err).NotTo(HaveOccurred()) - - By("creating api definition") - crdOptions := []string{ - "--group", c.group, - "--version", c.version, - "--kind", c.kind, - "--namespaced", "false", - "--resource", "true", - "--controller", "true", - } - err = kubebuilderTest.CreateAPI(crdOptions) - Expect(err).NotTo(HaveOccurred()) - - // TODO: enable this test after we support gen rbac for core type controller - By("creating core-type resource controller") - coreControllerOptions := []string{ - "--group", "apps", - "--version", "v1", - "--kind", "Deployment", - "--namespaced", "true", - "--resource", "false", - "--controller", "true", - } - err = kubebuilderTest.CreateAPI(coreControllerOptions) - Expect(err).NotTo(HaveOccurred()) - - By("building image") - makeDockerBuildOptions := []string{"docker-build"} - err = kubebuilderTest.Make(makeDockerBuildOptions) - Expect(err).NotTo(HaveOccurred()) - - By("pushing image") - makeDockerPushOptions := []string{"docker-push"} - err = kubebuilderTest.Make(makeDockerPushOptions) - Expect(err).NotTo(HaveOccurred()) - - // NOTE: If you want to run the test against a GKE cluster, you will need to grant yourself permission. - // Otherwise, you may see "... is forbidden: attempt to grant extra privileges" - // $ kubectl create clusterrolebinding myname-cluster-admin-binding --clusterrole=cluster-admin --user=myname@mycompany.com - // https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control - By("deploying controller manager") - makeDeployOptions := []string{"deploy"} - err = kubebuilderTest.Make(makeDeployOptions) - - By("validate the controller-manager pod running as expected") - verifyControllerUp := func() error { - // Get pod name - getOptions := []string{"get", "pods", "-l", "control-plane=controller-manager", "-n", fmt.Sprintf("e2e-%s-system", testSuffix), "-o", "go-template={{ range .items }}{{ if not .metadata.deletionTimestamp }}{{ .metadata.name }}{{ \"\\n\" }}{{ end }}{{ end }}"} - podOutput, err := kubebuilderTest.RunKubectlCommand(framework.GetKubectlArgs(getOptions)) - Expect(err).NotTo(HaveOccurred()) - podNames := framework.ParseCmdOutput(podOutput) - if len(podNames) != 1 { - return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames)) - } - controllerPodName = podNames[0] - Expect(controllerPodName).Should(ContainSubstring("controller-manager")) - - // Validate pod status - getOptions = []string{"get", "pods", controllerPodName, "-o", "jsonpath={.status.phase}", "-n", fmt.Sprintf("e2e-%s-system", testSuffix)} - status, err := kubebuilderTest.RunKubectlCommand(framework.GetKubectlArgs(getOptions)) - Expect(err).NotTo(HaveOccurred()) - if status != "Running" { - return fmt.Errorf("controller pod in %s status", status) - } - - return nil - } - Eventually(verifyControllerUp, 5*time.Minute, time.Second).Should(BeNil()) - - By("creating an instance of CR") - inputFile := filepath.Join("config", "samples", fmt.Sprintf("%s_%s_%s.yaml", c.group, c.version, strings.ToLower(c.kind))) - createOptions := []string{"apply", "-f", inputFile} - _, err = kubebuilderTest.RunKubectlCommand(framework.GetKubectlArgs(createOptions)) - Expect(err).NotTo(HaveOccurred()) - - By("validate the created resource object gets reconciled in controller") - controllerContainerLogs := func() string { - // Check container log to validate that the created resource object gets reconciled in controller - logOptions := []string{"logs", controllerPodName, "-n", fmt.Sprintf("e2e-%s-system", testSuffix)} - logOutput, err := kubebuilderTest.RunKubectlCommand(framework.GetKubectlArgs(logOptions)) - Expect(err).NotTo(HaveOccurred()) - - return logOutput - } - Eventually(controllerContainerLogs, 3*time.Minute, time.Second).Should(ContainSubstring("Updating")) - Eventually(controllerContainerLogs, 3*time.Minute, time.Second).Should(ContainSubstring("Updating")) - }) -}) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go deleted file mode 100644 index 3b7937c12a5..00000000000 --- a/test/e2e/e2e_test.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2018 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 e2e - -import ( - "log" - "os" - "os/exec" - "path" - "strings" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/spf13/pflag" - - "k8s.io/klog" - "sigs.k8s.io/kubebuilder/test/e2e/framework" - "sigs.k8s.io/kubebuilder/test/e2e/framework/ginkgowrapper" -) - -func init() { - framework.RegisterFlags() - pflag.Parse() -} - -var kubebuilderBinDir string - -/* -2 steps to do before running the e2e test suite -1) go build a new kubebuilder binary -2) install all required binaries, such as etcd and kube-apiserver -If you have run testv0.sh or testv1.sh before running this e2e suite, -it will build the new kubebuilder. -*/ -// TODO: ensure the required binaries are installed when integrate with Prow. -var _ = BeforeSuite(func(done Done) { - // Uncomment the following line to set the image name before running the e2e test - //os.Setenv("IMG", "gcr.io//") - // If you want to run the test against a GKE cluster, run the following command first - // $ kubectl create clusterrolebinding myname-cluster-admin-binding --clusterrole=cluster-admin --user=myname@mycompany.com - framework.TestContext.BinariesDir = "/tmp/kubebuilder/bin/" - // build a kubebuilder - buildOptions := []string{ - "build", "-o", path.Join(framework.TestContext.BinariesDir, "kubebuilder"), "sigs.k8s.io/kubebuilder/cmd"} - cmd := exec.Command("go", buildOptions...) - cmd.Env = os.Environ() - command := strings.Join(cmd.Args, " ") - log.Printf("running %v", command) - output, err := cmd.CombinedOutput() - log.Printf("output when running:\n%s", output) - Expect(err).NotTo(HaveOccurred()) - - close(done) -}, 60) - -var _ = AfterSuite(func() { - os.RemoveAll(kubebuilderBinDir) -}) - -// RunE2ETests checks configuration parameters (specified through flags) and then runs -// E2E tests using the Ginkgo runner. -func RunE2ETests(t *testing.T) { - RegisterFailHandler(ginkgowrapper.Fail) - klog.Infof("Starting kubebuilder suite") - RunSpecs(t, "Kubebuilder e2e suite") -} - -func TestE2E(t *testing.T) { - RunE2ETests(t) -} diff --git a/test/e2e/framework/ginkgowrapper/wrapper.go b/test/e2e/framework/ginkgowrapper/wrapper.go deleted file mode 100644 index 08a5074b23e..00000000000 --- a/test/e2e/framework/ginkgowrapper/wrapper.go +++ /dev/null @@ -1,134 +0,0 @@ -/* -Copyright 2018 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 ginkgowrapper wraps Ginkgo Fail and Skip functions to panic -// with structured data instead of a constant string. -package ginkgowrapper - -import ( - "bufio" - "bytes" - "regexp" - "runtime" - "runtime/debug" - "strings" - - "github.com/onsi/ginkgo" -) - -// FailurePanic is the value that will be panicked from Fail. -type FailurePanic struct { - Message string // The failure message passed to Fail - Filename string // The filename that is the source of the failure - Line int // The line number of the filename that is the source of the failure - FullStackTrace string // A full stack trace starting at the source of the failure -} - -// String makes FailurePanic look like the old Ginkgo panic when printed. -func (FailurePanic) String() string { return ginkgo.GINKGO_PANIC } - -// Fail wraps ginkgo.Fail so that it panics with more useful -// information about the failure. This function will panic with a -// FailurePanic. -func Fail(message string, callerSkip ...int) { - skip := 1 - if len(callerSkip) > 0 { - skip += callerSkip[0] - } - - _, file, line, _ := runtime.Caller(skip) - fp := FailurePanic{ - Message: message, - Filename: file, - Line: line, - FullStackTrace: pruneStack(skip), - } - - defer func() { - e := recover() - if e != nil { - panic(fp) - } - }() - - ginkgo.Fail(message, skip) -} - -// SkipPanic is the value that will be panicked from Skip. -type SkipPanic struct { - Message string // The failure message passed to Fail - Filename string // The filename that is the source of the failure - Line int // The line number of the filename that is the source of the failure - FullStackTrace string // A full stack trace starting at the source of the failure -} - -// String makes SkipPanic look like the old Ginkgo panic when printed. -func (SkipPanic) String() string { return ginkgo.GINKGO_PANIC } - -// Skip wraps ginkgo.Skip so that it panics with more useful -// information about why the test is being skipped. This function will -// panic with a SkipPanic. -func Skip(message string, callerSkip ...int) { - skip := 1 - if len(callerSkip) > 0 { - skip += callerSkip[0] - } - - _, file, line, _ := runtime.Caller(skip) - sp := SkipPanic{ - Message: message, - Filename: file, - Line: line, - FullStackTrace: pruneStack(skip), - } - - defer func() { - e := recover() - if e != nil { - panic(sp) - } - }() - - ginkgo.Skip(message, skip) -} - -// ginkgo adds a lot of test running infrastructure to the stack, so -// we filter those out -var stackSkipPattern = regexp.MustCompile(`onsi/ginkgo`) - -func pruneStack(skip int) string { - skip += 2 // one for pruneStack and one for debug.Stack - stack := debug.Stack() - scanner := bufio.NewScanner(bytes.NewBuffer(stack)) - var prunedStack []string - - // skip the top of the stack - for i := 0; i < 2*skip+1; i++ { - scanner.Scan() - } - - for scanner.Scan() { - if stackSkipPattern.Match(scanner.Bytes()) { - scanner.Scan() // these come in pairs - } else { - prunedStack = append(prunedStack, scanner.Text()) - scanner.Scan() // these come in pairs - prunedStack = append(prunedStack, scanner.Text()) - } - } - - return strings.Join(prunedStack, "\n") -} diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go deleted file mode 100644 index cbb9e86d87b..00000000000 --- a/test/e2e/framework/test_context.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2018 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 framework - -import ( - "flag" - "fmt" - "os" - - "github.com/onsi/ginkgo/config" - - "k8s.io/client-go/tools/clientcmd" -) - -const ( - defaultHost = "http://127.0.0.1:8080" - defaultBinariesDir = "/usr/local/kubebuilder/bin/" -) - -var TestContext TestContextType - -type TestContextType struct { - BinariesDir string - ProjectDir string - // kubectl related items - KubectlPath string - KubeConfig string - KubeContext string - KubeAPIContentType string - CertDir string - Host string -} - -// Register flags common to all e2e test suites. -func RegisterFlags() { - // Turn on verbose by default to get spec names - config.DefaultReporterConfig.Verbose = true - - // Turn on EmitSpecProgress to get spec progress (especially on interrupt) - config.GinkgoConfig.EmitSpecProgress = true - - // Randomize specs as well as suites - config.GinkgoConfig.RandomizeAllSpecs = true - - flag.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to kubeconfig containing embedded authinfo.") - flag.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'") - flag.StringVar(&TestContext.KubeAPIContentType, "kube-api-content-type", "application/vnd.kubernetes.protobuf", "ContentType used to communicate with apiserver") - flag.StringVar(&TestContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.") - flag.StringVar(&TestContext.Host, "host", "", fmt.Sprintf("The host, or apiserver, to connect to. Will default to %s if this argument and --kubeconfig are not set", defaultHost)) - - flag.StringVar(&TestContext.BinariesDir, "binaries-dir", defaultBinariesDir, "The path of binaries.") - flag.StringVar(&TestContext.ProjectDir, "project-dir", "", "Project root path, must under $GOPATH/src/.") -} diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go deleted file mode 100644 index 3aeda6991ff..00000000000 --- a/test/e2e/framework/util.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2018 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 framework - -import ( - "fmt" - "io/ioutil" - "math/rand" - "os" - "path/filepath" - "regexp" - "strings" - "time" - - . "github.com/onsi/ginkgo" - "sigs.k8s.io/kubebuilder/test/e2e/framework/ginkgowrapper" - - "k8s.io/client-go/tools/clientcmd" -) - -// Code originally copied from kubernetes/kubernetes at -// https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/util.go - -// GetKubectlArgs wraps with default kubectl related args. -func GetKubectlArgs(args []string) []string { - defaultArgs := []string{} - - // Reference a --server option so tests can run anywhere. - if TestContext.Host != "" { - defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAPIServer+"="+TestContext.Host) - } - if TestContext.KubeConfig != "" { - defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+TestContext.KubeConfig) - - // Reference the KubeContext - if TestContext.KubeContext != "" { - defaultArgs = append(defaultArgs, "--"+clientcmd.FlagContext+"="+TestContext.KubeContext) - } - - } else { - if TestContext.CertDir != "" { - defaultArgs = append(defaultArgs, - fmt.Sprintf("--certificate-authority=%s", filepath.Join(TestContext.CertDir, "ca.crt")), - fmt.Sprintf("--client-certificate=%s", filepath.Join(TestContext.CertDir, "kubecfg.crt")), - fmt.Sprintf("--client-key=%s", filepath.Join(TestContext.CertDir, "kubecfg.key"))) - } - } - kubectlArgs := append(defaultArgs, args...) - - return kubectlArgs -} - -func NowStamp() string { - return time.Now().Format(time.StampMilli) -} - -func log(level string, format string, args ...interface{}) { - fmt.Fprintf(GinkgoWriter, NowStamp()+": "+level+": "+format+"\n", args...) -} - -func Logf(format string, args ...interface{}) { - log("INFO", format, args...) -} - -func Failf(format string, args ...interface{}) { - FailfWithOffset(1, format, args...) -} - -// FailfWithOffset calls "Fail" and logs the error at "offset" levels above its caller -// (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f"). -func FailfWithOffset(offset int, format string, args ...interface{}) { - msg := fmt.Sprintf(format, args...) - log("INFO", msg) - ginkgowrapper.Fail(NowStamp()+": "+msg, 1+offset) -} - -func Skipf(format string, args ...interface{}) { - msg := fmt.Sprintf(format, args...) - log("INFO", msg) - ginkgowrapper.Skip(NowStamp() + ": " + msg) -} - -// RandomSuffix provides a random string to append to certain base name. -func RandomSuffix() string { - source := []rune("abcdefghijklmnopqrstuvwxyz") - r := rand.New(rand.NewSource(time.Now().UnixNano())) - res := make([]rune, 4) - for i := range res { - res[i] = source[r.Intn(len(source))] - } - return string(res) -} - -// ParseCmdOutput converts given command output string into individual objects -// according to line breakers, and ignores the empty elements in it. -func ParseCmdOutput(output string) []string { - res := []string{} - elements := strings.Split(output, "\n") - for _, element := range elements { - if element != "" { - res = append(res, element) - } - } - - return res -} - -// ReplaceFileConent tries to replace the source content of given file -// with the target concent, source content can be regex. -func ReplaceFileConent(src, target string, filePath string) error { - // Check if file exist - if _, err := os.Stat(filePath); err != nil { - return err - } - - // Read file content - fileContent, err := ioutil.ReadFile(filePath) - if err != nil { - return err - } - - // Replace the content - r := regexp.MustCompile(src) - output := r.ReplaceAllString(string(fileContent), target) - - if err := ioutil.WriteFile(filePath, []byte(output), os.ModePerm); err != nil { - return err - } - - return nil -} diff --git a/test/internal/e2e/kubebuildertest.go b/test/internal/e2e/kubebuildertest.go deleted file mode 100644 index 1461e859624..00000000000 --- a/test/internal/e2e/kubebuildertest.go +++ /dev/null @@ -1,236 +0,0 @@ -package e2e - -import ( - "fmt" - "io" - "io/ioutil" - "log" - "os" - "os/exec" - "path/filepath" - "strings" -) - -type KubebuilderTest struct { - Dir string -} - -func NewKubebuilderTest(dir, binDir string) *KubebuilderTest { - kt := KubebuilderTest{Dir: dir} - os.Setenv("TEST_ASSET_KUBECTL", strings.Join([]string{binDir, "kubectl"}, "/")) - os.Setenv("TEST_ASSET_KUBE_APISERVER", strings.Join([]string{binDir, "kube-apiserver"}, "/")) - os.Setenv("TEST_ASSET_ETCD", strings.Join([]string{binDir, "etcd"}, "/")) - cmd := exec.Command("command", "-v", "kubebuilder") - if _, err := kt.runCommand(cmd); err != nil { - os.Setenv("PATH", strings.Join([]string{binDir, os.Getenv("PATH")}, ":")) - } - return &kt -} - -func (kt *KubebuilderTest) Init(initOptions []string) error { - initOptions = append([]string{"init"}, initOptions...) - cmd := exec.Command("kubebuilder", initOptions...) - _, err := kt.runCommand(cmd) - return err -} - -// CreateResource is for kubebuilder v0 only. -func (kt *KubebuilderTest) CreateResource(resourceOptions []string) error { - resourceOptions = append([]string{"create", "resource"}, resourceOptions...) - cmd := exec.Command("kubebuilder", resourceOptions...) - _, err := kt.runCommand(cmd) - return err -} - -// CreateAPI is for kubebuilder v1 only. -func (kt *KubebuilderTest) CreateAPI(resourceOptions []string) error { - resourceOptions = append([]string{"create", "api"}, resourceOptions...) - cmd := exec.Command("kubebuilder", resourceOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) CreateController(controllerOptions []string) error { - controllerOptions = append([]string{"create", "controller"}, controllerOptions...) - cmd := exec.Command("kubebuilder", controllerOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) Generate(generateOptions []string) error { - generateOptions = append([]string{"generate"}, generateOptions...) - cmd := exec.Command("kubebuilder", generateOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) Docs(docsOptions []string) error { - docsOptions = append([]string{"docs"}, docsOptions...) - cmd := exec.Command("kubebuilder", docsOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) Build() error { - var errs []string - cmd := exec.Command("go", "build", "./pkg/...") - _, err := kt.runCommand(cmd) - if err != nil { - errs = append(errs, err.Error()) - } - cmd = exec.Command("go", "build", "./cmd/...") - _, err = kt.runCommand(cmd) - if err != nil { - errs = append(errs, err.Error()) - } - if len(errs) > 0 { - return fmt.Errorf(strings.Join(errs, "\n")) - } - return nil -} - -func (kt *KubebuilderTest) Test() error { - var errs []string - cmd := exec.Command("go", "test", "./pkg/...") - _, err := kt.runCommand(cmd) - if err != nil { - errs = append(errs, err.Error()) - } - cmd = exec.Command("go", "test", "./cmd/...") - _, err = kt.runCommand(cmd) - if err != nil { - errs = append(errs, err.Error()) - } - if len(errs) > 0 { - return fmt.Errorf(strings.Join(errs, "\n")) - } - return nil -} - -func (kt *KubebuilderTest) CreateConfig(configOptions []string) error { - configOptions = append([]string{"create", "config"}, configOptions...) - cmd := exec.Command("kubebuilder", configOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) BuildImage(imageOptions []string) error { - // TODO: make the Dockerfile path mutable if necessary. - imageOptions = append([]string{"build", ".", "-f", "Dockerfile.controller"}, imageOptions...) - cmd := exec.Command("docker", imageOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) Make(makeOptions []string) error { - cmd := exec.Command("make", makeOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) CleanupImage(imageOptions []string) error { - imageOptions = append([]string{"rmi", "-f"}, imageOptions...) - cmd := exec.Command("docker", imageOptions...) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) Diff(pathA, pathB string) error { - cmd := exec.Command("diff", pathA, pathB) - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) DiffAll(generatedDir, expectedDir string) error { - files, err := ioutil.ReadDir(expectedDir) - if err != nil { - return err - } - var errs []string - for _, f := range files { - generatedFile := filepath.Join(generatedDir, f.Name()) - if _, err := os.Stat(generatedFile); err != nil { - errs = append(errs, err.Error()) - } else { - err = kt.Diff(generatedFile, filepath.Join(expectedDir, f.Name())) - if err != nil { - errs = append(errs, err.Error()) - } - } - } - if len(errs) > 0 { - return fmt.Errorf(strings.Join(errs, "\n")) - } - return nil -} - -func (kt *KubebuilderTest) DepEnsure() error { - cmd := exec.Command("dep", "ensure") - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) VendorUpdate() error { - cmd := exec.Command("kubebuilder", "vendor", "update") - _, err := kt.runCommand(cmd) - return err -} - -func (kt *KubebuilderTest) CleanUp() error { - var errs []string - cmd := exec.Command("kubebuilder", "generate", "clean") - _, err := kt.runCommand(cmd) - if err != nil { - errs = append(errs, err.Error()) - } - cmd = exec.Command("rm", "-r", "docs") - _, err = kt.runCommand(cmd) - if err != nil { - errs = append(errs, err.Error()) - } - if len(errs) > 0 { - return fmt.Errorf(strings.Join(errs, "\n")) - } - return nil -} - -// RunKubectlCommand is a general func to run kubectl commands -func (kt *KubebuilderTest) RunKubectlCommand(cmdOptions []string) (string, error) { - cmd := exec.Command("kubectl", cmdOptions...) - output, err := kt.runCommand(cmd) - return string(output), err -} - -// RunKubectlCommandWithInput is a general func to run kubectl commands -func (kt *KubebuilderTest) RunKubectlCommandWithInput(cmdOptions []string, stdinInput string) (string, error) { - cmd := exec.Command("kubectl", cmdOptions...) - stdin, err := cmd.StdinPipe() - if err != nil { - return "", err - } - go func() { - defer stdin.Close() - io.WriteString(stdin, stdinInput) - }() - output, err := kt.runCommand(cmd) - return string(output), err -} - -// RunKustomizeCommand is a general func to run kubectl commands -func (kt *KubebuilderTest) RunKustomizeCommand(cmdOptions []string) (string, error) { - cmd := exec.Command("kustomize", cmdOptions...) - output, err := kt.runCommand(cmd) - return string(output), err -} - -func (kt *KubebuilderTest) runCommand(cmd *exec.Cmd) ([]byte, error) { - cmd.Dir = kt.Dir - cmd.Env = os.Environ() - command := strings.Join(cmd.Args, " ") - output, err := cmd.CombinedOutput() - if err != nil { - return output, fmt.Errorf("%s failed with error: %s", command, string(output)) - } - log.Printf("%s finished successfully", command) - return output, nil -} diff --git a/test/project/PROJECT b/test/project/PROJECT deleted file mode 100644 index 79e8411d37c..00000000000 --- a/test/project/PROJECT +++ /dev/null @@ -1,3 +0,0 @@ -version: "1" -domain: testproject.org -repo: sigs.k8s.io/kubebuilder/test/project diff --git a/test/project/pkg/apis/crew/v1/doc.go b/test/project/pkg/apis/crew/v1/doc.go deleted file mode 100644 index 92c8b67499b..00000000000 --- a/test/project/pkg/apis/crew/v1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2019 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 -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew -// +k8s:defaulter-gen=TypeMeta -// +groupName=crew.testproject.org -package v1 diff --git a/test/project_v2/Gopkg.toml b/test/project_v2/Gopkg.toml deleted file mode 100644 index df2afebe144..00000000000 --- a/test/project_v2/Gopkg.toml +++ /dev/null @@ -1,37 +0,0 @@ -required = [ - "github.com/emicklei/go-restful", - "github.com/onsi/ginkgo", # for test framework - "github.com/onsi/gomega", # for test matchers - "k8s.io/client-go/plugin/pkg/client/auth/gcp", # for development against gcp - "k8s.io/code-generator/cmd/client-gen", # for go generate - "k8s.io/code-generator/cmd/deepcopy-gen", # for go generate - "sigs.k8s.io/controller-tools/cmd/controller-gen", # for crd/rbac generation - "sigs.k8s.io/controller-runtime/pkg/client/config", - "sigs.k8s.io/controller-runtime/pkg/controller", - "sigs.k8s.io/controller-runtime/pkg/handler", - "sigs.k8s.io/controller-runtime/pkg/manager", - "sigs.k8s.io/controller-runtime/pkg/runtime/signals", - "sigs.k8s.io/controller-runtime/pkg/source", - "sigs.k8s.io/testing_frameworks/integration", # for integration testing - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1", - ] - -[prune] - go-tests = true - - -# STANZAS BELOW ARE GENERATED AND MAY BE WRITTEN - DO NOT MODIFY BELOW THIS LINE. - -[[constraint]] - name="sigs.k8s.io/controller-runtime" - branch="master" - -[[constraint]] - name="sigs.k8s.io/controller-tools" - branch="master" - -# For dependency below: Refer to issue https://github.com/golang/dep/issues/1799 -[[override]] -name = "gopkg.in/fsnotify.v1" -source = "https://github.com/fsnotify/fsnotify.git" -version="v1.4.7" diff --git a/test/project_v2/PROJECT b/test/project_v2/PROJECT deleted file mode 100644 index b97784fca30..00000000000 --- a/test/project_v2/PROJECT +++ /dev/null @@ -1,3 +0,0 @@ -version: "2" -domain: testproject.org -repo: sigs.k8s.io/kubebuilder/test/project_v2 diff --git a/test/project_v2/api/doc.go b/test/project_v2/api/doc.go deleted file mode 100644 index 7d5b2179ea3..00000000000 --- a/test/project_v2/api/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2019 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. -*/ - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -package api diff --git a/test/project_v2/api/zz_generated.deepcopy.go b/test/project_v2/api/zz_generated.deepcopy.go deleted file mode 100644 index 33662b4edbd..00000000000 --- a/test/project_v2/api/zz_generated.deepcopy.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2019 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 main. DO NOT EDIT. - -package api diff --git a/test/project_v2/config/manager/kustomization.yaml b/test/project_v2/config/manager/kustomization.yaml deleted file mode 100644 index 88fe4ced612..00000000000 --- a/test/project_v2/config/manager/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -resources: -- manager.yaml - -# the following config is for teaching kustomize how to do var substitution -vars: -- name: NAMESPACE - objref: - kind: Service - version: v1 - name: webhook-service - fieldref: - fieldpath: metadata.namespace -- name: SERVICENAME - objref: - kind: Service - version: v1 - name: webhook-service diff --git a/test/project_v2/config/rbac/kustomization.yaml b/test/project_v2/config/rbac/kustomization.yaml deleted file mode 100644 index 8c6d6a5b93c..00000000000 --- a/test/project_v2/config/rbac/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -resources: -- rbac_role.yaml -- rbac_role_binding.yaml - # Comment the following 3 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 diff --git a/test/project_v2/config/webhook/kustomization.yaml b/test/project_v2/config/webhook/kustomization.yaml deleted file mode 100644 index c7d33c1d93c..00000000000 --- a/test/project_v2/config/webhook/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -resources: -- webhookmanifests.yaml - -configurations: -- kustomizeconfig.yaml diff --git a/test/vendor.v1.tgz b/test/vendor.v1.tgz deleted file mode 100644 index 0351b06694f..00000000000 --- a/test/vendor.v1.tgz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e9fc5c60c38251b905074773101e142056b8079fe29719109fc003cebeeec7f -size 29092286 diff --git a/test/vendor.v2.tgz b/test/vendor.v2.tgz deleted file mode 100644 index 5660bb517b5..00000000000 --- a/test/vendor.v2.tgz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c2b4b9eafaee7841d434d235a6d47f1bb1903bf0c2bca8ca0d92235d422f334 -size 29083894 diff --git a/test/project/.gitignore b/testdata/gopath/src/project/.gitignore similarity index 100% rename from test/project/.gitignore rename to testdata/gopath/src/project/.gitignore diff --git a/test/project/Dockerfile b/testdata/gopath/src/project/Dockerfile similarity index 63% rename from test/project/Dockerfile rename to testdata/gopath/src/project/Dockerfile index 670db6783a8..62d28876d1d 100644 --- a/test/project/Dockerfile +++ b/testdata/gopath/src/project/Dockerfile @@ -2,16 +2,16 @@ FROM golang:1.10.3 as builder # Copy in the go src -WORKDIR /go/src/sigs.k8s.io/kubebuilder/test/project +WORKDIR /go/src/project COPY cmd/ cmd/ COPY vendor/ vendor/ COPY pkg/ pkg/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager sigs.k8s.io/kubebuilder/test/project/cmd/manager +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager project/cmd/manager # Copy the controller-manager into a thin image FROM ubuntu:latest WORKDIR / -COPY --from=builder /go/src/sigs.k8s.io/kubebuilder/test/project/manager . +COPY --from=builder /go/src/project/manager . ENTRYPOINT ["/manager"] diff --git a/test/project/Gopkg.toml b/testdata/gopath/src/project/Gopkg.toml similarity index 98% rename from test/project/Gopkg.toml rename to testdata/gopath/src/project/Gopkg.toml index 7cca82d4879..8ee09333625 100644 --- a/test/project/Gopkg.toml +++ b/testdata/gopath/src/project/Gopkg.toml @@ -24,7 +24,7 @@ required = [ [[constraint]] name="sigs.k8s.io/controller-runtime" - version="v0.1.1" + version="v0.1.8" [[constraint]] name="sigs.k8s.io/controller-tools" diff --git a/test/project/Makefile b/testdata/gopath/src/project/Makefile similarity index 94% rename from test/project/Makefile rename to testdata/gopath/src/project/Makefile index ffde418d820..d81a7b1cf7c 100644 --- a/test/project/Makefile +++ b/testdata/gopath/src/project/Makefile @@ -10,7 +10,7 @@ test: generate fmt vet manifests # Build manager binary manager: generate fmt vet - go build -o bin/manager sigs.k8s.io/kubebuilder/test/project/cmd/manager + go build -o bin/manager project/cmd/manager # Run against the configured Kubernetes cluster in ~/.kube/config run: generate fmt vet diff --git a/testdata/gopath/src/project/PROJECT b/testdata/gopath/src/project/PROJECT new file mode 100644 index 00000000000..aea2c0f15be --- /dev/null +++ b/testdata/gopath/src/project/PROJECT @@ -0,0 +1,3 @@ +version: "1" +domain: testproject.org +repo: project diff --git a/test/project/cmd/manager/main.go b/testdata/gopath/src/project/cmd/manager/main.go similarity index 93% rename from test/project/cmd/manager/main.go rename to testdata/gopath/src/project/cmd/manager/main.go index d688e996f4c..7bfd7b39406 100644 --- a/test/project/cmd/manager/main.go +++ b/testdata/gopath/src/project/cmd/manager/main.go @@ -20,14 +20,15 @@ import ( "flag" "os" + "project/pkg/apis" + "project/pkg/controller" + "project/pkg/webhook" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/runtime/signals" - "sigs.k8s.io/kubebuilder/test/project/pkg/apis" - "sigs.k8s.io/kubebuilder/test/project/pkg/controller" - "sigs.k8s.io/kubebuilder/test/project/pkg/webhook" ) func main() { diff --git a/test/project/config/crds/creatures_v2alpha1_kraken.yaml b/testdata/gopath/src/project/config/crds/creatures_v2alpha1_kraken.yaml similarity index 100% rename from test/project/config/crds/creatures_v2alpha1_kraken.yaml rename to testdata/gopath/src/project/config/crds/creatures_v2alpha1_kraken.yaml diff --git a/test/project/config/crds/crew_v1_firstmate.yaml b/testdata/gopath/src/project/config/crds/crew_v1_firstmate.yaml similarity index 100% rename from test/project/config/crds/crew_v1_firstmate.yaml rename to testdata/gopath/src/project/config/crds/crew_v1_firstmate.yaml diff --git a/test/project/config/crds/policy_v1beta1_healthcheckpolicy.yaml b/testdata/gopath/src/project/config/crds/policy_v1beta1_healthcheckpolicy.yaml similarity index 100% rename from test/project/config/crds/policy_v1beta1_healthcheckpolicy.yaml rename to testdata/gopath/src/project/config/crds/policy_v1beta1_healthcheckpolicy.yaml diff --git a/test/project/config/crds/ship_v1beta1_frigate.yaml b/testdata/gopath/src/project/config/crds/ship_v1beta1_frigate.yaml similarity index 100% rename from test/project/config/crds/ship_v1beta1_frigate.yaml rename to testdata/gopath/src/project/config/crds/ship_v1beta1_frigate.yaml diff --git a/test/project/config/default/kustomization.yaml b/testdata/gopath/src/project/config/default/kustomization.yaml similarity index 100% rename from test/project/config/default/kustomization.yaml rename to testdata/gopath/src/project/config/default/kustomization.yaml diff --git a/test/project/config/default/manager_auth_proxy_patch.yaml b/testdata/gopath/src/project/config/default/manager_auth_proxy_patch.yaml similarity index 100% rename from test/project/config/default/manager_auth_proxy_patch.yaml rename to testdata/gopath/src/project/config/default/manager_auth_proxy_patch.yaml diff --git a/test/project/config/default/manager_image_patch.yaml b/testdata/gopath/src/project/config/default/manager_image_patch.yaml similarity index 100% rename from test/project/config/default/manager_image_patch.yaml rename to testdata/gopath/src/project/config/default/manager_image_patch.yaml diff --git a/test/project/config/default/manager_prometheus_metrics_patch.yaml b/testdata/gopath/src/project/config/default/manager_prometheus_metrics_patch.yaml similarity index 100% rename from test/project/config/default/manager_prometheus_metrics_patch.yaml rename to testdata/gopath/src/project/config/default/manager_prometheus_metrics_patch.yaml diff --git a/test/project/config/manager/kustomization.yaml b/testdata/gopath/src/project/config/manager/kustomization.yaml similarity index 100% rename from test/project/config/manager/kustomization.yaml rename to testdata/gopath/src/project/config/manager/kustomization.yaml diff --git a/test/project/config/manager/manager.yaml b/testdata/gopath/src/project/config/manager/manager.yaml similarity index 100% rename from test/project/config/manager/manager.yaml rename to testdata/gopath/src/project/config/manager/manager.yaml diff --git a/test/project/config/rbac/auth_proxy_role.yaml b/testdata/gopath/src/project/config/rbac/auth_proxy_role.yaml similarity index 100% rename from test/project/config/rbac/auth_proxy_role.yaml rename to testdata/gopath/src/project/config/rbac/auth_proxy_role.yaml diff --git a/test/project/config/rbac/auth_proxy_role_binding.yaml b/testdata/gopath/src/project/config/rbac/auth_proxy_role_binding.yaml similarity index 100% rename from test/project/config/rbac/auth_proxy_role_binding.yaml rename to testdata/gopath/src/project/config/rbac/auth_proxy_role_binding.yaml diff --git a/test/project/config/rbac/auth_proxy_service.yaml b/testdata/gopath/src/project/config/rbac/auth_proxy_service.yaml similarity index 100% rename from test/project/config/rbac/auth_proxy_service.yaml rename to testdata/gopath/src/project/config/rbac/auth_proxy_service.yaml diff --git a/test/project/config/rbac/kustomization.yaml b/testdata/gopath/src/project/config/rbac/kustomization.yaml similarity index 100% rename from test/project/config/rbac/kustomization.yaml rename to testdata/gopath/src/project/config/rbac/kustomization.yaml diff --git a/test/project/config/rbac/rbac_role.yaml b/testdata/gopath/src/project/config/rbac/rbac_role.yaml similarity index 100% rename from test/project/config/rbac/rbac_role.yaml rename to testdata/gopath/src/project/config/rbac/rbac_role.yaml diff --git a/test/project/config/rbac/rbac_role_binding.yaml b/testdata/gopath/src/project/config/rbac/rbac_role_binding.yaml similarity index 100% rename from test/project/config/rbac/rbac_role_binding.yaml rename to testdata/gopath/src/project/config/rbac/rbac_role_binding.yaml diff --git a/test/project/config/samples/creatures_v2alpha1_kraken.yaml b/testdata/gopath/src/project/config/samples/creatures_v2alpha1_kraken.yaml similarity index 100% rename from test/project/config/samples/creatures_v2alpha1_kraken.yaml rename to testdata/gopath/src/project/config/samples/creatures_v2alpha1_kraken.yaml diff --git a/test/project/config/samples/crew_v1_firstmate.yaml b/testdata/gopath/src/project/config/samples/crew_v1_firstmate.yaml similarity index 100% rename from test/project/config/samples/crew_v1_firstmate.yaml rename to testdata/gopath/src/project/config/samples/crew_v1_firstmate.yaml diff --git a/test/project/config/samples/policy_v1beta1_healthcheckpolicy.yaml b/testdata/gopath/src/project/config/samples/policy_v1beta1_healthcheckpolicy.yaml similarity index 100% rename from test/project/config/samples/policy_v1beta1_healthcheckpolicy.yaml rename to testdata/gopath/src/project/config/samples/policy_v1beta1_healthcheckpolicy.yaml diff --git a/test/project/config/samples/ship_v1beta1_frigate.yaml b/testdata/gopath/src/project/config/samples/ship_v1beta1_frigate.yaml similarity index 100% rename from test/project/config/samples/ship_v1beta1_frigate.yaml rename to testdata/gopath/src/project/config/samples/ship_v1beta1_frigate.yaml diff --git a/test/project/hack/boilerplate.go.txt b/testdata/gopath/src/project/hack/boilerplate.go.txt similarity index 100% rename from test/project/hack/boilerplate.go.txt rename to testdata/gopath/src/project/hack/boilerplate.go.txt diff --git a/test/project/pkg/apis/addtoscheme_creatures_v2alpha1.go b/testdata/gopath/src/project/pkg/apis/addtoscheme_creatures_v2alpha1.go similarity index 83% rename from test/project/pkg/apis/addtoscheme_creatures_v2alpha1.go rename to testdata/gopath/src/project/pkg/apis/addtoscheme_creatures_v2alpha1.go index e74af37903d..cb39b93d491 100644 --- a/test/project/pkg/apis/addtoscheme_creatures_v2alpha1.go +++ b/testdata/gopath/src/project/pkg/apis/addtoscheme_creatures_v2alpha1.go @@ -17,10 +17,10 @@ limitations under the License. package apis import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures/v2alpha1" + api "project/pkg/apis/creatures/v2alpha1" ) func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v2alpha1.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, api.SchemeBuilder.AddToScheme) } diff --git a/test/project/pkg/apis/addtoscheme_crew_v1.go b/testdata/gopath/src/project/pkg/apis/addtoscheme_crew_v1.go similarity index 85% rename from test/project/pkg/apis/addtoscheme_crew_v1.go rename to testdata/gopath/src/project/pkg/apis/addtoscheme_crew_v1.go index 8d1467f3201..f439e8864a3 100644 --- a/test/project/pkg/apis/addtoscheme_crew_v1.go +++ b/testdata/gopath/src/project/pkg/apis/addtoscheme_crew_v1.go @@ -17,10 +17,10 @@ limitations under the License. package apis import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" + api "project/pkg/apis/crew/v1" ) func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, api.SchemeBuilder.AddToScheme) } diff --git a/test/project/pkg/apis/addtoscheme_policy_v1beta1.go b/testdata/gopath/src/project/pkg/apis/addtoscheme_policy_v1beta1.go similarity index 84% rename from test/project/pkg/apis/addtoscheme_policy_v1beta1.go rename to testdata/gopath/src/project/pkg/apis/addtoscheme_policy_v1beta1.go index 0b871cd1ea2..4b13182ddea 100644 --- a/test/project/pkg/apis/addtoscheme_policy_v1beta1.go +++ b/testdata/gopath/src/project/pkg/apis/addtoscheme_policy_v1beta1.go @@ -17,10 +17,10 @@ limitations under the License. package apis import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy/v1beta1" + api "project/pkg/apis/policy/v1beta1" ) func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, api.SchemeBuilder.AddToScheme) } diff --git a/test/project/pkg/apis/addtoscheme_ship_v1beta1.go b/testdata/gopath/src/project/pkg/apis/addtoscheme_ship_v1beta1.go similarity index 84% rename from test/project/pkg/apis/addtoscheme_ship_v1beta1.go rename to testdata/gopath/src/project/pkg/apis/addtoscheme_ship_v1beta1.go index ff5946cde59..00e75610039 100644 --- a/test/project/pkg/apis/addtoscheme_ship_v1beta1.go +++ b/testdata/gopath/src/project/pkg/apis/addtoscheme_ship_v1beta1.go @@ -17,10 +17,10 @@ limitations under the License. package apis import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship/v1beta1" + api "project/pkg/apis/ship/v1beta1" ) func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, api.SchemeBuilder.AddToScheme) } diff --git a/test/project/pkg/apis/apis.go b/testdata/gopath/src/project/pkg/apis/apis.go similarity index 100% rename from test/project/pkg/apis/apis.go rename to testdata/gopath/src/project/pkg/apis/apis.go diff --git a/test/project/pkg/apis/creatures/group.go b/testdata/gopath/src/project/pkg/apis/creatures/group.go similarity index 100% rename from test/project/pkg/apis/creatures/group.go rename to testdata/gopath/src/project/pkg/apis/creatures/group.go diff --git a/test/project/pkg/apis/creatures/v2alpha1/doc.go b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/doc.go similarity index 91% rename from test/project/pkg/apis/creatures/v2alpha1/doc.go rename to testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/doc.go index f84382411ba..6fccc6cc03f 100644 --- a/test/project/pkg/apis/creatures/v2alpha1/doc.go +++ b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/doc.go @@ -17,7 +17,7 @@ limitations under the License. // Package v2alpha1 contains API Schema definitions for the creatures v2alpha1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures +// +k8s:conversion-gen=project/pkg/apis/creatures // +k8s:defaulter-gen=TypeMeta // +groupName=creatures.testproject.org package v2alpha1 diff --git a/test/project/pkg/apis/creatures/v2alpha1/kraken_types.go b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/kraken_types.go similarity index 100% rename from test/project/pkg/apis/creatures/v2alpha1/kraken_types.go rename to testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/kraken_types.go diff --git a/test/project/pkg/apis/creatures/v2alpha1/kraken_types_test.go b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/kraken_types_test.go similarity index 100% rename from test/project/pkg/apis/creatures/v2alpha1/kraken_types_test.go rename to testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/kraken_types_test.go diff --git a/test/project/pkg/apis/creatures/v2alpha1/register.go b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/register.go similarity index 95% rename from test/project/pkg/apis/creatures/v2alpha1/register.go rename to testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/register.go index bd6f96318f2..7115b4d2531 100644 --- a/test/project/pkg/apis/creatures/v2alpha1/register.go +++ b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/register.go @@ -19,7 +19,7 @@ limitations under the License. // Package v2alpha1 contains API Schema definitions for the creatures v2alpha1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures +// +k8s:conversion-gen=project/pkg/apis/creatures // +k8s:defaulter-gen=TypeMeta // +groupName=creatures.testproject.org package v2alpha1 diff --git a/test/project/pkg/apis/creatures/v2alpha1/v2alpha1_suite_test.go b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/v2alpha1_suite_test.go similarity index 100% rename from test/project/pkg/apis/creatures/v2alpha1/v2alpha1_suite_test.go rename to testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/v2alpha1_suite_test.go diff --git a/test/project/pkg/apis/creatures/v2alpha1/zz_generated.deepcopy.go b/testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/zz_generated.deepcopy.go similarity index 100% rename from test/project/pkg/apis/creatures/v2alpha1/zz_generated.deepcopy.go rename to testdata/gopath/src/project/pkg/apis/creatures/v2alpha1/zz_generated.deepcopy.go diff --git a/test/project/pkg/apis/crew/group.go b/testdata/gopath/src/project/pkg/apis/crew/group.go similarity index 100% rename from test/project/pkg/apis/crew/group.go rename to testdata/gopath/src/project/pkg/apis/crew/group.go diff --git a/test/project_v2/api/v1/doc.go b/testdata/gopath/src/project/pkg/apis/crew/v1/doc.go similarity index 91% rename from test/project_v2/api/v1/doc.go rename to testdata/gopath/src/project/pkg/apis/crew/v1/doc.go index 0e15f34fe2a..9038cdfcc10 100644 --- a/test/project_v2/api/v1/doc.go +++ b/testdata/gopath/src/project/pkg/apis/crew/v1/doc.go @@ -17,7 +17,7 @@ limitations under the License. // Package v1 contains API Schema definitions for the crew v1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project_v2/api/v1 +// +k8s:conversion-gen=project/pkg/apis/crew // +k8s:defaulter-gen=TypeMeta // +groupName=crew.testproject.org package v1 diff --git a/test/project/pkg/apis/crew/v1/firstmate_types.go b/testdata/gopath/src/project/pkg/apis/crew/v1/firstmate_types.go similarity index 100% rename from test/project/pkg/apis/crew/v1/firstmate_types.go rename to testdata/gopath/src/project/pkg/apis/crew/v1/firstmate_types.go diff --git a/test/project/pkg/apis/crew/v1/firstmate_types_test.go b/testdata/gopath/src/project/pkg/apis/crew/v1/firstmate_types_test.go similarity index 100% rename from test/project/pkg/apis/crew/v1/firstmate_types_test.go rename to testdata/gopath/src/project/pkg/apis/crew/v1/firstmate_types_test.go diff --git a/test/project/pkg/apis/crew/v1/register.go b/testdata/gopath/src/project/pkg/apis/crew/v1/register.go similarity index 95% rename from test/project/pkg/apis/crew/v1/register.go rename to testdata/gopath/src/project/pkg/apis/crew/v1/register.go index 0ed612148da..b4ea0074955 100644 --- a/test/project/pkg/apis/crew/v1/register.go +++ b/testdata/gopath/src/project/pkg/apis/crew/v1/register.go @@ -19,7 +19,7 @@ limitations under the License. // Package v1 contains API Schema definitions for the crew v1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew +// +k8s:conversion-gen=project/pkg/apis/crew // +k8s:defaulter-gen=TypeMeta // +groupName=crew.testproject.org package v1 diff --git a/test/project/pkg/apis/crew/v1/v1_suite_test.go b/testdata/gopath/src/project/pkg/apis/crew/v1/v1_suite_test.go similarity index 100% rename from test/project/pkg/apis/crew/v1/v1_suite_test.go rename to testdata/gopath/src/project/pkg/apis/crew/v1/v1_suite_test.go diff --git a/test/project/pkg/apis/crew/v1/zz_generated.deepcopy.go b/testdata/gopath/src/project/pkg/apis/crew/v1/zz_generated.deepcopy.go similarity index 100% rename from test/project/pkg/apis/crew/v1/zz_generated.deepcopy.go rename to testdata/gopath/src/project/pkg/apis/crew/v1/zz_generated.deepcopy.go diff --git a/test/project/pkg/apis/policy/group.go b/testdata/gopath/src/project/pkg/apis/policy/group.go similarity index 100% rename from test/project/pkg/apis/policy/group.go rename to testdata/gopath/src/project/pkg/apis/policy/group.go diff --git a/test/project/pkg/apis/policy/v1beta1/doc.go b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/doc.go similarity index 91% rename from test/project/pkg/apis/policy/v1beta1/doc.go rename to testdata/gopath/src/project/pkg/apis/policy/v1beta1/doc.go index 7cc13e0ce1e..e9552a4d6dd 100644 --- a/test/project/pkg/apis/policy/v1beta1/doc.go +++ b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/doc.go @@ -17,7 +17,7 @@ limitations under the License. // Package v1beta1 contains API Schema definitions for the policy v1beta1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy +// +k8s:conversion-gen=project/pkg/apis/policy // +k8s:defaulter-gen=TypeMeta // +groupName=policy.testproject.org package v1beta1 diff --git a/test/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types.go b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types.go similarity index 100% rename from test/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types.go rename to testdata/gopath/src/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types.go diff --git a/test/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types_test.go b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types_test.go similarity index 100% rename from test/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types_test.go rename to testdata/gopath/src/project/pkg/apis/policy/v1beta1/healthcheckpolicy_types_test.go diff --git a/test/project/pkg/apis/policy/v1beta1/register.go b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/register.go similarity index 95% rename from test/project/pkg/apis/policy/v1beta1/register.go rename to testdata/gopath/src/project/pkg/apis/policy/v1beta1/register.go index 670db62bfd2..08a773e4037 100644 --- a/test/project/pkg/apis/policy/v1beta1/register.go +++ b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/register.go @@ -19,7 +19,7 @@ limitations under the License. // Package v1beta1 contains API Schema definitions for the policy v1beta1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy +// +k8s:conversion-gen=project/pkg/apis/policy // +k8s:defaulter-gen=TypeMeta // +groupName=policy.testproject.org package v1beta1 diff --git a/test/project/pkg/apis/policy/v1beta1/v1beta1_suite_test.go b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/v1beta1_suite_test.go similarity index 100% rename from test/project/pkg/apis/policy/v1beta1/v1beta1_suite_test.go rename to testdata/gopath/src/project/pkg/apis/policy/v1beta1/v1beta1_suite_test.go diff --git a/test/project/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go b/testdata/gopath/src/project/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go similarity index 100% rename from test/project/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go rename to testdata/gopath/src/project/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go diff --git a/test/project/pkg/apis/ship/group.go b/testdata/gopath/src/project/pkg/apis/ship/group.go similarity index 100% rename from test/project/pkg/apis/ship/group.go rename to testdata/gopath/src/project/pkg/apis/ship/group.go diff --git a/test/project/pkg/apis/ship/v1beta1/doc.go b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/doc.go similarity index 91% rename from test/project/pkg/apis/ship/v1beta1/doc.go rename to testdata/gopath/src/project/pkg/apis/ship/v1beta1/doc.go index 5ffa8893348..394743645ef 100644 --- a/test/project/pkg/apis/ship/v1beta1/doc.go +++ b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/doc.go @@ -17,7 +17,7 @@ limitations under the License. // Package v1beta1 contains API Schema definitions for the ship v1beta1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship +// +k8s:conversion-gen=project/pkg/apis/ship // +k8s:defaulter-gen=TypeMeta // +groupName=ship.testproject.org package v1beta1 diff --git a/test/project/pkg/apis/ship/v1beta1/frigate_types.go b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/frigate_types.go similarity index 100% rename from test/project/pkg/apis/ship/v1beta1/frigate_types.go rename to testdata/gopath/src/project/pkg/apis/ship/v1beta1/frigate_types.go diff --git a/test/project/pkg/apis/ship/v1beta1/frigate_types_test.go b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/frigate_types_test.go similarity index 100% rename from test/project/pkg/apis/ship/v1beta1/frigate_types_test.go rename to testdata/gopath/src/project/pkg/apis/ship/v1beta1/frigate_types_test.go diff --git a/test/project/pkg/apis/ship/v1beta1/register.go b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/register.go similarity index 95% rename from test/project/pkg/apis/ship/v1beta1/register.go rename to testdata/gopath/src/project/pkg/apis/ship/v1beta1/register.go index 9bc845a883a..be7ff757d50 100644 --- a/test/project/pkg/apis/ship/v1beta1/register.go +++ b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/register.go @@ -19,7 +19,7 @@ limitations under the License. // Package v1beta1 contains API Schema definitions for the ship v1beta1 API group // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship +// +k8s:conversion-gen=project/pkg/apis/ship // +k8s:defaulter-gen=TypeMeta // +groupName=ship.testproject.org package v1beta1 diff --git a/test/project/pkg/apis/ship/v1beta1/v1beta1_suite_test.go b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/v1beta1_suite_test.go similarity index 100% rename from test/project/pkg/apis/ship/v1beta1/v1beta1_suite_test.go rename to testdata/gopath/src/project/pkg/apis/ship/v1beta1/v1beta1_suite_test.go diff --git a/test/project/pkg/apis/ship/v1beta1/zz_generated.deepcopy.go b/testdata/gopath/src/project/pkg/apis/ship/v1beta1/zz_generated.deepcopy.go similarity index 100% rename from test/project/pkg/apis/ship/v1beta1/zz_generated.deepcopy.go rename to testdata/gopath/src/project/pkg/apis/ship/v1beta1/zz_generated.deepcopy.go diff --git a/test/project/pkg/controller/add_firstmate.go b/testdata/gopath/src/project/pkg/controller/add_firstmate.go similarity index 92% rename from test/project/pkg/controller/add_firstmate.go rename to testdata/gopath/src/project/pkg/controller/add_firstmate.go index 0dad95c8961..38a5be6699d 100644 --- a/test/project/pkg/controller/add_firstmate.go +++ b/testdata/gopath/src/project/pkg/controller/add_firstmate.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/controller/firstmate" + "project/pkg/controller/firstmate" ) func init() { diff --git a/test/project/pkg/controller/add_frigate.go b/testdata/gopath/src/project/pkg/controller/add_frigate.go similarity index 92% rename from test/project/pkg/controller/add_frigate.go rename to testdata/gopath/src/project/pkg/controller/add_frigate.go index 17a2501a5f5..04a22e08543 100644 --- a/test/project/pkg/controller/add_frigate.go +++ b/testdata/gopath/src/project/pkg/controller/add_frigate.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/controller/frigate" + "project/pkg/controller/frigate" ) func init() { diff --git a/test/project/pkg/controller/add_healthcheckpolicy.go b/testdata/gopath/src/project/pkg/controller/add_healthcheckpolicy.go similarity index 91% rename from test/project/pkg/controller/add_healthcheckpolicy.go rename to testdata/gopath/src/project/pkg/controller/add_healthcheckpolicy.go index 39298b5dd2a..ab6c4d075f4 100644 --- a/test/project/pkg/controller/add_healthcheckpolicy.go +++ b/testdata/gopath/src/project/pkg/controller/add_healthcheckpolicy.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/controller/healthcheckpolicy" + "project/pkg/controller/healthcheckpolicy" ) func init() { diff --git a/test/project/pkg/controller/add_kraken.go b/testdata/gopath/src/project/pkg/controller/add_kraken.go similarity index 92% rename from test/project/pkg/controller/add_kraken.go rename to testdata/gopath/src/project/pkg/controller/add_kraken.go index d804c5b4adf..379900045dc 100644 --- a/test/project/pkg/controller/add_kraken.go +++ b/testdata/gopath/src/project/pkg/controller/add_kraken.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/controller/kraken" + "project/pkg/controller/kraken" ) func init() { diff --git a/test/project/pkg/controller/add_namespace.go b/testdata/gopath/src/project/pkg/controller/add_namespace.go similarity index 92% rename from test/project/pkg/controller/add_namespace.go rename to testdata/gopath/src/project/pkg/controller/add_namespace.go index 0a2710f78ed..e8031836122 100644 --- a/test/project/pkg/controller/add_namespace.go +++ b/testdata/gopath/src/project/pkg/controller/add_namespace.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/kubebuilder/test/project/pkg/controller/namespace" + "project/pkg/controller/namespace" ) func init() { diff --git a/test/project/pkg/controller/controller.go b/testdata/gopath/src/project/pkg/controller/controller.go similarity index 100% rename from test/project/pkg/controller/controller.go rename to testdata/gopath/src/project/pkg/controller/controller.go diff --git a/test/project/pkg/controller/firstmate/firstmate_controller.go b/testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller.go similarity index 98% rename from test/project/pkg/controller/firstmate/firstmate_controller.go rename to testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller.go index f56e134a3dc..ad01a75d8de 100644 --- a/test/project/pkg/controller/firstmate/firstmate_controller.go +++ b/testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller.go @@ -20,6 +20,8 @@ import ( "context" "reflect" + crewv1 "project/pkg/apis/crew/v1" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -34,7 +36,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/source" - crewv1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" ) var log = logf.Log.WithName("firstmate-controller") diff --git a/test/project/pkg/controller/firstmate/firstmate_controller_suite_test.go b/testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller_suite_test.go similarity index 97% rename from test/project/pkg/controller/firstmate/firstmate_controller_suite_test.go rename to testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller_suite_test.go index fedeaabfa7b..0e945229b89 100644 --- a/test/project/pkg/controller/firstmate/firstmate_controller_suite_test.go +++ b/testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller_suite_test.go @@ -23,13 +23,14 @@ import ( "sync" "testing" + "project/pkg/apis" + "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/kubebuilder/test/project/pkg/apis" ) var cfg *rest.Config diff --git a/test/project/pkg/controller/firstmate/firstmate_controller_test.go b/testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller_test.go similarity index 98% rename from test/project/pkg/controller/firstmate/firstmate_controller_test.go rename to testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller_test.go index e204fc3c301..7018ebd15ad 100644 --- a/test/project/pkg/controller/firstmate/firstmate_controller_test.go +++ b/testdata/gopath/src/project/pkg/controller/firstmate/firstmate_controller_test.go @@ -20,6 +20,8 @@ import ( "testing" "time" + crewv1 "project/pkg/apis/crew/v1" + "github.com/onsi/gomega" "golang.org/x/net/context" appsv1 "k8s.io/api/apps/v1" @@ -29,7 +31,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - crewv1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" ) var c client.Client diff --git a/test/project/pkg/controller/frigate/frigate_controller.go b/testdata/gopath/src/project/pkg/controller/frigate/frigate_controller.go similarity index 98% rename from test/project/pkg/controller/frigate/frigate_controller.go rename to testdata/gopath/src/project/pkg/controller/frigate/frigate_controller.go index 05adaa788b4..252b2c7a87f 100644 --- a/test/project/pkg/controller/frigate/frigate_controller.go +++ b/testdata/gopath/src/project/pkg/controller/frigate/frigate_controller.go @@ -19,6 +19,8 @@ package frigate import ( "context" + shipv1beta1 "project/pkg/apis/ship/v1beta1" + appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -28,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - shipv1beta1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship/v1beta1" ) /** diff --git a/test/project/pkg/controller/frigate/frigate_controller_suite_test.go b/testdata/gopath/src/project/pkg/controller/frigate/frigate_controller_suite_test.go similarity index 97% rename from test/project/pkg/controller/frigate/frigate_controller_suite_test.go rename to testdata/gopath/src/project/pkg/controller/frigate/frigate_controller_suite_test.go index 5a5a4193507..a5a0520c272 100644 --- a/test/project/pkg/controller/frigate/frigate_controller_suite_test.go +++ b/testdata/gopath/src/project/pkg/controller/frigate/frigate_controller_suite_test.go @@ -23,13 +23,14 @@ import ( "sync" "testing" + "project/pkg/apis" + "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/kubebuilder/test/project/pkg/apis" ) var cfg *rest.Config diff --git a/test/project/pkg/controller/frigate/frigate_controller_test.go b/testdata/gopath/src/project/pkg/controller/frigate/frigate_controller_test.go similarity index 96% rename from test/project/pkg/controller/frigate/frigate_controller_test.go rename to testdata/gopath/src/project/pkg/controller/frigate/frigate_controller_test.go index ba721c75539..39855392f4a 100644 --- a/test/project/pkg/controller/frigate/frigate_controller_test.go +++ b/testdata/gopath/src/project/pkg/controller/frigate/frigate_controller_test.go @@ -20,6 +20,8 @@ import ( "testing" "time" + shipv1beta1 "project/pkg/apis/ship/v1beta1" + "github.com/onsi/gomega" "golang.org/x/net/context" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -28,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - shipv1beta1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship/v1beta1" ) var c client.Client diff --git a/test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go b/testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go similarity index 98% rename from test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go rename to testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go index 91ee0476985..90b7ba49886 100644 --- a/test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go +++ b/testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller.go @@ -19,6 +19,8 @@ package healthcheckpolicy import ( "context" + policyv1beta1 "project/pkg/apis/policy/v1beta1" + appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -28,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - policyv1beta1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy/v1beta1" ) /** diff --git a/test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go b/testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go similarity index 97% rename from test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go rename to testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go index 187facf934e..add9e6660a7 100644 --- a/test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go +++ b/testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_suite_test.go @@ -23,13 +23,14 @@ import ( "sync" "testing" + "project/pkg/apis" + "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/kubebuilder/test/project/pkg/apis" ) var cfg *rest.Config diff --git a/test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go b/testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go similarity index 96% rename from test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go rename to testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go index 1dc815348f9..7dfe9c45491 100644 --- a/test/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go +++ b/testdata/gopath/src/project/pkg/controller/healthcheckpolicy/healthcheckpolicy_controller_test.go @@ -20,6 +20,8 @@ import ( "testing" "time" + policyv1beta1 "project/pkg/apis/policy/v1beta1" + "github.com/onsi/gomega" "golang.org/x/net/context" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -28,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - policyv1beta1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy/v1beta1" ) var c client.Client diff --git a/test/project/pkg/controller/kraken/kraken_controller.go b/testdata/gopath/src/project/pkg/controller/kraken/kraken_controller.go similarity index 97% rename from test/project/pkg/controller/kraken/kraken_controller.go rename to testdata/gopath/src/project/pkg/controller/kraken/kraken_controller.go index 83a2a9c8e80..cc593f7fbac 100644 --- a/test/project/pkg/controller/kraken/kraken_controller.go +++ b/testdata/gopath/src/project/pkg/controller/kraken/kraken_controller.go @@ -19,6 +19,8 @@ package kraken import ( "context" + creaturesv2alpha1 "project/pkg/apis/creatures/v2alpha1" + appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -28,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - creaturesv2alpha1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures/v2alpha1" ) /** diff --git a/test/project/pkg/controller/kraken/kraken_controller_suite_test.go b/testdata/gopath/src/project/pkg/controller/kraken/kraken_controller_suite_test.go similarity index 97% rename from test/project/pkg/controller/kraken/kraken_controller_suite_test.go rename to testdata/gopath/src/project/pkg/controller/kraken/kraken_controller_suite_test.go index 6b2e3005f79..8842fb16bed 100644 --- a/test/project/pkg/controller/kraken/kraken_controller_suite_test.go +++ b/testdata/gopath/src/project/pkg/controller/kraken/kraken_controller_suite_test.go @@ -23,13 +23,14 @@ import ( "sync" "testing" + "project/pkg/apis" + "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/kubebuilder/test/project/pkg/apis" ) var cfg *rest.Config diff --git a/test/project/pkg/controller/kraken/kraken_controller_test.go b/testdata/gopath/src/project/pkg/controller/kraken/kraken_controller_test.go similarity index 96% rename from test/project/pkg/controller/kraken/kraken_controller_test.go rename to testdata/gopath/src/project/pkg/controller/kraken/kraken_controller_test.go index 42a88da231f..01cc3f120d5 100644 --- a/test/project/pkg/controller/kraken/kraken_controller_test.go +++ b/testdata/gopath/src/project/pkg/controller/kraken/kraken_controller_test.go @@ -20,6 +20,8 @@ import ( "testing" "time" + creaturesv2alpha1 "project/pkg/apis/creatures/v2alpha1" + "github.com/onsi/gomega" "golang.org/x/net/context" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -28,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - creaturesv2alpha1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures/v2alpha1" ) var c client.Client diff --git a/test/project/pkg/controller/namespace/namespace_controller.go b/testdata/gopath/src/project/pkg/controller/namespace/namespace_controller.go similarity index 100% rename from test/project/pkg/controller/namespace/namespace_controller.go rename to testdata/gopath/src/project/pkg/controller/namespace/namespace_controller.go diff --git a/test/project/pkg/controller/namespace/namespace_controller_suite_test.go b/testdata/gopath/src/project/pkg/controller/namespace/namespace_controller_suite_test.go similarity index 97% rename from test/project/pkg/controller/namespace/namespace_controller_suite_test.go rename to testdata/gopath/src/project/pkg/controller/namespace/namespace_controller_suite_test.go index 4dd255b9f74..0d7ccaaf386 100644 --- a/test/project/pkg/controller/namespace/namespace_controller_suite_test.go +++ b/testdata/gopath/src/project/pkg/controller/namespace/namespace_controller_suite_test.go @@ -23,13 +23,14 @@ import ( "sync" "testing" + "project/pkg/apis" + "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/kubebuilder/test/project/pkg/apis" ) var cfg *rest.Config diff --git a/test/project/pkg/controller/namespace/namespace_controller_test.go b/testdata/gopath/src/project/pkg/controller/namespace/namespace_controller_test.go similarity index 100% rename from test/project/pkg/controller/namespace/namespace_controller_test.go rename to testdata/gopath/src/project/pkg/controller/namespace/namespace_controller_test.go diff --git a/test/project/pkg/webhook/add_default_server.go b/testdata/gopath/src/project/pkg/webhook/add_default_server.go similarity index 91% rename from test/project/pkg/webhook/add_default_server.go rename to testdata/gopath/src/project/pkg/webhook/add_default_server.go index 79c2fc3f558..c31313fa718 100644 --- a/test/project/pkg/webhook/add_default_server.go +++ b/testdata/gopath/src/project/pkg/webhook/add_default_server.go @@ -17,7 +17,7 @@ limitations under the License. package webhook import ( - server "sigs.k8s.io/kubebuilder/test/project/pkg/webhook/default_server" + server "project/pkg/webhook/default_server" ) func init() { diff --git a/test/project/pkg/webhook/default_server/add_mutating_firstmate.go b/testdata/gopath/src/project/pkg/webhook/default_server/add_mutating_firstmate.go similarity index 93% rename from test/project/pkg/webhook/default_server/add_mutating_firstmate.go rename to testdata/gopath/src/project/pkg/webhook/default_server/add_mutating_firstmate.go index a7e9e29b0df..03f7b197345 100644 --- a/test/project/pkg/webhook/default_server/add_mutating_firstmate.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/add_mutating_firstmate.go @@ -19,7 +19,7 @@ package defaultserver import ( "fmt" - "sigs.k8s.io/kubebuilder/test/project/pkg/webhook/default_server/firstmate/mutating" + "project/pkg/webhook/default_server/firstmate/mutating" ) func init() { diff --git a/test/project/pkg/webhook/default_server/add_mutating_namespace.go b/testdata/gopath/src/project/pkg/webhook/default_server/add_mutating_namespace.go similarity index 93% rename from test/project/pkg/webhook/default_server/add_mutating_namespace.go rename to testdata/gopath/src/project/pkg/webhook/default_server/add_mutating_namespace.go index fa5d58821aa..e3278f52093 100644 --- a/test/project/pkg/webhook/default_server/add_mutating_namespace.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/add_mutating_namespace.go @@ -19,7 +19,7 @@ package defaultserver import ( "fmt" - "sigs.k8s.io/kubebuilder/test/project/pkg/webhook/default_server/namespace/mutating" + "project/pkg/webhook/default_server/namespace/mutating" ) func init() { diff --git a/test/project/pkg/webhook/default_server/add_validating_frigate.go b/testdata/gopath/src/project/pkg/webhook/default_server/add_validating_frigate.go similarity index 93% rename from test/project/pkg/webhook/default_server/add_validating_frigate.go rename to testdata/gopath/src/project/pkg/webhook/default_server/add_validating_frigate.go index e16f376dc3d..a7326f4bfaa 100644 --- a/test/project/pkg/webhook/default_server/add_validating_frigate.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/add_validating_frigate.go @@ -19,7 +19,7 @@ package defaultserver import ( "fmt" - "sigs.k8s.io/kubebuilder/test/project/pkg/webhook/default_server/frigate/validating" + "project/pkg/webhook/default_server/frigate/validating" ) func init() { diff --git a/test/project/pkg/webhook/default_server/add_validating_kraken.go b/testdata/gopath/src/project/pkg/webhook/default_server/add_validating_kraken.go similarity index 93% rename from test/project/pkg/webhook/default_server/add_validating_kraken.go rename to testdata/gopath/src/project/pkg/webhook/default_server/add_validating_kraken.go index 754d7aea145..aa996b27052 100644 --- a/test/project/pkg/webhook/default_server/add_validating_kraken.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/add_validating_kraken.go @@ -19,7 +19,7 @@ package defaultserver import ( "fmt" - "sigs.k8s.io/kubebuilder/test/project/pkg/webhook/default_server/kraken/validating" + "project/pkg/webhook/default_server/kraken/validating" ) func init() { diff --git a/test/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go similarity index 94% rename from test/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go rename to testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go index aff9db2113c..954a6b92927 100644 --- a/test/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/create_update_webhook.go @@ -17,9 +17,10 @@ limitations under the License. package mutating import ( + crewv1 "project/pkg/apis/crew/v1" + admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/builder" - crewv1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go similarity index 94% rename from test/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go rename to testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go index 7a5c0a26128..0134b85b848 100644 --- a/test/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/delete_webhook.go @@ -17,9 +17,10 @@ limitations under the License. package mutating import ( + crewv1 "project/pkg/apis/crew/v1" + admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/builder" - crewv1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go similarity index 97% rename from test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go rename to testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go index 44a22ffa160..fbbae7c861e 100644 --- a/test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go @@ -20,10 +20,11 @@ import ( "context" "net/http" + crewv1 "project/pkg/apis/crew/v1" + "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/types" - crewv1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go similarity index 97% rename from test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go rename to testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go index c4a58c30155..76d3d34199d 100644 --- a/test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go @@ -20,10 +20,11 @@ import ( "context" "net/http" + crewv1 "project/pkg/apis/crew/v1" + "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/types" - crewv1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew/v1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/firstmate/mutating/webhooks.go b/testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/webhooks.go similarity index 100% rename from test/project/pkg/webhook/default_server/firstmate/mutating/webhooks.go rename to testdata/gopath/src/project/pkg/webhook/default_server/firstmate/mutating/webhooks.go diff --git a/test/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go b/testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go similarity index 97% rename from test/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go rename to testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go index 44987efbbe5..68135f5ad7d 100644 --- a/test/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go @@ -20,10 +20,11 @@ import ( "context" "net/http" + shipv1beta1 "project/pkg/apis/ship/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/types" - shipv1beta1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship/v1beta1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/frigate/validating/update_webhook.go b/testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/update_webhook.go similarity index 93% rename from test/project/pkg/webhook/default_server/frigate/validating/update_webhook.go rename to testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/update_webhook.go index 1fcb8ac62fb..755ec3a6cfb 100644 --- a/test/project/pkg/webhook/default_server/frigate/validating/update_webhook.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/update_webhook.go @@ -17,9 +17,10 @@ limitations under the License. package validating import ( + shipv1beta1 "project/pkg/apis/ship/v1beta1" + admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/builder" - shipv1beta1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship/v1beta1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/frigate/validating/webhooks.go b/testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/webhooks.go similarity index 100% rename from test/project/pkg/webhook/default_server/frigate/validating/webhooks.go rename to testdata/gopath/src/project/pkg/webhook/default_server/frigate/validating/webhooks.go diff --git a/test/project/pkg/webhook/default_server/kraken/validating/create_webhook.go b/testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/create_webhook.go similarity index 92% rename from test/project/pkg/webhook/default_server/kraken/validating/create_webhook.go rename to testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/create_webhook.go index f7c4c5caa65..ebde74562e7 100644 --- a/test/project/pkg/webhook/default_server/kraken/validating/create_webhook.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/create_webhook.go @@ -17,9 +17,10 @@ limitations under the License. package validating import ( + creaturesv2alpha1 "project/pkg/apis/creatures/v2alpha1" + admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/builder" - creaturesv2alpha1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures/v2alpha1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go b/testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go similarity index 96% rename from test/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go rename to testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go index 500672f3cc1..61a46ff493a 100644 --- a/test/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go +++ b/testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go @@ -20,10 +20,11 @@ import ( "context" "net/http" + creaturesv2alpha1 "project/pkg/apis/creatures/v2alpha1" + "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/types" - creaturesv2alpha1 "sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures/v2alpha1" ) func init() { diff --git a/test/project/pkg/webhook/default_server/kraken/validating/webhooks.go b/testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/webhooks.go similarity index 100% rename from test/project/pkg/webhook/default_server/kraken/validating/webhooks.go rename to testdata/gopath/src/project/pkg/webhook/default_server/kraken/validating/webhooks.go diff --git a/test/project/pkg/webhook/default_server/namespace/mutating/namespace_update_handler.go b/testdata/gopath/src/project/pkg/webhook/default_server/namespace/mutating/namespace_update_handler.go similarity index 100% rename from test/project/pkg/webhook/default_server/namespace/mutating/namespace_update_handler.go rename to testdata/gopath/src/project/pkg/webhook/default_server/namespace/mutating/namespace_update_handler.go diff --git a/test/project/pkg/webhook/default_server/namespace/mutating/update_webhook.go b/testdata/gopath/src/project/pkg/webhook/default_server/namespace/mutating/update_webhook.go similarity index 100% rename from test/project/pkg/webhook/default_server/namespace/mutating/update_webhook.go rename to testdata/gopath/src/project/pkg/webhook/default_server/namespace/mutating/update_webhook.go diff --git a/test/project/pkg/webhook/default_server/namespace/mutating/webhooks.go b/testdata/gopath/src/project/pkg/webhook/default_server/namespace/mutating/webhooks.go similarity index 100% rename from test/project/pkg/webhook/default_server/namespace/mutating/webhooks.go rename to testdata/gopath/src/project/pkg/webhook/default_server/namespace/mutating/webhooks.go diff --git a/test/project/pkg/webhook/default_server/server.go b/testdata/gopath/src/project/pkg/webhook/default_server/server.go similarity index 100% rename from test/project/pkg/webhook/default_server/server.go rename to testdata/gopath/src/project/pkg/webhook/default_server/server.go diff --git a/test/project/pkg/webhook/webhook.go b/testdata/gopath/src/project/pkg/webhook/webhook.go similarity index 100% rename from test/project/pkg/webhook/webhook.go rename to testdata/gopath/src/project/pkg/webhook/webhook.go diff --git a/test/project_v2/.gitignore b/testdata/project_v2/.gitignore similarity index 100% rename from test/project_v2/.gitignore rename to testdata/project_v2/.gitignore diff --git a/test/project_v2/Dockerfile b/testdata/project_v2/Dockerfile similarity index 64% rename from test/project_v2/Dockerfile rename to testdata/project_v2/Dockerfile index 2c902c771c3..f011755b3b7 100644 --- a/test/project_v2/Dockerfile +++ b/testdata/project_v2/Dockerfile @@ -2,17 +2,17 @@ FROM golang:1.10.3 as builder # Copy in the go src -WORKDIR /go/src/sigs.k8s.io/kubebuilder/test/project_v2 +WORKDIR /go/src/sigs.k8s.io/kubebuilder/testdata/project_v2 COPY vendor/ vendor/ 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 sigs.k8s.io/kubebuilder/test/project_v2/ +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager sigs.k8s.io/kubebuilder/testdata/project_v2/ # Copy the controller-manager into a thin image FROM ubuntu:latest WORKDIR / -COPY --from=builder /go/src/sigs.k8s.io/kubebuilder/test/project_v2/manager . +COPY --from=builder /go/src/sigs.k8s.io/kubebuilder/testdata/project_v2/manager . ENTRYPOINT ["/manager"] diff --git a/test/project_v2/Makefile b/testdata/project_v2/Makefile similarity index 54% rename from test/project_v2/Makefile rename to testdata/project_v2/Makefile index ba971f07968..aba92d85b7b 100644 --- a/test/project_v2/Makefile +++ b/testdata/project_v2/Makefile @@ -1,8 +1,10 @@ # 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" -all: test manager +all: manager # Run tests test: generate fmt vet manifests @@ -18,34 +20,28 @@ run: generate fmt vet # Install CRDs into a cluster install: manifests - kubectl apply -f config/crds/bases + kubectl apply -f config/crd/bases # Deploy controller in the configured Kubernetes cluster in ~/.kube/config deploy: manifests - kubectl apply -f config/crds/bases + kubectl apply -f config/crd/bases kustomize build config/default | kubectl apply -f - # Generate manifests e.g. CRD, RBAC etc. -manifests: -# TODO(droot): controller-gen will require fix to take new api-path as input, so disabling this for now -# -# go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all --output-dir=config/crds/bases/ +manifests: controller-gen + $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./api/...;./controllers/..." output:crd:artifacts:config=config/crd/bases # Run go fmt against code fmt: - go fmt ./api/... ./controllers/... + go fmt ./... # Run go vet against code vet: - go vet ./api/... ./controllers/... + go vet ./... # Generate code -generate: -ifndef GOPATH - $(error GOPATH not defined, please define GOPATH. Run "go help gopath" to learn more about GOPATH) -endif - go run ./vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go -O zz_generated.deepcopy --go-header-file ./hack/boilerplate.go.txt -i ./api/... - +generate: controller-gen + $(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/... # Build the docker image docker-build: test @@ -56,3 +52,13 @@ docker-build: test # Push the docker image docker-push: docker push ${IMG} + +# find or download controller-gen +# download controller-gen if necessary +controller-gen: +ifeq (, $(shell which controller-gen)) + go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-alpha.1 +CONTROLLER_GEN=$(shell go env GOPATH)/bin/controller-gen +else +CONTROLLER_GEN=$(shell which controller-gen) +endif diff --git a/testdata/project_v2/PROJECT b/testdata/project_v2/PROJECT new file mode 100644 index 00000000000..e0028746535 --- /dev/null +++ b/testdata/project_v2/PROJECT @@ -0,0 +1,3 @@ +version: "2" +domain: testproject.org +repo: sigs.k8s.io/kubebuilder/testdata/project_v2 diff --git a/test/project_v2/api/v1/captain_types.go b/testdata/project_v2/api/v1/captain_types.go similarity index 90% rename from test/project_v2/api/v1/captain_types.go rename to testdata/project_v2/api/v1/captain_types.go index 540cd02553e..c09a61b9040 100644 --- a/test/project_v2/api/v1/captain_types.go +++ b/testdata/project_v2/api/v1/captain_types.go @@ -35,11 +35,9 @@ type CaptainStatus struct { // Important: Run "make" to regenerate code after modifying this file } -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true // Captain is the Schema for the captains API -// +k8s:openapi-gen=true type Captain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -48,7 +46,7 @@ type Captain struct { Status CaptainStatus `json:"status,omitempty"` } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true // CaptainList contains a list of Captain type CaptainList struct { diff --git a/test/project_v2/api/v1/firstmate_types.go b/testdata/project_v2/api/v1/firstmate_types.go similarity index 90% rename from test/project_v2/api/v1/firstmate_types.go rename to testdata/project_v2/api/v1/firstmate_types.go index e9e417c423c..1101d9eedee 100644 --- a/test/project_v2/api/v1/firstmate_types.go +++ b/testdata/project_v2/api/v1/firstmate_types.go @@ -35,11 +35,9 @@ type FirstMateStatus struct { // Important: Run "make" to regenerate code after modifying this file } -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true // FirstMate is the Schema for the firstmates API -// +k8s:openapi-gen=true type FirstMate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -48,7 +46,7 @@ type FirstMate struct { Status FirstMateStatus `json:"status,omitempty"` } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true // FirstMateList contains a list of FirstMate type FirstMateList struct { diff --git a/test/project_v2/api/v1/groupversion_info.go b/testdata/project_v2/api/v1/groupversion_info.go similarity index 87% rename from test/project_v2/api/v1/groupversion_info.go rename to testdata/project_v2/api/v1/groupversion_info.go index 8ff602f48e4..d755eed98f0 100644 --- a/test/project_v2/api/v1/groupversion_info.go +++ b/testdata/project_v2/api/v1/groupversion_info.go @@ -15,10 +15,7 @@ limitations under the License. */ // Package v1 contains API Schema definitions for the crew v1 API group -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project_v2/pkg/apis/crew -// +k8s:defaulter-gen=TypeMeta +// +kubebuilder:object:generate=true // +groupName=crew.testproject.org package v1 diff --git a/test/project_v2/api/v1/zz_generated.deepcopy.go b/testdata/project_v2/api/v1/zz_generated.deepcopy.go similarity index 98% rename from test/project_v2/api/v1/zz_generated.deepcopy.go rename to testdata/project_v2/api/v1/zz_generated.deepcopy.go index 9180e831f73..342d103b59b 100644 --- a/test/project_v2/api/v1/zz_generated.deepcopy.go +++ b/testdata/project_v2/api/v1/zz_generated.deepcopy.go @@ -15,7 +15,8 @@ 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 main. DO NOT EDIT. + +// autogenerated by controller-gen object, do not modify manually package v1 @@ -30,7 +31,6 @@ func (in *Captain) DeepCopyInto(out *Captain) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec out.Status = in.Status - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Captain. @@ -63,7 +63,6 @@ func (in *CaptainList) DeepCopyInto(out *CaptainList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainList. @@ -87,7 +86,6 @@ func (in *CaptainList) DeepCopyObject() runtime.Object { // 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 - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainSpec. @@ -103,7 +101,6 @@ func (in *CaptainSpec) DeepCopy() *CaptainSpec { // 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 - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainStatus. @@ -123,7 +120,6 @@ func (in *FirstMate) DeepCopyInto(out *FirstMate) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec out.Status = in.Status - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMate. @@ -156,7 +152,6 @@ func (in *FirstMateList) DeepCopyInto(out *FirstMateList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateList. @@ -180,7 +175,6 @@ func (in *FirstMateList) DeepCopyObject() runtime.Object { // 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 - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateSpec. @@ -196,7 +190,6 @@ func (in *FirstMateSpec) DeepCopy() *FirstMateSpec { // 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 - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateStatus. diff --git a/test/project_v2/config/certmanager/certificate.yaml b/testdata/project_v2/config/certmanager/certificate.yaml similarity index 100% rename from test/project_v2/config/certmanager/certificate.yaml rename to testdata/project_v2/config/certmanager/certificate.yaml diff --git a/test/project_v2/config/certmanager/kustomization.yaml b/testdata/project_v2/config/certmanager/kustomization.yaml similarity index 100% rename from test/project_v2/config/certmanager/kustomization.yaml rename to testdata/project_v2/config/certmanager/kustomization.yaml diff --git a/test/project_v2/config/certmanager/kustomizeconfig.yaml b/testdata/project_v2/config/certmanager/kustomizeconfig.yaml similarity index 100% rename from test/project_v2/config/certmanager/kustomizeconfig.yaml rename to testdata/project_v2/config/certmanager/kustomizeconfig.yaml diff --git a/testdata/project_v2/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project_v2/config/crd/bases/crew.testproject.org_captains.yaml new file mode 100644 index 00000000000..eea4a8482c1 --- /dev/null +++ b/testdata/project_v2/config/crd/bases/crew.testproject.org_captains.yaml @@ -0,0 +1,359 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: captains.crew.testproject.org +spec: + group: crew.testproject.org + names: + kind: Captain + plural: captains + scope: "" + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored with + a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. \n + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable by + a client. The resource is expected to be deleted (no longer visible + from resource lists, and not reachable by name) after the time in + this field, once the finalizers list is empty. As long as the finalizers + list contains items, deletion is blocked. Once the deletionTimestamp + is set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. \n Populated by the system when a graceful deletion + is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the object + is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the Name + field, and may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 - + instead, it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation of + the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. \n + When an object is created, the system will populate this list with + the current set of initializers. Only privileged users may set or + modify this list. Once it is empty, it may not be modified further + by any user." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for initializing + this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that other + clients can observe the deletion. + 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/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 if + not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons may + provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has caused + this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n Examples: + \ \"name\" - the field \"name\" on the current + resource \"items[0].name\" - the field \"name\" + on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the cause + of the error. This field may be presented as-is + to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may differ + from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single name + which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before the + operation should be retried. Some errors may indicate + the client must take an alternate action - for those errors + this field may indicate how long to wait before taking + the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + 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/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of this + operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that the + server has more data available. The value is opaque and + may be used to issue another request to the endpoint that + served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than a + few minutes have passed. The resourceVersion field returned + when using this continue value will be identical to the + value in the first response, unless you have received + this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there is + no information available. A Reason clarifies an HTTP status + code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required when + creating resources, although some resources may allow a client to + request the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration definition. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the \"default\" namespace, but + \"default\" is the canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this list + will point to this controller, with the controller field set to true. + There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. To + set this field, a user needs "delete" permission of the owner, + otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version of + this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to the + server. They may only be valid for a particular resource or set of + resources. \n Populated by the system. Read-only. Value must be treated + as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated by + the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + type: object + status: + type: object + type: object + versions: + - name: v1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/testdata/project_v2/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project_v2/config/crd/bases/crew.testproject.org_firstmates.yaml new file mode 100644 index 00000000000..53a9edaba15 --- /dev/null +++ b/testdata/project_v2/config/crd/bases/crew.testproject.org_firstmates.yaml @@ -0,0 +1,359 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: firstmates.crew.testproject.org +spec: + group: crew.testproject.org + names: + kind: FirstMate + plural: firstmates + scope: "" + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored with + a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. \n + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable by + a client. The resource is expected to be deleted (no longer visible + from resource lists, and not reachable by name) after the time in + this field, once the finalizers list is empty. As long as the finalizers + list contains items, deletion is blocked. Once the deletionTimestamp + is set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. \n Populated by the system when a graceful deletion + is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the object + is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the Name + field, and may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 - + instead, it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation of + the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. \n + When an object is created, the system will populate this list with + the current set of initializers. Only privileged users may set or + modify this list. Once it is empty, it may not be modified further + by any user." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for initializing + this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that other + clients can observe the deletion. + 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/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 if + not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons may + provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has caused + this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n Examples: + \ \"name\" - the field \"name\" on the current + resource \"items[0].name\" - the field \"name\" + on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the cause + of the error. This field may be presented as-is + to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may differ + from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single name + which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before the + operation should be retried. Some errors may indicate + the client must take an alternate action - for those errors + this field may indicate how long to wait before taking + the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + 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/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of this + operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that the + server has more data available. The value is opaque and + may be used to issue another request to the endpoint that + served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than a + few minutes have passed. The resourceVersion field returned + when using this continue value will be identical to the + value in the first response, unless you have received + this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there is + no information available. A Reason clarifies an HTTP status + code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required when + creating resources, although some resources may allow a client to + request the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration definition. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the \"default\" namespace, but + \"default\" is the canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this list + will point to this controller, with the controller field set to true. + There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. To + set this field, a user needs "delete" permission of the owner, + otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version of + this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to the + server. They may only be valid for a particular resource or set of + resources. \n Populated by the system. Read-only. Value must be treated + as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated by + the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + type: object + status: + type: object + type: object + versions: + - name: v1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/test/project_v2/config/crds/kustomization.yaml b/testdata/project_v2/config/crd/kustomization.yaml similarity index 74% rename from test/project_v2/config/crds/kustomization.yaml rename to testdata/project_v2/config/crd/kustomization.yaml index f89b5f65660..255470c5ca1 100644 --- a/test/project_v2/config/crds/kustomization.yaml +++ b/testdata/project_v2/config/crd/kustomization.yaml @@ -2,14 +2,14 @@ # 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_captain.yaml -- bases/crew_firstmate.yaml +- bases/crew.testproject.org_captains.yaml +- bases/crew.testproject.org_firstmates.yaml # +kubebuilder:scaffold:kustomizeresource patches: # patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_captain.yaml -#- patches/webhook_in_firstmate.yaml +#- patches/webhook_in_captains.yaml +#- patches/webhook_in_firstmates.yaml # +kubebuilder:scaffold:kustomizepatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/test/project_v2/config/crds/kustomizeconfig.yaml b/testdata/project_v2/config/crd/kustomizeconfig.yaml similarity index 100% rename from test/project_v2/config/crds/kustomizeconfig.yaml rename to testdata/project_v2/config/crd/kustomizeconfig.yaml diff --git a/test/project_v2/config/crds/patches/webhook_in_captain.yaml b/testdata/project_v2/config/crd/patches/webhook_in_captain.yaml similarity index 100% rename from test/project_v2/config/crds/patches/webhook_in_captain.yaml rename to testdata/project_v2/config/crd/patches/webhook_in_captain.yaml diff --git a/test/project_v2/config/crds/patches/webhook_in_firstmate.yaml b/testdata/project_v2/config/crd/patches/webhook_in_firstmate.yaml similarity index 100% rename from test/project_v2/config/crds/patches/webhook_in_firstmate.yaml rename to testdata/project_v2/config/crd/patches/webhook_in_firstmate.yaml diff --git a/test/project_v2/config/default/kustomization.yaml b/testdata/project_v2/config/default/kustomization.yaml similarity index 96% rename from test/project_v2/config/default/kustomization.yaml rename to testdata/project_v2/config/default/kustomization.yaml index 620d1e51773..bd556feaa28 100644 --- a/test/project_v2/config/default/kustomization.yaml +++ b/testdata/project_v2/config/default/kustomization.yaml @@ -13,12 +13,12 @@ namePrefix: project_v2- # someName: someValue bases: -- ../crds +- ../crd - ../rbac - ../manager -- ../webhook +# - ../webhook # Comment the next line if you want to disable cert-manager -- ../certmanager +# - ../certmanager patches: - manager_image_patch.yaml diff --git a/test/project_v2/config/default/manager_auth_proxy_patch.yaml b/testdata/project_v2/config/default/manager_auth_proxy_patch.yaml similarity index 100% rename from test/project_v2/config/default/manager_auth_proxy_patch.yaml rename to testdata/project_v2/config/default/manager_auth_proxy_patch.yaml diff --git a/test/project_v2/config/default/manager_image_patch.yaml b/testdata/project_v2/config/default/manager_image_patch.yaml similarity index 100% rename from test/project_v2/config/default/manager_image_patch.yaml rename to testdata/project_v2/config/default/manager_image_patch.yaml diff --git a/test/project_v2/config/default/manager_prometheus_metrics_patch.yaml b/testdata/project_v2/config/default/manager_prometheus_metrics_patch.yaml similarity index 100% rename from test/project_v2/config/default/manager_prometheus_metrics_patch.yaml rename to testdata/project_v2/config/default/manager_prometheus_metrics_patch.yaml diff --git a/test/project_v2/config/default/manager_webhook_patch.yaml b/testdata/project_v2/config/default/manager_webhook_patch.yaml similarity index 100% rename from test/project_v2/config/default/manager_webhook_patch.yaml rename to testdata/project_v2/config/default/manager_webhook_patch.yaml diff --git a/test/project_v2/config/default/webhookcainjection_patch.yaml b/testdata/project_v2/config/default/webhookcainjection_patch.yaml similarity index 100% rename from test/project_v2/config/default/webhookcainjection_patch.yaml rename to testdata/project_v2/config/default/webhookcainjection_patch.yaml diff --git a/testdata/project_v2/config/manager/kustomization.yaml b/testdata/project_v2/config/manager/kustomization.yaml new file mode 100644 index 00000000000..ab8d38810c9 --- /dev/null +++ b/testdata/project_v2/config/manager/kustomization.yaml @@ -0,0 +1,17 @@ +resources: +- manager.yaml + +# the following config is for teaching kustomize how to do var substitution +# vars: +# - name: NAMESPACE +# objref: +# kind: Service +# version: v1 +# name: webhook-service +# fieldref: +# fieldpath: metadata.namespace +# - name: SERVICENAME +# objref: +# kind: Service +# version: v1 +# name: webhook-service diff --git a/test/project_v2/config/manager/manager.yaml b/testdata/project_v2/config/manager/manager.yaml similarity index 100% rename from test/project_v2/config/manager/manager.yaml rename to testdata/project_v2/config/manager/manager.yaml diff --git a/test/project_v2/config/rbac/auth_proxy_role.yaml b/testdata/project_v2/config/rbac/auth_proxy_role.yaml similarity index 100% rename from test/project_v2/config/rbac/auth_proxy_role.yaml rename to testdata/project_v2/config/rbac/auth_proxy_role.yaml diff --git a/test/project_v2/config/rbac/auth_proxy_role_binding.yaml b/testdata/project_v2/config/rbac/auth_proxy_role_binding.yaml similarity index 100% rename from test/project_v2/config/rbac/auth_proxy_role_binding.yaml rename to testdata/project_v2/config/rbac/auth_proxy_role_binding.yaml diff --git a/test/project_v2/config/rbac/auth_proxy_service.yaml b/testdata/project_v2/config/rbac/auth_proxy_service.yaml similarity index 100% rename from test/project_v2/config/rbac/auth_proxy_service.yaml rename to testdata/project_v2/config/rbac/auth_proxy_service.yaml diff --git a/testdata/project_v2/config/rbac/kustomization.yaml b/testdata/project_v2/config/rbac/kustomization.yaml new file mode 100644 index 00000000000..1694b72b1f1 --- /dev/null +++ b/testdata/project_v2/config/rbac/kustomization.yaml @@ -0,0 +1,9 @@ +resources: +- role.yaml +- role_binding.yaml +# Comment the following 3 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 diff --git a/testdata/project_v2/config/rbac/role.yaml b/testdata/project_v2/config/rbac/role.yaml new file mode 100644 index 00000000000..ddccd1cac44 --- /dev/null +++ b/testdata/project_v2/config/rbac/role.yaml @@ -0,0 +1,66 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: manager-role +rules: +- apiGroups: + - crew.testproject.org + resources: + - captains + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - crew.testproject.org + resources: + - captains/status + verbs: + - get + - update + - patch +- apiGroups: + - crew.testproject.org + resources: + - firstmates + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - crew.testproject.org + resources: + - firstmates/status + verbs: + - get + - update + - patch +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - namespaces/status + verbs: + - get + - update + - patch diff --git a/testdata/project_v2/config/rbac/role_binding.yaml b/testdata/project_v2/config/rbac/role_binding.yaml new file mode 100644 index 00000000000..8f2658702c8 --- /dev/null +++ b/testdata/project_v2/config/rbac/role_binding.yaml @@ -0,0 +1,12 @@ +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/test/project_v2/config/samples/crew_v1_captain.yaml b/testdata/project_v2/config/samples/crew_v1_captain.yaml similarity index 72% rename from test/project_v2/config/samples/crew_v1_captain.yaml rename to testdata/project_v2/config/samples/crew_v1_captain.yaml index 9c83e89b287..2b1254f53f9 100644 --- a/test/project_v2/config/samples/crew_v1_captain.yaml +++ b/testdata/project_v2/config/samples/crew_v1_captain.yaml @@ -1,8 +1,6 @@ apiVersion: crew.testproject.org/v1 kind: Captain metadata: - labels: - controller-tools.k8s.io: "1.0" name: captain-sample spec: # Add fields here diff --git a/test/project_v2/config/samples/crew_v1_firstmate.yaml b/testdata/project_v2/config/samples/crew_v1_firstmate.yaml similarity index 73% rename from test/project_v2/config/samples/crew_v1_firstmate.yaml rename to testdata/project_v2/config/samples/crew_v1_firstmate.yaml index 45ebf31f208..36e6be0b6fe 100644 --- a/test/project_v2/config/samples/crew_v1_firstmate.yaml +++ b/testdata/project_v2/config/samples/crew_v1_firstmate.yaml @@ -1,8 +1,6 @@ apiVersion: crew.testproject.org/v1 kind: FirstMate metadata: - labels: - controller-tools.k8s.io: "1.0" name: firstmate-sample spec: # Add fields here diff --git a/testdata/project_v2/config/webhook/kustomization.yaml b/testdata/project_v2/config/webhook/kustomization.yaml new file mode 100644 index 00000000000..3158578d717 --- /dev/null +++ b/testdata/project_v2/config/webhook/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- webhookmanifests.yaml # disabled till v2 has webhook support + +configurations: +- kustomizeconfig.yaml diff --git a/test/project_v2/config/webhook/kustomizeconfig.yaml b/testdata/project_v2/config/webhook/kustomizeconfig.yaml similarity index 100% rename from test/project_v2/config/webhook/kustomizeconfig.yaml rename to testdata/project_v2/config/webhook/kustomizeconfig.yaml diff --git a/test/project_v2/controllers/captain_controller.go b/testdata/project_v2/controllers/captain_controller.go similarity index 92% rename from test/project_v2/controllers/captain_controller.go rename to testdata/project_v2/controllers/captain_controller.go index 15ff9e59b4a..e2d4d0074a3 100644 --- a/test/project_v2/controllers/captain_controller.go +++ b/testdata/project_v2/controllers/captain_controller.go @@ -23,7 +23,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - crewv1 "sigs.k8s.io/kubebuilder/test/project_v2/api/v1" + crewv1 "sigs.k8s.io/kubebuilder/testdata/project_v2/api/v1" ) // CaptainReconciler reconciles a Captain object @@ -34,9 +34,10 @@ type CaptainReconciler struct { // +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 + func (r *CaptainReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { _ = context.Background() - _ = r.Log.WithValues("Captain", req.NamespacedName) + _ = r.Log.WithValues("captain", req.NamespacedName) // your logic here diff --git a/test/project_v2/controllers/firstmate_controller.go b/testdata/project_v2/controllers/firstmate_controller.go similarity index 92% rename from test/project_v2/controllers/firstmate_controller.go rename to testdata/project_v2/controllers/firstmate_controller.go index 8de0983ce1a..a83b7f94de4 100644 --- a/test/project_v2/controllers/firstmate_controller.go +++ b/testdata/project_v2/controllers/firstmate_controller.go @@ -23,7 +23,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - crewv1 "sigs.k8s.io/kubebuilder/test/project_v2/api/v1" + crewv1 "sigs.k8s.io/kubebuilder/testdata/project_v2/api/v1" ) // FirstMateReconciler reconciles a FirstMate object @@ -34,9 +34,10 @@ type FirstMateReconciler struct { // +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 + func (r *FirstMateReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { _ = context.Background() - _ = r.Log.WithValues("FirstMate", req.NamespacedName) + _ = r.Log.WithValues("firstmate", req.NamespacedName) // your logic here diff --git a/test/project_v2/controllers/namespace_controller.go b/testdata/project_v2/controllers/namespace_controller.go similarity index 96% rename from test/project_v2/controllers/namespace_controller.go rename to testdata/project_v2/controllers/namespace_controller.go index 2f62f1f9135..6e86c4f04cc 100644 --- a/test/project_v2/controllers/namespace_controller.go +++ b/testdata/project_v2/controllers/namespace_controller.go @@ -34,9 +34,10 @@ type NamespaceReconciler struct { // +kubebuilder:rbac:groups=core,resources=namespaces,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=core,resources=namespaces/status,verbs=get;update;patch + func (r *NamespaceReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { _ = context.Background() - _ = r.Log.WithValues("Namespace", req.NamespacedName) + _ = r.Log.WithValues("namespace", req.NamespacedName) // your logic here diff --git a/testdata/project_v2/go.mod b/testdata/project_v2/go.mod new file mode 100644 index 00000000000..3d3ef05843a --- /dev/null +++ b/testdata/project_v2/go.mod @@ -0,0 +1,12 @@ +module sigs.k8s.io/kubebuilder/testdata/project_v2 + +go 1.12 + +require ( + github.com/go-logr/logr v0.1.0 + k8s.io/api v0.0.0-20190222213804-5cb15d344471 + k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 + k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 + sigs.k8s.io/controller-runtime v0.2.0-alpha.0.0.20190503051552-b666157c41da + sigs.k8s.io/controller-tools v0.2.0-alpha.1 // indirect +) diff --git a/testdata/project_v2/go.sum b/testdata/project_v2/go.sum new file mode 100644 index 00000000000..5503e9bc3a6 --- /dev/null +++ b/testdata/project_v2/go.sum @@ -0,0 +1,177 @@ +cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk= +github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.1.0+incompatible h1:K1MDoo4AZ4wU0GIU/fPmtZg7VpzLjCxu+UwBD1FvwOc= +github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/zapr v0.1.0 h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54= +github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= +github.com/gobuffalo/envy v1.6.15 h1:OsV5vOpHYUpP7ZLS6sem1y40/lNX1BZj+ynMiRi21lQ= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 h1:u4bArs140e9+AfE52mFHOXVFnOSBJBRlzTHrOPLOIhE= +github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= +github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47 h1:UnszMmmmm5vLwWzDjTFVIkfhvWF1NdrmChl8L2NUDCw= +github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/markbates/inflect v1.0.4 h1:5fh1gzTFhfae06u3hzHYO9xe3l3v3nW5Pwt3naLTP5g= +github.com/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.1 h1:PZSj/UFNaVp3KxrzHOcS7oyuWA7LoOY/77yCTEFu21U= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c h1:MUyE44mTvnI5A0xrxIxaMqoWFzPfQvtE2IWUollMDMs= +github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.0 h1:tXuTFVHC03mW0D+Ua1Q2d1EAVqLTuggX50V0VLICCzY= +github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e h1:n/3MEhJQjQxrOUCzh1Y3Re6aJUUWRp2M9+Oc3eVn/54= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 h1:agujYaXJSxSo18YNX3jzl+4G6Bstwt+kqv47GS12uL0= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2 h1:J7U/N7eRtzjhs26d6GqMh2HBuXP8/Z64Densiiieafo= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180821023952-922f4815f713 h1:rMJUcaDGbG+X967I4zGKCq5laYqcGKJmpB+3jhpOhPw= +golang.org/x/net v0.0.0-20180821023952-922f4815f713/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09 h1:KaQtG+aDELoNmXYas3TVkGNYRuq8JQ1aa7LJt8EXVyo= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc h1:MeuS1UDyZyFH++6vVy44PuufTeFF0d0nfI6XB87YGSk= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872 h1:cGjJzUd8RgBw428LXP65YXni0aiGNA4Bl+ls8SmLOm8= +golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190501045030-23463209683d h1:D7DVZUZEUgsSIDTivnUtVeGfN5AvhDIKtdIZAqx0ieE= +golang.org/x/tools v0.0.0-20190501045030-23463209683d/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +k8s.io/api v0.0.0-20190222213804-5cb15d344471 h1:MzQGt8qWQCR+39kbYRd0uQqsvSidpYqJLFeWiJ9l4OE= +k8s.io/api v0.0.0-20190222213804-5cb15d344471/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236 h1:JfFtjaElBIgYKCWEtYQkcNrTpW+lMO4GJy8NP6SVQmM= +k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= +k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 h1:UYfHH+KEF88OTg+GojQUwFTNxbxwmoktLwutUzR0GPg= +k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 h1:aE8wOCKuoRs2aU0OP/Rz8SXiAB0FTTku3VtGhhrkSmc= +k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/klog v0.1.0 h1:I5HMfc/DtuVaGR1KPwUrTc476K8NCqNBldC7H4dYEzk= +k8s.io/klog v0.1.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= +k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c h1:3KSCztE7gPitlZmWbNwue/2U0YruD65DqX3INopDAQM= +k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +sigs.k8s.io/controller-runtime v0.2.0-alpha.0.0.20190503051552-b666157c41da h1:7XzBPKPYDxQoOp23vyDUvbSQElLLF3fWYHOnkx4UBVw= +sigs.k8s.io/controller-runtime v0.2.0-alpha.0.0.20190503051552-b666157c41da/go.mod h1:ZhRyBoolVft3xZ8pUyJR3UgOyF3RUwQJwuUyaUXhBJc= +sigs.k8s.io/controller-tools v0.2.0-alpha.1 h1:WAFYSisW4Nmp/WPCs40FfkmGMglf+QauHB8mWPpYqxM= +sigs.k8s.io/controller-tools v0.2.0-alpha.1/go.mod h1:iog+z/LWZwDaOb2rfxUBZsTTPbloVgyVdXMye0kg8H8= +sigs.k8s.io/testing_frameworks v0.1.1 h1:cP2l8fkA3O9vekpy5Ks8mmA0NW/F7yBdXf8brkWhVrs= +sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= +sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/test/project_v2/hack/boilerplate.go.txt b/testdata/project_v2/hack/boilerplate.go.txt similarity index 100% rename from test/project_v2/hack/boilerplate.go.txt rename to testdata/project_v2/hack/boilerplate.go.txt diff --git a/test/project_v2/main.go b/testdata/project_v2/main.go similarity index 87% rename from test/project_v2/main.go rename to testdata/project_v2/main.go index ece5e5ad5f7..ed8e0cd1fe0 100644 --- a/test/project_v2/main.go +++ b/testdata/project_v2/main.go @@ -25,8 +25,8 @@ import ( _ "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/test/project_v2/api/v1" - "sigs.k8s.io/kubebuilder/test/project_v2/controllers" + crewv1 "sigs.k8s.io/kubebuilder/testdata/project_v2/api/v1" + "sigs.k8s.io/kubebuilder/testdata/project_v2/controllers" // +kubebuilder:scaffold:imports ) @@ -58,7 +58,7 @@ func main() { err = (&controllers.CaptainReconciler{ Client: mgr.GetClient(), - Log: ctrl.Log.WithName("Captain-controller"), + Log: ctrl.Log.WithName("controllers").WithName("Captain"), }).SetupWithManager(mgr) if err != nil { setupLog.Error(err, "unable to create controller", "controller", "Captain") @@ -66,7 +66,7 @@ func main() { } err = (&controllers.FirstMateReconciler{ Client: mgr.GetClient(), - Log: ctrl.Log.WithName("FirstMate-controller"), + Log: ctrl.Log.WithName("controllers").WithName("FirstMate"), }).SetupWithManager(mgr) if err != nil { setupLog.Error(err, "unable to create controller", "controller", "FirstMate") @@ -74,7 +74,7 @@ func main() { } err = (&controllers.NamespaceReconciler{ Client: mgr.GetClient(), - Log: ctrl.Log.WithName("Namespace-controller"), + Log: ctrl.Log.WithName("controllers").WithName("Namespace"), }).SetupWithManager(mgr) if err != nil { setupLog.Error(err, "unable to create controller", "controller", "Namespace") diff --git a/testdata/vendor.v1.tgz b/testdata/vendor.v1.tgz new file mode 100644 index 00000000000..51652db6665 --- /dev/null +++ b/testdata/vendor.v1.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79d1af743339638e1dff3a0412418791d3c536c8248597e4597c90852e71bf7f +size 30389729