Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.31 KB

File metadata and controls

37 lines (27 loc) · 1.31 KB

Component Codegen CLI

Overview

component-codegen is a CLI tool built using the Cobra library to scaffold boilerplate code for new components. It simplifies the onboarding process by generating necessary files and updating relevant configurations.

Usage

A new component can be scaffolded by using a simple make command

make new-component COMPONENT=<component_name>

Generated Files

Running the above command will generate the following files and update relevant configurations:

  1. Component Type Definition Creates a component_types.go file for the component in api/components/v1alpha1.

  2. Controller Files A folder named after the component inside internal/controller/components containing:

    • component_controller_actions.go
    • component_controller.go
    • component_support.go
    • component.go
  3. API Updates Adds an entry of the component in api/datasciencecluster/v1/datasciencecluster_types.go within the spec section.

  4. RBAC Configuration Updates the file internal/controller/datasciencecluster/kubebuilder_rbac.go with necessary Kubebuilder RBAC markers.

  5. Autogenerated Files Update Runs all necessary commands to update autogenerated files.

Next Steps

After running the command, users only need to add specific logic as per their component's requirements to complete onboarding.