bundle

package
v0.0.0-...-2d325b9 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamsFile = "_params.auto.tfvars.json"
	ConnsFile  = "_connections.auto.tfvars.json"
)

Variables

View Source
var MetadataSchema = parseMetadataSchema()

Functions

func ApplyTransformations

func ApplyTransformations(schema map[string]any, transformations []func(map[string]any) error) error

func EnsureBooleansHaveDefault

func EnsureBooleansHaveDefault(schema map[string]any) error

EnsureBooleansHaveDefault ensures that boolean types have a default value set to false if not already defined. This is due to an oddity in RJSF where booleans without a default value are treated as undefined, which can violate 'required' constraints.

func GetConnectionEnvs

func GetConnectionEnvs(connectionName string, artifactDefinition map[string]any) map[string]string

func GetConnections

func GetConnections(t *templatecache.TemplateData) error

func ParseEnvironmentVariables

func ParseEnvironmentVariables(params map[string]any, query map[string]string) map[string]ParsedEnvironmentVariable

func RunPromptNew

func RunPromptNew(t *templatecache.TemplateData) error

func SetMassdriverArtifactDefinitions

func SetMassdriverArtifactDefinitions(in map[string]map[string]any)

SetMassdriverArtifactDefinitions sets the defs used to specify connections in a bundle

Types

type AppSpec

type AppSpec struct {
	Envs     map[string]string `json:"envs" yaml:"envs"`
	Policies []string          `json:"policies" yaml:"policies"`
	Secrets  map[string]Secret `json:"secrets" yaml:"secrets"`
}

type Bundle

type Bundle struct {
	Schema      string         `json:"schema,omitempty" yaml:"schema,omitempty"`
	Name        string         `json:"name,omitempty" yaml:"name,omitempty"`
	Description string         `json:"description,omitempty" yaml:"description,omitempty"`
	SourceURL   string         `json:"source_url,omitempty" yaml:"source_url,omitempty"`
	Type        string         `json:"type,omitempty" yaml:"type,omitempty"`
	Access      string         `json:"access,omitempty" yaml:"access,omitempty"`
	Version     string         `json:"version,omitempty" yaml:"version,omitempty"`
	Steps       []Step         `json:"steps,omitempty" yaml:"steps,omitempty"`
	Artifacts   map[string]any `json:"artifacts,omitempty" yaml:"artifacts,omitempty"`
	Params      map[string]any `json:"params,omitempty" yaml:"params,omitempty"`
	Connections map[string]any `json:"connections,omitempty" yaml:"connections,omitempty"`
	UI          map[string]any `json:"ui,omitempty" yaml:"ui,omitempty"`
	AppSpec     *AppSpec       `json:"app,omitempty" yaml:"app,omitempty"`
}

func Unmarshal

func Unmarshal(readDirectory string) (*Bundle, error)

func (*Bundle) Build

func (b *Bundle) Build(buildPath string, mdClient *client.Client) error

func (*Bundle) CombineParamsConnsMetadata

func (b *Bundle) CombineParamsConnsMetadata() map[string]any

func (*Bundle) DereferenceSchemas

func (b *Bundle) DereferenceSchemas(path string, mdClient *client.Client) error

func (*Bundle) LintInputsMatchProvisioner

func (b *Bundle) LintInputsMatchProvisioner() LintResult

func (*Bundle) LintMatchRequired

func (b *Bundle) LintMatchRequired() LintResult

func (*Bundle) LintParamsConnectionsNameCollision

func (b *Bundle) LintParamsConnectionsNameCollision() LintResult

func (*Bundle) LintSchema

func (b *Bundle) LintSchema(mdClient *client.Client) LintResult

func (*Bundle) WriteSchemas

func (b *Bundle) WriteSchemas(buildPath string) error

type LintIssue

type LintIssue struct {
	Severity LintSeverity
	Message  string
	Rule     string // The name of the lint rule that generated this issue
}

LintIssue represents a single lint issue with its severity and message

func (LintIssue) Error

func (i LintIssue) Error() string

Error implements the error interface for LintIssue

type LintResult

type LintResult struct {
	Issues []LintIssue
}

LintResult holds the results of a linting operation

func (*LintResult) AddError

func (r *LintResult) AddError(rule, message string)

AddError adds an error-level issue to the result

func (*LintResult) AddWarning

func (r *LintResult) AddWarning(rule, message string)

AddWarning adds a warning-level issue to the result

func (*LintResult) Errors

func (r *LintResult) Errors() []LintIssue

Errors returns all error-level issues

func (*LintResult) HasErrors

func (r *LintResult) HasErrors() bool

HasErrors returns true if the result contains any error-level issues

func (*LintResult) HasIssues

func (r *LintResult) HasIssues() bool

HasIssues returns true if the result contains any error-level issues

func (*LintResult) HasWarnings

func (r *LintResult) HasWarnings() bool

HasWarnings returns true if the result contains any warning-level issues

func (*LintResult) IsClean

func (r *LintResult) IsClean() bool

IsClean returns true if there are no issues at all

func (*LintResult) Merge

func (r *LintResult) Merge(other LintResult)

Merge combines this result with another result

func (*LintResult) Warnings

func (r *LintResult) Warnings() []LintIssue

Warnings returns all warning-level issues

type LintSeverity

type LintSeverity int

LintSeverity represents the severity level of a lint issue

const (
	// LintWarning represents a non-blocking issue that should be reported but not halt execution
	LintWarning LintSeverity = iota
	// LintError represents a blocking issue that should halt execution
	LintError
)

func (LintSeverity) String

func (s LintSeverity) String() string

String returns the string representation of LintSeverity

type ParsedEnvironmentVariable

type ParsedEnvironmentVariable struct {
	Error string `json:"error"`
	Value string `json:"value"`
}

type Publisher

type Publisher struct {
	Store oras.Target
	Repo  oras.Target
}

func (*Publisher) PackageBundle

func (p *Publisher) PackageBundle(ctx context.Context, bundleDir string, tag string) (ocispec.Descriptor, error)

func (*Publisher) PublishBundle

func (p *Publisher) PublishBundle(ctx context.Context, tag string) error

type Puller

type Puller struct {
	Target oras.Target
	Repo   oras.Target
}

func (*Puller) PullBundle

func (p *Puller) PullBundle(ctx context.Context, version string) (v1.Descriptor, error)

type Schema

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

type Secret

type Secret struct {
	Required    bool   `json:"required,omitempty" yaml:"required,omitempty"`
	JSON        bool   `json:"json,omitempty" yaml:"json,omitempty"`
	Title       string `json:"title,omitempty" yaml:"title,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

type Step

type Step struct {
	Path         string         `json:"path,omitempty" yaml:"path,omitempty"`
	Provisioner  string         `json:"provisioner,omitempty" yaml:"provisioner,omitempty"`
	SkipOnDelete bool           `json:"skip_on_delete,omitempty" yaml:"skip_on_delete,omitempty"`
	Config       map[string]any `json:"config,omitempty" yaml:"config,omitempty"`
}

Jump to

Keyboard shortcuts

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