argocd
This module has been generated via dagger init and serves as a reference tobasic 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.104.0Entrypoint
Return Type
Argocd Example
dagger -m github.com/stuttgart-things/dagger/argocd@21daac3b26f59ecd1564b574d3005382efd9a5e3 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
| Name | Type | Default Value | Description |
|---|---|---|---|
| kubeConfig | Secret ! | - | Kubeconfig of the target cluster to register |
| argocdServer | String ! | - | ArgoCD server address (host[:port], no scheme) |
| username | String ! | - | ArgoCD username |
| password | Secret ! | - | ArgoCD password |
| clusterName | String ! | - | Display name for the cluster in ArgoCD (also the renamed kubeconfig context) |
| baseImage | String | "cgr.dev/chainguard/wolfi-base:latest" | No description provided |
| plaintext | Boolean | true | Use plain HTTP to talk to the ArgoCD server. |
| insecure | Boolean | true | Skip TLS verification when talking to the ArgoCD server (ignored if plaintext). |
| sourceContext | String | "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"]. |
| argocdDownloadUrl | String | "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@21daac3b26f59ecd1564b574d3005382efd9a5e3 call \
add-cluster --kube-config env:MYSECRET --argocd-server string --username string --password env:MYSECRET --cluster-name stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseImage | String | "cgr.dev/chainguard/wolfi-base:latest" | No description provided |
| argocdDownloadUrl | String | "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@21daac3b26f59ecd1564b574d3005382efd9a5e3 call \
base-containerfunc (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.
Pipeline (fail-fast): 1. linting.ValidateJsonSchema — every *.schema.json under src parses. 2. Chart discovery + Chart.yaml name uniqueness pre-flight. 3. Per chart: helm.Lint + helm.Kubeconform (with ci/default-values.yaml when present so charts with required values still render). 4. argocd#41 regression guard: render each chart twice with different destination.server values and assert the rendered Application metadata.name set differs. Charts that emit no Application resources are skipped.
A chart is any directory containing a Chart.yaml.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | 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. |
| registrySecret | Secret | - | Registry secret forwarded to helm functions for private OCI dependencies. |
| schemaGlob | String | "**/*.schema.json" | Basename glob for JSON-schema validation, forwarded to linting.ValidateJsonSchema. |
Example
dagger -m github.com/stuttgart-things/dagger/argocd@21daac3b26f59ecd1564b574d3005382efd9a5e3 call \
verify-catalog --src DIR_PATHfunc (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)
}