Documentation
¶
Overview ¶
Package v1alpha1 contains types for the v1alpha1 API group +groupName=blueprints.windsorcli.dev
Package v1alpha1 contains types for the v1alpha1 API group +groupName=blueprints.windsorcli.dev
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blueprint ¶
type Blueprint struct {
// Kind is the blueprint type, following Kubernetes conventions.
Kind string `yaml:"kind"`
// ApiVersion is the API schema version of the blueprint.
ApiVersion string `yaml:"apiVersion"`
// Metadata includes the blueprint's name and description.
Metadata Metadata `yaml:"metadata"`
// Repository details the source repository of the blueprint.
Repository Repository `yaml:"repository,omitempty"`
// Sources are external resources referenced by the blueprint.
Sources []Source `yaml:"sources"`
// TerraformComponents are Terraform modules in the blueprint.
TerraformComponents []TerraformComponent `yaml:"terraform"`
// Kustomizations are kustomization configs in the blueprint.
Kustomizations []Kustomization `yaml:"kustomize"`
// ConfigMaps are standalone ConfigMaps to be created, not tied to specific kustomizations.
// These ConfigMaps are referenced by all kustomizations in PostBuild substitution.
ConfigMaps map[string]map[string]string `yaml:"configMaps,omitempty"`
}
Blueprint is a configuration blueprint for initializing a project.
func (*Blueprint) ReplaceKustomization ¶ added in v0.8.0
func (b *Blueprint) ReplaceKustomization(kustomization Kustomization) error
ReplaceKustomization replaces an existing Kustomization with the provided kustomization. If a kustomization with the same Name exists, it is completely replaced. Otherwise, the kustomization is appended. Returns an error if a dependency cycle is detected during sorting.
func (*Blueprint) ReplaceTerraformComponent ¶ added in v0.8.0
func (b *Blueprint) ReplaceTerraformComponent(component TerraformComponent) error
ReplaceTerraformComponent replaces an existing TerraformComponent with the provided component. If a component with the same Path and Source exists, it is completely replaced. Otherwise, the component is appended. Returns an error if a dependency cycle is detected during sorting.
func (*Blueprint) StrategicMerge ¶ added in v0.8.0
StrategicMerge performs a strategic merge of the provided overlay Blueprints into the receiver Blueprint. This method appends to array fields, deep merges map fields, and updates scalar fields if present in the overlays. It is designed for feature composition, enabling the combination of multiple features into a single blueprint.
type BlueprintPatch ¶ added in v0.8.0
type BlueprintPatch struct {
// Path to the patch file relative to the kustomization (blueprint format).
Path string `yaml:"path,omitempty"`
// Patch content as YAML string (Flux format).
Patch string `yaml:"patch,omitempty"`
// Target selector for the patch (Flux format).
Target *kustomize.Selector `yaml:"target,omitempty"`
}
BlueprintPatch represents a patch in the blueprint format. This is converted to kustomize.Patch during processing. Supports both blueprint format (Path) and Flux format (Patch + Target).
type ConditionalKustomization ¶ added in v0.8.0
type ConditionalKustomization struct {
Kustomization `yaml:",inline"`
// When is an expression that determines if this kustomization should be applied.
// If empty, the kustomization is always applied when the parent feature matches.
When string `yaml:"when,omitempty"`
// Strategy determines how this kustomization is merged into the blueprint.
// Valid values are "merge" (default, strategic merge) and "replace" (replaces existing kustomization entirely).
// If empty or "merge", the kustomization is merged with existing kustomizations matching the same Name.
// If "replace", the kustomization completely replaces any existing kustomization with the same Name.
Strategy string `yaml:"strategy,omitempty"`
}
ConditionalKustomization extends Kustomization with conditional logic support.
func (*ConditionalKustomization) DeepCopy ¶ added in v0.8.0
func (c *ConditionalKustomization) DeepCopy() *ConditionalKustomization
DeepCopy creates a deep copy of the ConditionalKustomization object.
type ConditionalTerraformComponent ¶ added in v0.8.0
type ConditionalTerraformComponent struct {
TerraformComponent `yaml:",inline"`
// When is a CEL expression that determines if this terraform component should be applied.
// If empty, the component is always applied when the parent feature matches.
When string `yaml:"when,omitempty"`
// Strategy determines how this component is merged into the blueprint.
// Valid values are "merge" (default, strategic merge) and "replace" (replaces existing component entirely).
// If empty or "merge", the component is merged with existing components matching the same Path and Source.
// If "replace", the component completely replaces any existing component with the same Path and Source.
Strategy string `yaml:"strategy,omitempty"`
}
ConditionalTerraformComponent extends TerraformComponent with conditional logic support.
func (*ConditionalTerraformComponent) DeepCopy ¶ added in v0.8.0
func (c *ConditionalTerraformComponent) DeepCopy() *ConditionalTerraformComponent
DeepCopy creates a deep copy of the ConditionalTerraformComponent object.
type Config ¶
type Config struct {
Version string `yaml:"version"`
ToolsManager string `yaml:"toolsManager,omitempty"`
Contexts map[string]*Context `yaml:"contexts"`
}
Config represents the entire configuration
type Context ¶
type Context struct {
ID *string `yaml:"id,omitempty"`
Provider *string `yaml:"provider,omitempty"`
Environment map[string]string `yaml:"environment,omitempty"`
Secrets *secrets.SecretsConfig `yaml:"secrets,omitempty"`
AWS *aws.AWSConfig `yaml:"aws,omitempty"`
Azure *azure.AzureConfig `yaml:"azure,omitempty"`
Docker *docker.DockerConfig `yaml:"docker,omitempty"`
Git *git.GitConfig `yaml:"git,omitempty"`
Terraform *terraform.TerraformConfig `yaml:"terraform,omitempty"`
VM *vm.VMConfig `yaml:"vm,omitempty"`
Cluster *cluster.ClusterConfig `yaml:"cluster,omitempty"`
Network *network.NetworkConfig `yaml:"network,omitempty"`
DNS *dns.DNSConfig `yaml:"dns,omitempty"`
}
Context represents the context configuration
type Feature ¶ added in v0.8.0
type Feature struct {
// Kind is the feature type, following Kubernetes conventions.
Kind string `yaml:"kind"`
// ApiVersion is the API schema version of the feature.
ApiVersion string `yaml:"apiVersion"`
// Metadata includes the feature's name and description.
Metadata Metadata `yaml:"metadata"`
// Path is the file path where this feature was loaded from.
// This is used for resolving relative paths in jsonnet() and file() functions.
Path string `yaml:"-"`
// When is a CEL expression that determines if this feature should be applied.
// The expression is evaluated against user configuration values.
// Examples: "provider == 'aws'", "observability.enabled == true && observability.backend == 'quickwit'"
When string `yaml:"when,omitempty"`
// TerraformComponents are Terraform modules in the feature.
TerraformComponents []ConditionalTerraformComponent `yaml:"terraform,omitempty"`
// Kustomizations are kustomization configs in the feature.
Kustomizations []ConditionalKustomization `yaml:"kustomize,omitempty"`
}
Feature represents a conditional blueprint fragment that can be merged into a base blueprint. Features enable modular composition of blueprints based on user configuration values. Features inherit Repository and Sources from the base blueprint they are merged into.
type Kustomization ¶
type Kustomization struct {
// Name of the kustomization.
Name string `yaml:"name"`
// Path of the kustomization.
Path string `yaml:"path"`
// Source of the kustomization.
Source string `yaml:"source,omitempty"`
// DependsOn lists dependencies of this kustomization.
DependsOn []string `yaml:"dependsOn,omitempty"`
// Interval for applying the kustomization.
Interval *metav1.Duration `yaml:"interval,omitempty"`
// RetryInterval before retrying a failed kustomization.
RetryInterval *metav1.Duration `yaml:"retryInterval,omitempty"`
// Timeout for the kustomization to complete.
Timeout *metav1.Duration `yaml:"timeout,omitempty"`
// Patches to apply to the kustomization.
Patches []BlueprintPatch `yaml:"patches,omitempty"`
// Wait for the kustomization to be fully applied.
Wait *bool `yaml:"wait,omitempty"`
// Force apply the kustomization.
Force *bool `yaml:"force,omitempty"`
// Prune enables garbage collection of resources that are no longer present in the source.
Prune *bool `yaml:"prune,omitempty"`
// Components to include in the kustomization.
Components []string `yaml:"components,omitempty"`
// Cleanup lists resources to clean up after the kustomization is applied.
Cleanup []string `yaml:"cleanup,omitempty"`
// Destroy determines if the kustomization should be destroyed during down operations.
// Defaults to true if not specified.
Destroy *bool `yaml:"destroy,omitempty"`
// Substitutions contains values for post-build variable replacement,
// collected and stored in ConfigMaps for use by Flux postBuild substitution.
// All values are converted to strings as required by Flux variable substitution.
// These are used for generating ConfigMaps and are not written to the final context blueprint.yaml.
Substitutions map[string]string `yaml:"substitutions,omitempty"`
}
Kustomization represents a kustomization configuration.
func (*Kustomization) DeepCopy ¶ added in v0.6.0
func (k *Kustomization) DeepCopy() *Kustomization
DeepCopy creates a deep copy of the Kustomization object.
func (*Kustomization) ToFluxKustomization ¶ added in v0.8.0
func (k *Kustomization) ToFluxKustomization(namespace string, defaultSourceName string, sources []Source) kustomizev1.Kustomization
ToFluxKustomization converts a blueprint Kustomization to a Flux Kustomization. It takes the namespace for the kustomization, the default source name to use if no source is specified, and the list of sources to determine the source kind (GitRepository or OCIRepository). PostBuild is constructed based on the kustomization's Substitutions field.
type Metadata ¶
type Metadata struct {
// Name is the blueprint's unique identifier.
Name string `yaml:"name"`
// Description is a brief overview of the blueprint.
Description string `yaml:"description,omitempty"`
}
Metadata describes a blueprint.
type PostBuild ¶ added in v0.4.0
type PostBuild struct {
// Substitute is a map of resources to substitute from.
Substitute map[string]string `yaml:"substitute,omitempty"`
// SubstituteFrom is a list of resources to substitute from.
SubstituteFrom []SubstituteReference `yaml:"substituteFrom,omitempty"`
}
PostBuild is a post-build step to run after the kustomization is applied.
type Reference ¶
type Reference struct {
// Branch to use.
Branch string `yaml:"branch,omitempty"`
// Tag to use.
Tag string `yaml:"tag,omitempty"`
// SemVer to use.
SemVer string `yaml:"semver,omitempty"`
// Name of the reference.
Name string `yaml:"name,omitempty"`
// Commit hash to use.
Commit string `yaml:"commit,omitempty"`
}
Reference details a specific version or state of a repository or source.
type Repository ¶
type Repository struct {
// Url is the repository location.
Url string `yaml:"url"`
// Ref details the branch, tag, or commit to use.
Ref Reference `yaml:"ref"`
// SecretName is the secret for repository access.
SecretName *string `yaml:"secretName,omitempty"`
}
Repository contains source code repository info.
type Source ¶
type Source struct {
// Name identifies the source.
Name string `yaml:"name"`
// Url is the source location.
Url string `yaml:"url"`
// PathPrefix is a prefix to the source path.
PathPrefix string `yaml:"pathPrefix,omitempty"`
// Ref details the branch, tag, or commit to use.
Ref Reference `yaml:"ref,omitempty"`
// SecretName is the secret for source access.
SecretName string `yaml:"secretName,omitempty"`
}
Source is an external resource referenced by a blueprint.
type SubstituteReference ¶ added in v0.4.0
type SubstituteReference struct {
// Kind of the resource to substitute from.
Kind string `yaml:"kind"`
// Name of the resource to substitute from.
Name string `yaml:"name"`
// Optional indicates if the resource is optional.
Optional bool `yaml:"optional,omitempty"`
}
SubstituteReference is a reference to a resource to substitute from.
type TerraformComponent ¶
type TerraformComponent struct {
// Source of the Terraform module.
Source string `yaml:"source,omitempty"`
// Path of the Terraform module.
Path string `yaml:"path"`
// FullPath is the complete path, not serialized to YAML.
FullPath string `yaml:"-"`
// DependsOn lists dependencies of this terraform component.
DependsOn []string `yaml:"dependsOn,omitempty"`
// Inputs are configuration values for the module.
// These values can be expressions using ${} syntax (e.g., "${cluster.name}") or literals.
// Values with ${} are evaluated as expressions, plain values are passed through as literals.
// These are used for generating tfvars files and are not written to the final context blueprint.yaml.
Inputs map[string]any `yaml:"inputs,omitempty"`
// Destroy determines if the component should be destroyed during down operations.
// Defaults to true if not specified.
Destroy *bool `yaml:"destroy,omitempty"`
// Parallelism limits the number of concurrent operations as Terraform walks the graph.
// This corresponds to the -parallelism flag in terraform apply/destroy commands.
Parallelism *int `yaml:"parallelism,omitempty"`
}
TerraformComponent defines a Terraform module in a blueprint.
func (*TerraformComponent) DeepCopy ¶ added in v0.8.0
func (t *TerraformComponent) DeepCopy() *TerraformComponent
DeepCopy creates a deep copy of the TerraformComponent object.