Dagger
Search

argocd

This module has been generated via dagger init and serves as a reference to
basic module structure as you get started with Dagger.

Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.

The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.

Installation

dagger install github.com/stuttgart-things/dagger/argocd@v0.102.0

Entrypoint

Return Type
Argocd
Example
dagger -m github.com/stuttgart-things/dagger/argocd@fd343633de7d598074d523c4cb6c2781eb2202bc call \
func (m *MyModule) Example() *dagger.Argocd  {
	return dag.
			Argocd()
}
@function
def example() -> dagger.Argocd:
	return (
		dag.argocd()
	)
@func()
example(): Argocd {
	return dag
		.argocd()
}

Types

Argocd 🔗

addCluster() 🔗

AddCluster registers a Kubernetes cluster in ArgoCD via argocd cluster add.

Builds a Wolfi-based container, installs kubectl and the argocd CLI (downloaded directly from the upstream GitHub release), logs in to the ArgoCD server, renames the kubeconfig context to clusterName when needed (handy for k3s/k3d kubeconfigs whose context is just “default”), and runs argocd cluster add <clusterName> --yes. When labels are provided, argocd cluster set is invoked afterwards to apply them.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
kubeConfigSecret !-Kubeconfig of the target cluster to register
argocdServerString !-ArgoCD server address (host[:port], no scheme)
usernameString !-ArgoCD username
passwordSecret !-ArgoCD password
clusterNameString !-Display name for the cluster in ArgoCD (also the renamed kubeconfig context)
baseImageString "cgr.dev/chainguard/wolfi-base:latest"No description provided
plaintextBoolean trueUse plain HTTP to talk to the ArgoCD server.
insecureBoolean trueSkip TLS verification when talking to the ArgoCD server (ignored if plaintext).
sourceContextString "default"Existing context in the kubeconfig to rename to clusterName. Defaults to "default" to match k3s/k3d kubeconfigs. Set empty to skip the rename.
labels[String ! ] -Labels to apply to the registered cluster via `argocd cluster set --label`. Each entry is key=value, e.g. ["auto-project=true", "env=prod"].
argocdDownloadUrlString "https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64"Download URL for the argocd CLI binary.
Example
dagger -m github.com/stuttgart-things/dagger/argocd@fd343633de7d598074d523c4cb6c2781eb2202bc call \
 add-cluster --kube-config env:MYSECRET --argocd-server string --username string --password env:MYSECRET --cluster-name string
func (m *MyModule) Example(ctx context.Context, kubeConfig *dagger.Secret, argocdServer string, username string, password *dagger.Secret, clusterName string) string  {
	return dag.
			Argocd().
			AddCluster(ctx, kubeConfig, argocdServer, username, password, clusterName)
}
@function
async def example(kube_config: dagger.Secret, argocd_server: str, username: str, password: dagger.Secret, cluster_name: str) -> str:
	return await (
		dag.argocd()
		.add_cluster(kube_config, argocd_server, username, password, cluster_name)
	)
@func()
async example(kubeConfig: Secret, argocdServer: string, username: string, password: Secret, clusterName: string): Promise<string> {
	return dag
		.argocd()
		.addCluster(kubeConfig, argocdServer, username, password, clusterName)
}

baseContainer() 🔗

BaseContainer returns a Wolfi-based container with curl, git, kubectl and the argocd CLI installed. The argocd binary is fetched from the given download URL and placed at /usr/local/bin/argocd.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
baseImageString "cgr.dev/chainguard/wolfi-base:latest"No description provided
argocdDownloadUrlString "https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64"Download URL for the argocd CLI binary.
Example
dagger -m github.com/stuttgart-things/dagger/argocd@fd343633de7d598074d523c4cb6c2781eb2202bc call \
 base-container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Argocd().
			BaseContainer()
}
@function
def example() -> dagger.Container:
	return (
		dag.argocd()
		.base_container()
	)
@func()
example(): Container {
	return dag
		.argocd()
		.baseContainer()
}

verifyCatalog() 🔗

VerifyCatalog is the catalog-wide gate for an argocd app-of-apps tree.

It runs three checks in order and fails fast: 1. linting.ValidateJsonSchema over the whole tree — every *.schema.json parses. 2. Chart.yaml name uniqueness — duplicate names break ArgoCD resolution and are the regression guard for stuttgart-things/argocd#41. 3. helm.Kubeconform per chart — rendered manifests match Kubernetes + CRD schemas.

A chart is any directory containing a Chart.yaml. If a chart dir has a sibling file at /ci/default-values.yaml, it is passed as –values-file so charts with required values still render.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-Root of the argocd catalog (expected to contain Chart.yaml files in subdirs).
schemaLocations[String ! ] -Schema locations passed through to kubeconform. Empty uses helm module defaults.
registrySecretSecret -Registry secret forwarded to helm.Kubeconform for private OCI dependencies.
schemaGlobString "**/*.schema.json"Basename glob for JSON-schema validation, forwarded to linting.ValidateJsonSchema.
Example
dagger -m github.com/stuttgart-things/dagger/argocd@fd343633de7d598074d523c4cb6c2781eb2202bc call \
 verify-catalog --src DIR_PATH
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory) string  {
	return dag.
			Argocd().
			VerifyCatalog(ctx, src)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.argocd()
		.verify_catalog(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.argocd()
		.verifyCatalog(src)
}