Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .claude/commands/commit-with-message.md
Original file line number Diff line number Diff line change
@@ -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
24 changes: 0 additions & 24 deletions README.adoc

This file was deleted.

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion api/v1alpha1/banneduser_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/idler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/masteruserrecord_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/memberstatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/notification_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/nstemplateset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/nstemplatetier_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/proxyplugin_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/socialevent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/toolchainstatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/useraccount_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/usersignup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/usertier_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading