plantypes

package
v0.19.766 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionWorkflowRunPlan

type ActionWorkflowRunPlan struct {
	ID        string `json:"id"`
	InstallID string `json:"install_id"`

	Attrs map[string]string `json:"attrs"`

	Steps           []*ActionWorkflowRunStepPlan `json:"steps"`
	BuiltinEnvVars  map[string]string            `json:"builtin_env_vars"`
	OverrideEnvVars map[string]string            `json:"override_env_vars"`

	// optional fields based on the configuration
	ClusterInfo *kube.ClusterInfo      `json:"cluster_info,block"`
	AWSAuth     *awscredentials.Config `json:"aws_auth"`

	MinSandboxMode
}

type ActionWorkflowRunStepPlan

type ActionWorkflowRunStepPlan struct {
	ID string `json:"run_id"`

	Attrs                      map[string]string `json:"attrs"`
	InterpolatedEnvVars        map[string]string `json:"interpolated_env_vars"`
	GitSource                  *GitSource        `json:"git_source"`
	InterpolatedInlineContents string            `json:"interpolated_inline_contents"`
	InterpolatedCommand        string            `json:"interpolated_command"`
}

type BuildPlan

type BuildPlan struct {
	ComponentID      string `json:"component_id"`
	ComponentBuildID string `json:"component_build_id"`

	Src *GitSource `json:"git_source"`

	Dst    *configs.OCIRegistryRepository `json:"dst_registry" validate:"required"`
	DstTag string                         `json:"dst_tag" validate:"required"`

	HelmBuildPlan               *HelmBuildPlan               `json:"helm_build_plan,omitempty"`
	TerraformBuildPlan          *TerraformBuildPlan          `json:"terraform_build_plan,omitempty"`
	DockerBuildPlan             *DockerBuildPlan             `json:"docker_build_plan,omitempty"`
	ContainerImagePullPlan      *ContainerImagePullPlan      `json:"container_image_pull_plan,omitempty"`
	KubernetesManifestBuildPlan *KubernetesManifestBuildPlan `json:"kubernetes_manifest_build_plan,omitempty"`

	MinSandboxMode
}

type CompositePlan

type CompositePlan struct {
	BuildPlan              *BuildPlan              `json:"build_plan,omitempty"`
	DeployPlan             *DeployPlan             `json:"deploy_plan,omitempty"`
	ActionWorkflowRunPlan  *ActionWorkflowRunPlan  `json:"action_workflow_run_plan,omitempty"`
	SyncSecretsPlan        *SyncSecretsPlan        `json:"sync_secrets_plan,omitempty"`
	SyncOCIPlan            *SyncOCIPlan            `json:"sync_oci_plan,omitempty"`
	FetchImageMetadataPlan *FetchImageMetadataPlan `json:"fetch_image_metadata_plan,omitempty"`
	SandboxRunPlan         *SandboxRunPlan         `json:"sandbox_run_plan,omitempty"`
}

func (CompositePlan) GormDBDataType

func (CompositePlan) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType returns the database data type based on the current using database

func (CompositePlan) GormDataType

func (CompositePlan) GormDataType() string

GormDataType tells GORM what database type to use

func (CompositePlan) IsEmpty

func (cp CompositePlan) IsEmpty() bool

func (*CompositePlan) Scan

func (cp *CompositePlan) Scan(value any) error

func (CompositePlan) Value

func (cp CompositePlan) Value() (driver.Value, error)

type ContainerImagePullPlan

type ContainerImagePullPlan struct {
	Image string `json:"image"`
	Tag   string `json:"tag"`

	RepoCfg *configs.OCIRegistryRepository `json:"repo_config"`
}

type DeployPlan

type DeployPlan struct {
	InstallID     string `json:"install_id"`
	AppID         string `json:"app_id"`
	AppConfigID   string `json:"app_config_id"`
	ComponentID   string `json:"component_id"`
	ComponentName string `json:"component_name"`

	Src    *configs.OCIRegistryRepository `json:"src_registry" validate:"required"`
	SrcTag string                         `json:"src_tag" validate:"required"`

	HelmDeployPlan               *HelmDeployPlan               `json:"helm"`
	TerraformDeployPlan          *TerraformDeployPlan          `json:"terraform"`
	KubernetesManifestDeployPlan *KubernetesManifestDeployPlan `json:"kubernetes_manifest"`
	NoopDeployPlan               *NoopDeployPlan               `json:"noop"`

	// The following field is for applying a plan that is already save
	ApplyPlanContents string `json:"apply_plan_contents"`
	// This field is for storing a human legible plan or corollary representation
	ApplyPlanDisplay string `json:"apply_plan_display"`

	SandboxMode *SandboxMode `json:"sandbox_mode,omitzero,omitempty"`
}

type DockerBuildPlan

type DockerBuildPlan struct {
	BuildArgs  map[string]*string `json:"build_args"`
	Target     string             `json:"target"`
	Context    string             `json:"context"`
	Dockerfile string             `json:"dockerfile"`
}

type FetchImageMetadataPlan

type FetchImageMetadataPlan struct {
	// Registry configuration for the source image
	Registry *configs.OCIRegistryRepository `json:"registry" validate:"required"`

	// Tag is the image tag to fetch metadata for
	Tag string `json:"tag" validate:"required"`

	// Options for metadata fetching
	IncludeIndex                bool `json:"include_index"`
	IncludeAttestationManifests bool `json:"include_attestation_manifests"`
	IncludeAttestationLayers    bool `json:"include_attestation_layers"`

	MinSandboxMode
}

FetchImageMetadataPlan defines the plan for fetching image metadata from an OCI registry.

type GitSource

type GitSource struct {
	URL  string `json:"url" validate:"required"`
	Ref  string `json:"ref" validate:"required"`
	Path string `json:"path" validate:"required"`

	RecurseSubmodules bool `json:"recurse_submodules"`
}

type HelmBuildPlan

type HelmBuildPlan struct {
	Labels         map[string]string
	HelmRepoConfig *config.HelmRepoConfig
}

type HelmDeployPlan

type HelmDeployPlan struct {
	ClusterInfo *kube.ClusterInfo `json:"cluster_info,block"`

	// NOTE(jm): these fields should probably just come from the app config, however we keep them around for
	// debuggability
	Name            string `json:"name,attr"`
	Namespace       string `json:"namespace"`
	CreateNamespace bool   `json:"create_namespace"`
	StorageDriver   string `json:"storage_driver"`
	HelmChartID     string `json:"helm_chart_id"`

	ValuesFiles   []string    `json:"values_files"`
	Values        []HelmValue `json:"values"`
	TakeOwnership bool        `json:"take_ownership"`
}

type HelmSandboxMode

type HelmSandboxMode struct {
	PlanContents        string `json:"plan_contents"`
	PlanDisplayContents string `json:"plan_display_contents"`
}

type HelmValue

type HelmValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Type  string `json:"type,optional"`
}

type KubernetesManifestBuildPlan

type KubernetesManifestBuildPlan struct {
	// Labels for the OCI artifact
	Labels map[string]string `json:"labels,omitempty"`

	// SourceType indicates how manifests are sourced: "inline" or "kustomize"
	SourceType string `json:"source_type"`

	// InlineManifest contains the raw manifest YAML (for inline source type)
	InlineManifest string `json:"inline_manifest,omitempty"`

	// KustomizePath is the path to the kustomization directory (for kustomize source type)
	// Relative to the repository root
	KustomizePath string `json:"kustomize_path,omitempty"`

	// KustomizeConfig contains additional kustomize build options
	KustomizeConfig *KustomizeBuildConfig `json:"kustomize_config,omitempty"`
}

KubernetesManifestBuildPlan contains build configuration for kubernetes manifest components. This is used by the build runner to package manifests into OCI artifacts.

type KubernetesManifestDeployPlan

type KubernetesManifestDeployPlan struct {
	ClusterInfo *kube.ClusterInfo `json:"cluster_info,block"`

	Namespace string `json:"namespace"`

	// Manifest is populated at runtime from the OCI artifact.
	// This field is no longer set during plan creation - it's populated by the runner
	// after pulling the OCI artifact during Initialize().
	Manifest string `json:"manifest,omitempty"`

	// OCIArtifact reference (set during plan creation, used by runner to pull manifest)
	OCIArtifact *OCIArtifactReference `json:"oci_artifact,omitempty"`
}

type KubernetesSandboxMode

type KubernetesSandboxMode struct {
	PlanContents        string `json:"plan_contents"`
	PlanDisplayContents string `json:"plan_display_contents"`
}

type KubernetesSecretSync

type KubernetesSecretSync struct {
	SecretARN  string `json:"secret_arn"`
	SecretName string `json:"secret_name"` // the name of the secret from the config

	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	KeyName   string `json:"key_name"`

	// NOTE(jm): this should probably come from the app config, but for now we just use string parsing to avoid
	// updating the runner job and save time.
	Format string `json:"format"`
}

type KustomizeBuildConfig

type KustomizeBuildConfig struct {
	// Patches are additional patch files to apply after kustomize build
	Patches []string `json:"patches,omitempty"`

	// EnableHelm enables Helm chart inflation during kustomize build
	EnableHelm bool `json:"enable_helm,omitempty"`

	// LoadRestrictor controls file loading: "none" or "rootOnly" (default)
	LoadRestrictor string `json:"load_restrictor,omitempty"`
}

KustomizeBuildConfig contains kustomize-specific build options

type MinSandboxMode

type MinSandboxMode struct {
	SandboxMode *SandboxMode `json:"sandbox_mode,omitzero,omitempty"`
}

type NoopDeployPlan

type NoopDeployPlan struct {
}

type OCIArtifactReference

type OCIArtifactReference struct {
	// URL is the full artifact URL (e.g., registry.nuon.co/org_id/app_id)
	URL string `json:"url"`

	// Tag is the artifact tag (typically the build ID)
	Tag string `json:"tag,omitempty"`

	// Digest is the immutable artifact digest (e.g., sha256:abc123...)
	Digest string `json:"digest,omitempty"`
}

OCIArtifactReference points to the packaged manifest artifact

type SandboxMode

type SandboxMode struct {
	Enabled bool `json:"enabled"`

	Outputs map[string]any `json:"outputs"`

	Terraform          *TerraformSandboxMode  `json:"terraform,omitzero,omitempty"`
	Helm               *HelmSandboxMode       `json:"helm,omitzero,omitempty"`
	KubernetesManifest *KubernetesSandboxMode `json:"kubernetes_manifest,omitzero,omitempty"`
}

type SandboxRunPlan

type SandboxRunPlan struct {
	InstallID   string `json:"install_id"`
	AppID       string `json:"app_id"`
	AppConfigID string `json:"app_config_id"`

	Vars             map[string]any           `json:"vars" faker:"-"`
	EnvVars          map[string]string        `json:"env_vars"`
	VarsFiles        []string                 `json:"vars_files"`
	GitSource        *GitSource               `json:"git_source"`
	LocalArchive     *TerraformLocalArchive   `json:"local_archive"`
	TerraformBackend *TerraformBackend        `json:"terraform_backend"`
	AzureAuth        *azurecredentials.Config `json:"azure_auth"`
	AWSAuth          *awscredentials.Config   `json:"aws_auth"`
	Hooks            *TerraformDeployHooks    `json:"hooks"`

	Policies map[string]string `json:"policies"`

	State *state.State `json:"state"`

	// The following field is for applying a plan that is already saved
	ApplyPlanContents string `json:"apply_plan_contents"`
	// This field is for storing a human legible plan or corollary representation
	ApplyPlanDisplay []byte `json:"apply_plan_display"`

	SandboxMode *SandboxMode `json:"sandbox_mode,omitzero,omitempty"`
}

type SyncOCIPlan

type SyncOCIPlan struct {
	Src    *configs.OCIRegistryRepository `json:"src_registry" validate:"required"`
	SrcTag string                         `json:"src_tag" validate:"required"`

	Dst    *configs.OCIRegistryRepository `json:"dst_registry" validate:"required"`
	DstTag string                         `json:"dst_tag" validate:"required"`

	MinSandboxMode
}

type SyncSecretsPlan

type SyncSecretsPlan struct {
	KubernetesSecrets []KubernetesSecretSync `json:"kubernetes_secrets"`

	ClusterInfo *kube.ClusterInfo        `json:"cluster_info,block"`
	AzureAuth   *azurecredentials.Config `json:"azure_auth"`
	AWSAuth     *awscredentials.Config   `json:"aws_auth"`

	MinSandboxMode
}

type TerraformBackend

type TerraformBackend struct {
	WorkspaceID string `validate:"required"`
}

type TerraformBuildPlan

type TerraformBuildPlan struct {
	Labels map[string]string
}

type TerraformDeployHooks

type TerraformDeployHooks struct {
	Enabled bool               `hcl:"enabled"`
	EnvVars map[string]string  `hcl:"env_vars"`
	RunAuth credentials.Config `hcl:"run_auth,block"`
}

type TerraformDeployPlan

type TerraformDeployPlan struct {
	Vars      map[string]any    `json:"vars" faker:"-"`
	EnvVars   map[string]string `json:"env_vars"`
	VarsFiles []string          `json:"vars_files"`

	TerraformBackend *TerraformBackend        `json:"terraform_backend"`
	AzureAuth        *azurecredentials.Config `json:"azure_auth"`
	AWSAuth          *awscredentials.Config   `json:"aws_auth"`
	Hooks            *TerraformDeployHooks    `json:"hooks"`

	ClusterInfo *kube.ClusterInfo `json:"cluster_info,block"`

	Policies map[string]string `json:"policies"`
	State    *state.State      `json:"state" faker:"-"`

	PlanJSON []byte `json:"plan_json"`
}

type TerraformLocalArchive

type TerraformLocalArchive struct {
	Path string `json:"local_archive"`
}

type TerraformRunPlan

type TerraformRunPlan struct {
	InstallID   string `json:"install_id"`
	AppID       string `json:"app_id"`
	AppConfigID string `json:"app_config_id"`

	Vars             map[string]any           `json:"vars" faker:"-"`
	EnvVars          map[string]string        `json:"env_vars"`
	GitSource        *GitSource               `json:"git_source"`
	LocalArchive     *TerraformLocalArchive   `json:"local_archive"`
	TerraformBackend *TerraformBackend        `json:"terraform_backend"`
	AzureAuth        *azurecredentials.Config `json:"azure_auth"`
	AWSAuth          *awscredentials.Config   `json:"aws_auth"`
	Hooks            *TerraformDeployHooks    `json:"hooks"`

	Policies map[string]string `json:"policies"`

	State *state.State `json:"state"`
}

type TerraformRunType

type TerraformRunType string
const (
	TerraformRunTypeApply   TerraformRunType = "apply"
	TerraformRunTypeDestroy TerraformRunType = "destroy"
)

type TerraformSandboxMode

type TerraformSandboxMode struct {
	// needs to be the outputs of `terraform show -json`
	StateJSON   []byte `json:"state_json"`
	WorkspaceID string `json:"workspace_id"`

	// create the plan output
	PlanContents        string `json:"plan_contents"`
	PlanDisplayContents string `json:"plan_display_contents"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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