diff --git a/.claude/commands/commit-with-message.md b/.claude/commands/commit-with-message.md new file mode 100644 index 00000000..5c2ca7b1 --- /dev/null +++ b/.claude/commands/commit-with-message.md @@ -0,0 +1,25 @@ +--- +name: commit-with-message +description: Create a commit with a message based on the staged changes + +--- + +1. Pre-check + +Abort if there is no staged changes +Abort if there are openspec changes that have not been archived (ie, there are sibling folders to `openspec/changes/archive`) + +2. Prepare a commit message for the staged changes + +- Suggest a commit message based on the **staged only** changes +- Do not mention the changes in the `/openspec` folder +- Surround folder names, file names, variable names, function and method names by backticks (`) +- Use the Conventional Commits from https://www.conventionalcommits.org/en/v1.0.0/ +- Include the "Assisted-by:" trail with the name of the current model + +Show the suggested message and prompt the user to confirm that we shall proceed with committing the staged changes +Abort if the user is not happy with the message + +3. Commit + +run the `git commit -s` command with the message prepared above \ No newline at end of file diff --git a/README.adoc b/README.adoc deleted file mode 100644 index 8345663c..00000000 --- a/README.adoc +++ /dev/null @@ -1,24 +0,0 @@ -= ToolChain API - -image:https://goreportcard.com/badge/github.com/codeready-toolchain/api[Go Report Card, link="https://goreportcard.com/report/github.com/codeready-toolchain/api"] -image:https://godoc.org/github.com/codeready-toolchain/api?status.png[GoDoc,link="https://godoc.org/github.com/codeready-toolchain/api"] - -For the API reference docs go xref:api/v1alpha1/docs/apiref.adoc[here] - -== Building -Requires: - -* Go version 1.24.x (1.24.13 or higher) - download for your development environment https://golang.org/dl/[here]. - -CodeReady ToolChain API is built using https://github.com/golang/go/wiki/Modules[Go modules]. - -To re-generate the `zz_generated.deepcopy.go` and `zz_generated.openapi.go` files as well as the CRD files, run the following command: - -```sh -make generate -``` - -NOTE: the `make generate` will generate the CRD files in the local `config/crd/bases` directory and then dispatch the `.yaml` files in the `host-operator` and `member-operator` repositories, assuming they have been checked out and that *they are in a clean state*, meaning that they have no pending changes, besides previous versions of the CRD files. - -NOTE: Then you are supposed to create PRs also in the repos where the change was propagated ( host | member-operator ). Please do not mix other changes to the code with those CRD changes. While it would work technically , it’s always preferred to promote the CRD changes separately for easier PR review. - diff --git a/README.md b/README.md new file mode 100644 index 00000000..21d1861e --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# ToolChain API + +[![Go Report Card](https://goreportcard.com/badge/github.com/codeready-toolchain/api)](https://goreportcard.com/report/github.com/codeready-toolchain/api) +[![GoDoc](https://godoc.org/github.com/codeready-toolchain/api?status.png)](https://godoc.org/github.com/codeready-toolchain/api) + +For the API reference docs go [here](api/v1alpha1/docs/apiref.adoc) + +## Prerequisites + +* Go version 1.24.x (1.24.4 or higher) - download for your development environment [here](https://golang.org/dl/). + +CodeReady ToolChain API is built using [Go modules](https://github.com/golang/go/wiki/Modules). + +## Modifying the API Types + +The API types are defined in the `api/v1alpha1/*_types.go` files. After modifying these files, you must regenerate the derived files (deepcopy, OpenAPI, CRD manifests, and API reference docs) by running: + +```sh +make generate +``` + +This command runs the following steps: + +1. **Generate deepcopy and CRDs** — uses [controller-gen](https://github.com/kubernetes-sigs/controller-tools) to regenerate `zz_generated.deepcopy.go` and the CRD manifests in `config/crd/bases/`. +2. **Generate OpenAPI** — uses [openapi-gen](https://github.com/kubernetes/kube-openapi) to regenerate `zz_generated.openapi.go`. +3. **Generate API reference docs** — uses [crd-ref-docs](https://github.com/elastic/crd-ref-docs) to regenerate `api/v1alpha1/docs/apiref.adoc`. +4. **Dispatch CRDs** — copies the generated CRD `.yaml` files to the `host-operator` and `member-operator` repositories. + +> **Note:** The CRD dispatch step assumes the `host-operator` and `member-operator` repositories have been checked out alongside this repository and that *they are in a clean state*, meaning that they have no pending changes besides previous versions of the CRD files. + +> **Note:** After running `make generate`, you are expected to create PRs in this repository as well as in the `host-operator` and `member-operator` repositories where the CRD changes were propagated. Please do not mix other code changes with CRD changes — it is always preferred to promote CRD changes separately for easier PR review. diff --git a/api/v1alpha1/banneduser_types.go b/api/v1alpha1/banneduser_types.go index a73a5ed9..856ec998 100644 --- a/api/v1alpha1/banneduser_types.go +++ b/api/v1alpha1/banneduser_types.go @@ -20,7 +20,7 @@ const ( // BannedUserSpec defines the desired state of BannedUser // +k8s:openapi-gen=true type BannedUserSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The e-mail address of the account that has been banned diff --git a/api/v1alpha1/idler_types.go b/api/v1alpha1/idler_types.go index 98e17562..4ddb08f1 100644 --- a/api/v1alpha1/idler_types.go +++ b/api/v1alpha1/idler_types.go @@ -23,7 +23,7 @@ const ( // IdlerSpec defines the desired state of Idler // +k8s:openapi-gen=true type IdlerSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // TimeoutSeconds is the number of seconds before the running pods will be deleted @@ -33,7 +33,7 @@ type IdlerSpec struct { // IdlerStatus defines the observed state of Idler // +k8s:openapi-gen=true type IdlerStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current Idler conditions diff --git a/api/v1alpha1/masteruserrecord_types.go b/api/v1alpha1/masteruserrecord_types.go index de639e4a..ce89289a 100644 --- a/api/v1alpha1/masteruserrecord_types.go +++ b/api/v1alpha1/masteruserrecord_types.go @@ -48,7 +48,7 @@ const ( // MasterUserRecordSpec defines the desired state of MasterUserRecord // +k8s:openapi-gen=true type MasterUserRecordSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // If set to true then the corresponding user should not be able to login (but the underlying UserAccounts still exists) @@ -83,7 +83,7 @@ type UserAccountEmbedded struct { // MasterUserRecordStatus defines the observed state of MasterUserRecord // +k8s:openapi-gen=true type MasterUserRecordStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current Master User Record conditions diff --git a/api/v1alpha1/memberstatus_types.go b/api/v1alpha1/memberstatus_types.go index af7bc2ac..1097cfa7 100644 --- a/api/v1alpha1/memberstatus_types.go +++ b/api/v1alpha1/memberstatus_types.go @@ -9,7 +9,7 @@ import ( // MemberStatusSpec defines the desired state of MemberStatus // +k8s:openapi-gen=true type MemberStatusSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // spec is intentionally empty since only the status fields will be used for reporting status of the toolchain @@ -18,7 +18,7 @@ type MemberStatusSpec struct { // MemberStatusStatus defines the observed state of the toolchain member status // +k8s:openapi-gen=true type MemberStatusStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // MemberOperator is the status of a toolchain member operator @@ -78,7 +78,7 @@ type ResourceUsage struct { // HostStatus defines the status of the connection with the host cluster type HostStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current member operator status conditions @@ -93,7 +93,7 @@ type HostStatus struct { // MemberOperatorStatus defines the observed state of a toolchain's member operator type MemberOperatorStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The version of the operator diff --git a/api/v1alpha1/notification_types.go b/api/v1alpha1/notification_types.go index d36b2d74..c85d7608 100644 --- a/api/v1alpha1/notification_types.go +++ b/api/v1alpha1/notification_types.go @@ -37,7 +37,7 @@ const ( // NotificationSpec defines the desired state of Notification // +k8s:openapi-gen=true type NotificationSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // UserID is the user ID from RHD Identity Provider token (“sub” claim). The UserID is used by @@ -72,7 +72,7 @@ type NotificationSpec struct { // NotificationStatus defines the observed state of Notification // +k8s:openapi-gen=true type NotificationStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current Notification conditions diff --git a/api/v1alpha1/nstemplateset_types.go b/api/v1alpha1/nstemplateset_types.go index b5d376ac..e32e5cf7 100644 --- a/api/v1alpha1/nstemplateset_types.go +++ b/api/v1alpha1/nstemplateset_types.go @@ -35,7 +35,7 @@ const ( // NSTemplateSetSpec defines the desired state of NSTemplateSet // +k8s:openapi-gen=true type NSTemplateSetSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The name of the tier represented by this template set diff --git a/api/v1alpha1/nstemplatetier_types.go b/api/v1alpha1/nstemplatetier_types.go index 5822d8b4..eb9738e0 100644 --- a/api/v1alpha1/nstemplatetier_types.go +++ b/api/v1alpha1/nstemplatetier_types.go @@ -16,7 +16,7 @@ const ( // NSTemplateTierSpec defines the desired state of NSTemplateTier // +k8s:openapi-gen=true type NSTemplateTierSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The namespace templates @@ -86,7 +86,7 @@ type NSTemplateTierSpaceRole struct { // NSTemplateTierStatus defines the observed state of NSTemplateTier // +k8s:openapi-gen=true type NSTemplateTierStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current NSTemplateTier conditions diff --git a/api/v1alpha1/proxyplugin_types.go b/api/v1alpha1/proxyplugin_types.go index 7152492f..0292b45b 100644 --- a/api/v1alpha1/proxyplugin_types.go +++ b/api/v1alpha1/proxyplugin_types.go @@ -11,7 +11,7 @@ type OpenShiftRouteTarget struct { // ProxyPluginSpec defines the desired state of ProxyPlugin // +k8s:openapi-gen=true type ProxyPluginSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // OpenShiftRouteTargetEndpoint is an optional field that represents the look up information for an OpenShift Route @@ -25,7 +25,7 @@ type ProxyPluginSpec struct { // ProxyPluginStatus defines the observed state of ProxyPlugin // +k8s:openapi-gen=true type ProxyPluginStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current Proxy Plugin conditions diff --git a/api/v1alpha1/socialevent_types.go b/api/v1alpha1/socialevent_types.go index 846b9479..4cb00d1b 100644 --- a/api/v1alpha1/socialevent_types.go +++ b/api/v1alpha1/socialevent_types.go @@ -22,7 +22,7 @@ const ( // // +k8s:openapi-gen=true type SocialEventSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The timestamp from which users may register via this event's activation code @@ -59,7 +59,7 @@ type SocialEventSpec struct { // SocialEventStatus defines the observed state of SocialEvent // +k8s:openapi-gen=true type SocialEventStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current SocialEventStatus conditions diff --git a/api/v1alpha1/toolchainstatus_types.go b/api/v1alpha1/toolchainstatus_types.go index bded95d7..035bd86a 100644 --- a/api/v1alpha1/toolchainstatus_types.go +++ b/api/v1alpha1/toolchainstatus_types.go @@ -56,7 +56,7 @@ const ( // ToolchainStatusSpec defines the desired state of ToolchainStatus // +k8s:openapi-gen=true type ToolchainStatusSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // spec is intentionally empty since only the status fields will be used for reporting status of the toolchain @@ -65,7 +65,7 @@ type ToolchainStatusSpec struct { // ToolchainStatusStatus defines the observed state of the toolchain, including host cluster and member cluster components // +k8s:openapi-gen=true type ToolchainStatusStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // HostOperator is the status of a toolchain host operator @@ -119,7 +119,7 @@ type HostRoutes struct { // +k8s:openapi-gen=true // DEPRECATED: using metrics instead of this status type HostOperatorStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The version of the operator @@ -147,7 +147,7 @@ type HostOperatorStatus struct { // HostRegistrationServiceStatus defines the observed state of a toolchain's registration service // +k8s:openapi-gen=true type HostRegistrationServiceStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Deployment is the status of the registration service's deployment diff --git a/api/v1alpha1/useraccount_types.go b/api/v1alpha1/useraccount_types.go index 497f45df..6234f0bf 100644 --- a/api/v1alpha1/useraccount_types.go +++ b/api/v1alpha1/useraccount_types.go @@ -38,7 +38,7 @@ const ( // UserAccountSpec defines the desired state of UserAccount // +k8s:openapi-gen=true type UserAccountSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // If set to true then the corresponding user should not be able to login @@ -55,7 +55,7 @@ type UserAccountSpec struct { // UserAccountStatus defines the observed state of UserAccount // +k8s:openapi-gen=true type UserAccountStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current User Account conditions diff --git a/api/v1alpha1/usersignup_types.go b/api/v1alpha1/usersignup_types.go index 91f063dc..465fa0d8 100644 --- a/api/v1alpha1/usersignup_types.go +++ b/api/v1alpha1/usersignup_types.go @@ -212,7 +212,7 @@ type UserSignupState string // UserSignupSpec defines the desired state of UserSignup // +k8s:openapi-gen=true type UserSignupSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // The cluster in which the user is provisioned in @@ -281,7 +281,7 @@ type PropagatedClaims struct { // UserSignupStatus defines the observed state of UserSignup // +k8s:openapi-gen=true type UserSignupStatus struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // Conditions is an array of current UserSignup conditions diff --git a/api/v1alpha1/usertier_types.go b/api/v1alpha1/usertier_types.go index 29a9740d..896d5a17 100644 --- a/api/v1alpha1/usertier_types.go +++ b/api/v1alpha1/usertier_types.go @@ -21,7 +21,7 @@ type UserTier struct { // UserTierSpec defines the desired state of UserTier // +k8s:openapi-gen=true type UserTierSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Important: Run "make generate" to regenerate code after modifying this file // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html // the period (in days) after which users within the tier will be deactivated diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index b2ce12c8..91f8833c 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -331,9 +331,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_Binding(ref common.ReferenceCal Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -675,8 +674,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_HostOperatorStatus(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -759,8 +757,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_HostRoutes(ref common.Reference Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -954,8 +951,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_IdlerStatus(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -1067,8 +1063,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_MasterUserRecordSpec(ref common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.UserAccountEmbedded"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.UserAccountEmbedded"), }, }, }, @@ -1120,8 +1115,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_MasterUserRecordStatus(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -1139,8 +1133,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_MasterUserRecordStatus(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.UserAccountStatusEmbedded"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.UserAccountStatusEmbedded"), }, }, }, @@ -1400,8 +1393,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_MemberStatusStatus(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -1455,8 +1447,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_Members(ref common.ReferenceCal Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.MemberOperatorConfigSpec"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.MemberOperatorConfigSpec"), }, }, }, @@ -1588,9 +1579,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetSpaceRole(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1630,8 +1620,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetSpec(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetNamespace"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetNamespace"), }, }, }, @@ -1655,8 +1644,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetSpec(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetSpaceRole"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetSpaceRole"), }, }, }, @@ -1690,8 +1678,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetNamespace"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetNamespace"), }, }, }, @@ -1715,8 +1702,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetSpaceRole"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetSpaceRole"), }, }, }, @@ -1734,9 +1720,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1754,8 +1739,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"), }, }, }, @@ -1778,8 +1762,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -1859,8 +1842,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateTierSpec(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierNamespace"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierNamespace"), }, }, }, @@ -1885,8 +1867,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateTierSpec(ref common.R Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierSpaceRole"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateTierSpaceRole"), }, }, }, @@ -1915,8 +1896,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateTierSpec(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Parameter"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Parameter"), }, }, }, @@ -1955,8 +1935,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateTierStatus(ref common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -1975,9 +1954,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateTierStatus(ref common Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2115,9 +2093,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_NotificationSpec(ref common.Ref Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2174,8 +2151,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NotificationStatus(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -2381,8 +2357,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_ProxyPluginStatus(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -2591,9 +2566,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceConfig(ref c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2653,8 +2627,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceDeploymentSt Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -2728,8 +2701,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceHealth(ref c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -2768,8 +2740,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceResourcesSta Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -2886,8 +2857,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceVerification Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.TwilioSenderConfig"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.TwilioSenderConfig"), }, }, }, @@ -2912,9 +2882,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceVerification Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3005,9 +2974,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_ResourceUsage(ref common.Refere Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Type: []string{"integer"}, + Format: "int32", }, }, }, @@ -3050,8 +3018,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_Routes(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -3209,8 +3176,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SocialEventStatus(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -3359,8 +3325,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceBindingList(ref common.Ref Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceBinding"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceBinding"), }, }, }, @@ -3476,8 +3441,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceBindingRequestStatus(ref c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -3674,8 +3638,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceProvisionerConfigList(ref Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceProvisionerConfig"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceProvisionerConfig"), }, }, }, @@ -3708,9 +3671,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceProvisionerConfigSpec(ref Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3777,8 +3739,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceProvisionerConfigStatus(re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -3886,9 +3847,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestSpec(ref common.Ref Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3934,8 +3894,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestStatus(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NamespaceAccess"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NamespaceAccess"), }, }, }, @@ -3958,8 +3917,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceRequestStatus(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -3999,9 +3957,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4060,8 +4017,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceStatus(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"), }, }, }, @@ -4084,8 +4040,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_SpaceStatus(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -4141,8 +4096,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_TierTemplateRevisionSpec(ref co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Parameter"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Parameter"), }, }, }, @@ -4259,8 +4213,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_TiersConfig(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.FeatureToggle"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.FeatureToggle"), }, }, }, @@ -4414,8 +4367,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_ToolchainClusterStatus(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -4479,9 +4431,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_ToolchainConfigStatus(ref commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4504,8 +4455,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_ToolchainConfigStatus(ref commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -4653,8 +4603,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_ToolchainStatusStatus(ref commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Member"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Member"), }, }, }, @@ -4684,8 +4633,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_ToolchainStatusStatus(ref commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -4726,9 +4674,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_TwilioSenderConfig(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4841,8 +4788,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_UserAccountStatus(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -4929,9 +4875,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_UserSignupSpec(ref common.Refer Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4977,8 +4922,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_UserSignupStatus(ref common.Ref Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Condition"), }, }, }, @@ -5222,8 +5166,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_WorkspaceStatus(ref common.Refe Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"), }, }, }, @@ -5262,9 +5205,8 @@ func schema_codeready_toolchain_api_api_v1alpha1_WorkspaceStatus(ref common.Refe Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -5282,8 +5224,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_WorkspaceStatus(ref common.Refe Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Binding"), + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.Binding"), }, }, }, diff --git a/cmd/manager/main.go b/cmd/manager/main.go deleted file mode 100644 index 75bea1ab..00000000 --- a/cmd/manager/main.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - // A dummy main function to make `operator-sdk generate csv` happy. -} diff --git a/make/generate.mk b/make/generate.mk index 0c1b53ae..6648891f 100644 --- a/make/generate.mk +++ b/make/generate.mk @@ -3,29 +3,60 @@ API_GROUPNAME=toolchain API_FULL_GROUPNAME=toolchain.dev.openshift.com API_VERSION:=v1alpha1 -# how to dispatch the CRD files per repository (space-separated lists) -HOST_CLUSTER_CRDS:=masteruserrecords nstemplatetiers usersignups bannedusers notifications spaces spacebindings socialevents tiertemplates tiertemplaterevisions toolchainstatuses toolchainclusters toolchainconfigs usertiers proxyplugins spacerequests spacebindingrequests spaceprovisionerconfigs -MEMBER_CLUSTER_CRDS:=useraccounts nstemplatesets memberstatuses idlers toolchainclusters memberoperatorconfigs spacerequests workspaces spacebindingrequests + +## Location to install dependencies to +LOCALBIN ?= $(shell pwd)/bin +$(LOCALBIN): + mkdir -p $(LOCALBIN) + +## Tool Binaries +KUSTOMIZE ?= $(LOCALBIN)/kustomize +CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen +OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk +OPM ?= $(LOCALBIN)/opm PATH_TO_CRD_BASES=config/crd/bases PROJECT_DIR := $(shell pwd) +# .PHONY: kustomize +# kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. +# $(KUSTOMIZE): $(LOCALBIN) +# $(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v5,$(KUSTOMIZE_VERSION)) + +CONTROLLER_TOOLS_VERSION ?= v0.18.0 +OPERATOR_SDK_VERSION ?= v1.42.0 + +.PHONY: controller-gen +controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. +$(CONTROLLER_GEN): $(LOCALBIN) + $(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,$(CONTROLLER_TOOLS_VERSION)) + +.PHONY: manifests +manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. + $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./api/..." output:crd:artifacts:config=config/crd/bases + .PHONY: generate -## Generate deepcopy, openapi and CRD files after the API was modified -generate: generate-deepcopy-and-crds generate-openapi gen-crd-ref-docs dispatch-crds - -.PHONY: generate-deepcopy-and-crds -generate-deepcopy-and-crds: remove-config controller-gen - @echo "Re-generating the deepcopy go file & the Toolchain CRD files... " - $(Q)$(CONTROLLER_GEN) crd \ - object paths="./..." output:crd:artifacts:config=$(PATH_TO_CRD_BASES) +generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. + $(CONTROLLER_GEN) object paths="./api/..." + + + +CRD_REF_DOCS = $(PROJECT_DIR)/bin/crd-ref-docs +crd-ref-docs: ## Download crd-ref-docs locally if necessary. + GOBIN=$(PROJECT_DIR)/bin $(GO) install github.com/elastic/crd-ref-docs@latest .PHONY: gen-crd-ref-docs gen-crd-ref-docs: crd-ref-docs @echo "Re-generating the api doc ref: ./api/$(API_VERSION)/docs/apiref.adoc " $(CRD_REF_DOCS) --source-path ./api/$(API_VERSION) --config ./crdrefdocs.config.yaml --output-path ./api/$(API_VERSION)/docs/apiref.adoc +OPENAPI_GEN = $(PROJECT_DIR)/bin/openapi-gen +OPENAPI_GEN_VERSION ?= master + +openapi-gen: ## Download openapi-gen locally if necessary. + $(call go-install-tool,$(OPENAPI_GEN),k8s.io/kube-openapi/cmd/openapi-gen,$(OPENAPI_GEN_VERSION)) + .PHONY: generate-openapi generate-openapi: openapi-gen @echo "re-generating the openapi go file..." @@ -36,6 +67,24 @@ generate-openapi: openapi-gen --go-header-file=make/go-header.txt + +# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist +# $1 - target path with name of binary +# $2 - package url which can be installed +# $3 - specific version of package +define go-install-tool +@[ -f "$(1)-$(3)" ] || { \ +set -e; \ +package=$(2)@$(3) ;\ +echo "Downloading $${package}" ;\ +rm -f $(1) || true ;\ +GOBIN=$(LOCALBIN) go install $${package} ;\ +mv $(1) $(1)-$(3) ;\ +} ;\ +ln -sf $(1)-$(3) $(1) +endef + + # make sure that that the `host-operator` and `member-operator` repositories exist locally # and that they don't have any pending changes (except for the CRD files). # The reasonning here is that when a change is made in the `api` repository, the resulting changes @@ -48,29 +97,9 @@ generate-openapi: openapi-gen host_repo_status := $(shell cd ../host-operator && git status -s | grep -v ${PATH_TO_CRD_BASES}) member_repo_status := $(shell cd ../member-operator && git status -s | grep -v ${PATH_TO_CRD_BASES}) -PHONY: prepare-host-operator -prepare-host-operator: ../host-operator -ifdef host_repo_status - @echo "The local '../host-operator' repository has pending changes. Please stash them or commit them, first." - @exit 1 -endif -ifneq ($(wildcard ../host-operator/${PATH_TO_CRD_BASES}/*.yaml),) - @-find ../host-operator/${PATH_TO_CRD_BASES} -type f | grep -v "cr\.yaml" | xargs rm || true -else - @-mkdir -p ../host-operator/${PATH_TO_CRD_BASES} -endif - -PHONY: prepare-member-operator -prepare-member-operator: ../member-operator -ifdef member_repo_status - @echo "The local '../member-operator' repository has pending changes. Please stash them or commit them, first." - @exit 1 -endif -ifneq ($(wildcard ../member-operator/${PATH_TO_CRD_BASES}/*.yaml),) - @-find ../member-operator/${PATH_TO_CRD_BASES} -type f | grep -v "cr\.yaml" | xargs rm || true -else - @-mkdir -p ../member-operator/${PATH_TO_CRD_BASES} -endif +# how to dispatch the CRD files per repository (space-separated lists) +HOST_CLUSTER_CRDS:=masteruserrecords nstemplatetiers usersignups bannedusers notifications spaces spacebindings socialevents tiertemplates tiertemplaterevisions toolchainstatuses toolchainclusters toolchainconfigs usertiers proxyplugins spacerequests spacebindingrequests spaceprovisionerconfigs +MEMBER_CLUSTER_CRDS:=useraccounts nstemplatesets memberstatuses idlers toolchainclusters memberoperatorconfigs spacerequests workspaces spacebindingrequests .PHONY: dispatch-crds dispatch-crds: prepare-host-operator prepare-member-operator @@ -93,14 +122,26 @@ dispatch-crds: prepare-host-operator prepare-member-operator fi @echo "Dispatch successfully finished \o/" -CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen -controller-gen: ## Download controller-gen locally if necessary. - GOBIN=$(PROJECT_DIR)/bin $(GO) install sigs.k8s.io/controller-tools/cmd/controller-gen - -OPENAPI_GEN = $(PROJECT_DIR)/bin/openapi-gen -openapi-gen: ## Download openapi-gen locally if necessary. - GOBIN=$(PROJECT_DIR)/bin $(GO) install k8s.io/kube-openapi/cmd/openapi-gen +PHONY: prepare-host-operator +prepare-host-operator: ../host-operator +ifdef host_repo_status + @echo "The local '../host-operator' repository has pending changes. Please stash them or commit them, first." + @exit 1 +endif +ifneq ($(wildcard ../host-operator/${PATH_TO_CRD_BASES}/*.yaml),) + @-find ../host-operator/${PATH_TO_CRD_BASES} -type f | grep -v "cr\.yaml" | xargs rm || true +else + @-mkdir -p ../host-operator/${PATH_TO_CRD_BASES} +endif -CRD_REF_DOCS = $(PROJECT_DIR)/bin/crd-ref-docs -crd-ref-docs: ## Download crd-ref-docs locally if necessary. - GOBIN=$(PROJECT_DIR)/bin $(GO) install github.com/elastic/crd-ref-docs@latest \ No newline at end of file +PHONY: prepare-member-operator +prepare-member-operator: ../member-operator +ifdef member_repo_status + @echo "The local '../member-operator' repository has pending changes. Please stash them or commit them, first." + @exit 1 +endif +ifneq ($(wildcard ../member-operator/${PATH_TO_CRD_BASES}/*.yaml),) + @-find ../member-operator/${PATH_TO_CRD_BASES} -type f | grep -v "cr\.yaml" | xargs rm || true +else + @-mkdir -p ../member-operator/${PATH_TO_CRD_BASES} +endif \ No newline at end of file