project

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package project generates OpenChoreo Project YAML from a (Cluster)ProjectType.

The parameter section is rendered with the same required/optional/default behavior as the component scaffolder by reusing its schema-to-YAML primitives (imported as render).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator renders a Project manifest (and optional ProjectReleaseBindings) from a (Cluster)ProjectType parameter schema.

func NewGenerator

func NewGenerator(parametersSchema *extv1.JSONSchemaProps, opts *Options) *Generator

NewGenerator creates a project scaffold generator. parametersSchema may be nil (a project type with no parameters), in which case spec.parameters is omitted.

func (*Generator) Generate

func (g *Generator) Generate() (string, error)

Generate produces the scaffolded Project YAML, followed by one ProjectReleaseBinding document per configured environment.

type Options

type Options struct {
	// ProjectName is the name for the generated Project.
	ProjectName string
	// Namespace is the target namespace for the Project (and its bindings).
	Namespace string
	// ProjectTypeKind is "ProjectType" or "ClusterProjectType".
	ProjectTypeKind string
	// ProjectTypeName is the referenced (Cluster)ProjectType name.
	ProjectTypeName string
	// DeploymentPipeline is the name referenced by spec.deploymentPipelineRef.
	DeploymentPipeline string
	// Environments, when non-empty, produces one ProjectReleaseBinding per entry.
	Environments []string
	// BindingsNote, when set, is rendered as an informational comment on the
	// Project document explaining why no ProjectReleaseBindings were generated.
	// It is emitted regardless of IncludeStructuralComments, since it explains
	// the shape of the output rather than documenting a field.
	BindingsNote string

	// IncludeAllFields includes optional fields (without defaults) as commented examples.
	IncludeAllFields bool
	// IncludeFieldDescriptions includes schema-derived comments.
	IncludeFieldDescriptions bool
	// IncludeStructuralComments includes section headers and guidance comments.
	IncludeStructuralComments bool
}

Options configures the project scaffolding generator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL