argo

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package argo reads Argo CD Application manifests and turns their Helm sources into chart + values targets.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotApplication = fmt.Errorf("no Argo CD Application found")

ErrNotApplication is returned for YAML files that hold no Application.

Functions

func ChangedFiles

func ChangedFiles(repoRoot, rev string) (map[string]bool, error)

ChangedFiles lists files changed between rev and the working tree, as absolute paths.

func RepoRoot

func RepoRoot(path string) string

RepoRoot returns the top level of the git checkout holding path, or the directory of path when it is not inside a git repository.

Types

type Application

type Application struct {
	File      string
	Name      string
	Namespace string
	Sources   []Source
}

func Load

func Load(path string) (*Application, error)

func Parse

func Parse(data []byte) (*Application, error)

func (*Application) Targets

func (a *Application) Targets(repoRoot string) ([]Target, error)

Targets resolves every Helm source of the Application. `$ref/...` value files and local chart paths are resolved against repoRoot, the root of the checkout that holds the Application.

type Helm

type Helm struct {
	ReleaseName             string                 `json:"releaseName"`
	ValueFiles              []string               `json:"valueFiles"`
	Values                  string                 `json:"values"`
	ValuesObject            map[string]interface{} `json:"valuesObject"`
	Parameters              []Parameter            `json:"parameters"`
	IgnoreMissingValueFiles bool                   `json:"ignoreMissingValueFiles"`
}

type Parameter

type Parameter struct {
	Name        string `json:"name"`
	Value       string `json:"value"`
	ForceString bool   `json:"forceString"`
}

type Source

type Source struct {
	RepoURL        string `json:"repoURL"`
	Chart          string `json:"chart"`
	TargetRevision string `json:"targetRevision"`
	Path           string `json:"path"`
	Ref            string `json:"ref"`
	Helm           *Helm  `json:"helm"`
}

type Target

type Target struct {
	App         string
	Name        string
	SourceIndex int
	Chart       source.Ref
	Release     string
	Namespace   string
	ValueFiles  []string
	Values      string
	ValuesObj   map[string]interface{}
	Parameters  []Parameter
}

Target is one Helm source of an Application, resolved against a local checkout: a chart reference plus the values Argo CD would pass to it.

Jump to

Keyboard shortcuts

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