render

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Overview

Package render turns resolved Argo CD Application sources into Kubernetes manifests using in-process directory, Kustomize, Helm, and plugin paths.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedPlugin = errors.New("unsupported config management plugin")
View Source
var KustomizationFileNames = []string{"kustomization.yaml", "kustomization.yml", "Kustomization"}

KustomizationFileNames is the ordered list of kustomization file name variants that kustomize recognizes, in resolution precedence order. selectLocalRenderer in the app package uses this list for source-type classification; kustomize_input_digest uses it for the optional-variant digest paths. The two lists must stay identical — this export is the single source of truth.

Functions

func CanonicalOCIChartRepository

func CanonicalOCIChartRepository(repository string) (string, bool)

func ChartRepositoryKind

func ChartRepositoryKind(repository string, ociRepositories map[string]bool) chart.RepositoryKind

func DirectoryInputDigestPaths added in v0.2.0

func DirectoryInputDigestPaths(source ResolvedSource, opts RenderOptions) ([]gitref.PathDigestPath, error)

DirectoryInputDigestPaths returns conservative committed repository paths for directory rendering. The source directory tree is always included; Jsonnet library roots are included when declared and validated with the same bounded path semantics used by the renderer.

func KustomizeInputDigestPaths added in v0.2.0

func KustomizeInputDigestPaths(ctx context.Context, source ResolvedSource, opts RenderOptions) ([]gitref.PathDigestPath, error)

KustomizeInputDigestPaths returns the committed repository-relative local inputs needed to key a persistent render cache entry for a Kustomize source.

func OCIChartRepositoryEnabled

func OCIChartRepositoryEnabled(repository string, repositories map[string]bool) bool

func ValidateKustomizeBuildOptions added in v0.1.3

func ValidateKustomizeBuildOptions(options []string) error

Types

type DirectoryRenderer

type DirectoryRenderer struct{}

func (DirectoryRenderer) Render

type HelmChartLoadCache added in v0.1.21

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

HelmChartLoadCache memoizes chart file reads and tree validation for the lifetime of one render session. Load returns a freshly parsed chart on every call so Helm dependency processing cannot leak mutations between renders.

func NewHelmChartLoadCache added in v0.1.21

func NewHelmChartLoadCache() *HelmChartLoadCache

func (*HelmChartLoadCache) Load added in v0.1.21

func (cache *HelmChartLoadCache) Load(chartPath string) (helmchart.Charter, error)

type HelmLocalInputOptions added in v0.2.0

type HelmLocalInputOptions struct {
	RepoRoot string
	Source   ResolvedSource
	Options  RenderOptions
}

type HelmLocalInputPath added in v0.2.0

type HelmLocalInputPath struct {
	Path     string
	Optional bool
}

func CollectHelmLocalInputPaths added in v0.2.0

func CollectHelmLocalInputPaths(input HelmLocalInputOptions) ([]HelmLocalInputPath, error)

CollectHelmLocalInputPaths mirrors Helm value-file path resolution for the persistent render cache. It returns repository-relative committed paths only; callers should skip persistence when collection fails.

type HelmRenderer

type HelmRenderer struct{}

func (HelmRenderer) Render

type KustomizeRenderer

type KustomizeRenderer struct{}

func (KustomizeRenderer) Render

type Manifest

type Manifest struct {
	SourceIndex                  int
	SourceName                   string
	Path                         string
	NamespaceBeforeNormalization string
	Object                       *unstructured.Unstructured
}

type PluginConfig

type PluginConfig struct {
	Name       string
	Env        argoappv1.Env
	Parameters argoappv1.ApplicationSourcePluginParameters
}

type PluginRenderer

type PluginRenderer interface {
	RenderPlugin(ctx context.Context, request PluginRequest) ([]Manifest, []diagnostic.Diagnostic, error)
}

type PluginRequest

type PluginRequest struct {
	AppName      string
	AppNamespace string
	Project      string
	Namespace    string
	Source       ResolvedSource
	Plugin       PluginConfig
	RefRoots     map[string]string
	RefSources   map[string]ResolvedSource
	KubeVersion  string
	APIVersions  []string
}

type Provider

type Provider interface {
	RenderSource(ctx context.Context, source ResolvedSource, opts RenderOptions) ([]Manifest, []diagnostic.Diagnostic, error)
}

type RenderOptions

type RenderOptions struct {
	AppName                      string
	AppNamespace                 string
	SourceIndex                  int
	SourceName                   string
	Project                      string
	Namespace                    string
	EnableAVPCompat              bool
	QuietAVPCompat               bool
	EnablePlugins                bool
	Plugin                       *PluginConfig
	KubeVersion                  string
	APIVersions                  []string
	BuildOptions                 []string
	Kustomize                    *argoappv1.ApplicationSourceKustomize
	Jsonnet                      argoappv1.ApplicationSourceJsonnet
	ArgoEnv                      argoappv1.Env
	RefRoots                     map[string]string
	RefSources                   map[string]ResolvedSource
	ReleaseName                  string
	ValuesObject                 map[string]any
	ValuesMergeMode              string
	ValueFiles                   []string
	ValueFilesBaseDir            string
	ValueFilesBoundaryRoot       string
	IgnoreMissingValueFiles      bool
	HelmParameters               []argoappv1.HelmParameter
	HelmFileParameters           []argoappv1.HelmFileParameter
	HelmValueFileSchemes         []string
	HelmValueFileSchemesSet      bool
	SkipSchemaValidation         bool
	PassCredentials              bool
	DirectoryRecurse             bool
	DirectoryInclude             string
	DirectoryExclude             string
	ChartCacheDir                string
	OfflineCharts                bool
	RefreshCharts                bool
	ChartForbiddenRoots          []string
	ChartCredentials             chart.ChartCredentials
	ChartAcquirer                chart.Acquirer
	HelmChartLoadCache           *HelmChartLoadCache
	OCIChartRepositories         map[string]bool
	RemoteResourceCacheDir       string
	OfflineRemoteResources       bool
	RefreshRemoteResources       bool
	RemoteResourceForbiddenRoots []string
	RemoteResourceCredentials    remote.Credentials
	RemoteResourceGitCredentials remote.GitCredentials
	RemoteResourceAcquirer       remote.Acquirer
	CacheEventRecorder           *cacheevent.Recorder
	AcquisitionCollector         *cacheevent.AcquisitionCollector
	IncludeCRDs                  bool
	IncludeCRDsSet               bool
	SkipHooks                    bool
	SkipTests                    bool
}

type Renderer

type Renderer interface {
	Render(ctx context.Context, source ResolvedSource, opts RenderOptions) ([]Manifest, []diagnostic.Diagnostic, error)
}

type ResolvedSource

type ResolvedSource struct {
	RepoRoot       string
	Path           string
	Chart          string
	RepoURL        string
	TargetRevision string
	ExplicitType   argoappv1.ApplicationSourceType
}

Jump to

Keyboard shortcuts

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