Showing preview only (2,735K chars total). Download the full file or copy to clipboard to get everything.
Repository: oboukili/terraform-provider-argocd
Branch: main
Commit: 28b0e2242ac6
Files: 168
Total size: 2.6 MB
Directory structure:
gitextract_3leo_80w/
├── .devcontainer.json
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.md
│ │ ├── config.yml
│ │ ├── feature-request.md
│ │ └── question.md
│ ├── PULL_REQUEST_TEMPLATE.MD
│ ├── renovate.json
│ └── workflows/
│ ├── codeql-analysis.yml
│ ├── release.yml
│ ├── stale.yml
│ └── tests.yml
├── .gitignore
├── .golangci.yml
├── .goreleaser.yml
├── .run/
│ └── Template Go Test.run.xml
├── .vscode/
│ └── launch.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── GNUmakefile
├── LICENSE
├── README.md
├── RELEASE.md
├── SECURITY.md
├── argocd/
│ ├── model_provider.go
│ ├── provider.go
│ ├── provider_test.go
│ ├── resource_argocd_account_token.go
│ ├── resource_argocd_account_token_test.go
│ ├── resource_argocd_application.go
│ ├── resource_argocd_application_set.go
│ ├── resource_argocd_application_set_test.go
│ ├── resource_argocd_application_test.go
│ ├── resource_argocd_cluster.go
│ ├── resource_argocd_cluster_test.go
│ ├── schema_application.go
│ ├── schema_application_set.go
│ ├── schema_application_test.go
│ ├── schema_cluster.go
│ ├── schema_label_selector.go
│ ├── schema_metadata.go
│ ├── server_interface.go
│ ├── server_interface_test.go
│ ├── structure_application.go
│ ├── structure_application_set.go
│ ├── structure_cluster.go
│ ├── structure_label_selector.go
│ ├── structure_metadata.go
│ ├── structure_metadata_test.go
│ ├── structures.go
│ ├── utils.go
│ ├── utils_test.go
│ ├── validators.go
│ └── validators_test.go
├── docs/
│ ├── data-sources/
│ │ └── application.md
│ ├── index.md
│ └── resources/
│ ├── account_token.md
│ ├── application.md
│ ├── application_set.md
│ ├── cluster.md
│ ├── gpg_key.md
│ ├── project.md
│ ├── project_token.md
│ ├── repository.md
│ ├── repository_certificate.md
│ └── repository_credentials.md
├── examples/
│ ├── data-sources/
│ │ └── argocd_application/
│ │ └── data-source.tf
│ ├── provider/
│ │ └── provider.tf
│ └── resources/
│ ├── argocd_account_token/
│ │ └── resource.tf
│ ├── argocd_application/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_application_set/
│ │ └── resource.tf
│ ├── argocd_cluster/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_gpg_key/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_project/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_project_token/
│ │ └── resource.tf
│ ├── argocd_repository/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_repository_certificate/
│ │ └── resource.tf
│ └── argocd_repository_credentials/
│ ├── import.sh
│ └── resource.tf
├── go.mod
├── go.sum
├── internal/
│ ├── diagnostics/
│ │ └── diagnostics.go
│ ├── features/
│ │ └── features.go
│ ├── provider/
│ │ ├── data_source_application.go
│ │ ├── data_source_application_test.go
│ │ ├── model_application.go
│ │ ├── model_gpg_key.go
│ │ ├── model_metadata.go
│ │ ├── model_project.go
│ │ ├── model_project_token.go
│ │ ├── model_provider.go
│ │ ├── model_repository.go
│ │ ├── model_repository_certificate.go
│ │ ├── model_repository_credentials.go
│ │ ├── planmodifiers.go
│ │ ├── provider.go
│ │ ├── provider_test.go
│ │ ├── resource_gpg_key.go
│ │ ├── resource_gpg_key_test.go
│ │ ├── resource_project.go
│ │ ├── resource_project_test.go
│ │ ├── resource_project_token.go
│ │ ├── resource_project_token_test.go
│ │ ├── resource_repository.go
│ │ ├── resource_repository_certificate.go
│ │ ├── resource_repository_certificate_test.go
│ │ ├── resource_repository_credentials.go
│ │ ├── resource_repository_credentials_test.go
│ │ ├── resource_repository_test.go
│ │ ├── server_interface.go
│ │ └── server_interface_test.go
│ ├── sync/
│ │ └── mutex.go
│ ├── testhelpers/
│ │ ├── suite.go
│ │ └── testcontainers.go
│ ├── types/
│ │ └── pgp_public_key.go
│ ├── utils/
│ │ └── utils.go
│ └── validators/
│ ├── duration.go
│ ├── enable_oci.go
│ ├── is_dns_subdomain.go
│ ├── metadata_annotations.go
│ ├── metadata_annotations_test.go
│ ├── metadata_labels.go
│ ├── metadata_labels_test.go
│ ├── positive_integer.go
│ ├── project_validators.go
│ ├── repository_certificate.go
│ └── ssh_private_key.go
├── kind-config.yml
├── main.go
├── manifests/
│ ├── install/
│ │ ├── cluster-rbac.yml
│ │ ├── git-private-repository.yml
│ │ ├── kustomization.yml
│ │ ├── namespace.yml
│ │ ├── proxy-service.yml
│ │ └── ssh-identity.key
│ ├── local-dev/
│ │ ├── .gitignore
│ │ ├── account-token.tf
│ │ ├── application-set.tf
│ │ ├── application.tf
│ │ ├── cluster.tf
│ │ ├── data.tf
│ │ ├── gpg-key.tf
│ │ ├── outputs.tf
│ │ ├── project-token.tf
│ │ ├── project.tf
│ │ ├── repository-credentials.tf
│ │ ├── repository.tf
│ │ └── versions.tf
│ ├── overlays/
│ │ ├── v3.1.12/
│ │ │ └── kustomization.yml
│ │ ├── v3.2.6/
│ │ │ └── kustomization.yml
│ │ └── v3.3.0/
│ │ └── kustomization.yml
│ ├── patches/
│ │ ├── argocd-cm.yml
│ │ ├── argocd-cmd-params-cm.yml
│ │ ├── kustomization.yaml
│ │ └── secret.yml
│ └── testdata/
│ ├── custom_namespace.yml
│ └── token_resource.yml
├── scripts/
│ └── update-kubernetes-version.sh
├── templates/
│ └── index.md.tmpl
├── terraform-registry-manifest.json
└── tools/
├── go.mod
├── go.sum
└── tools.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .devcontainer.json
================================================
{
"name": "terraform-provider-argocd",
// officiall MS template from https://github.com/devcontainers/templates/tree/main/src/go
"image": "mcr.microsoft.com/devcontainers/go:2.1-bookworm",
"features": {
// https://github.com/devcontainers/features/tree/main/src/docker-in-docker
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"enableNonRootDocker": "false",
"disableIp6tables": true // experienced issues with missing chains in ip6tables when creating kind clusters
},
// https://github.com/devcontainers/features/tree/main/src/terraform
"ghcr.io/devcontainers/features/terraform:1": {},
// https://github.com/mpriscella/features/tree/main/src/kind
"ghcr.io/mpriscella/features/kind:1": {},
// https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
// https://github.com/rio/features/tree/main/src/kustomize
"ghcr.io/rio/features/kustomize:1": {}
},
"forwardPorts": [
8080 // the "hard-coded" port for forwarded argo-cd"
]
}
================================================
FILE: .github/CODEOWNERS
================================================
* @oboukili @onematchfox @blakepettersson @the-technat @mkilchhofer
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.md
================================================
---
name: "\U0001F41B Bug Report"
about: "If something isn't working as expected \U0001F914."
title: ''
labels: bug
type: bug
---
<!---
Hi there,
Thank you for opening an issue. Please provide as much detail as possible when reporting issue as this benefits all parties and will most likely lead to a quicker resolution of the issue.
--->
### Terraform Version, ArgoCD Provider Version and ArgoCD Version
<!--- Run `terraform -v` to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed. --->
```
Terraform version:
ArgoCD provider version:
ArgoCD version:
```
### Affected Resource(s)
<!-- Please list the resources as a list, for example:
- argocd_application
- argocd_cluster
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this. -->
### Terraform Configuration Files
```hcl
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use an online file storage service and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public release key.
```
### Debug Output
<!--Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist. -->
### Panic Output
<!--If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log` -->
### Steps to Reproduce
<!-- Please list the steps required to reproduce the issue, for example:
1. `terraform apply` -->
### Expected Behavior
<!-- What should have happened? -->
### Actual Behavior
<!-- What actually happened? -->
### Important Factoids
<!-- Are there anything atypical about your accounts that we should know? For example: For general provider/connectivity issues, how is your ArgoCD server exposed? When dealing with cluster resources, what type of cluster are you referencing (where is it hosted)? -->
### References
<!--Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
- GH-1234
-->
### Community Note
<!--- Please keep this note for the community --->
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: Provider Slack Channel
url: https://cloud-native.slack.com/archives/C07PQF40SF8
about: Slack Channel to discuss on the CNCF Workspace
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request.md
================================================
---
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and might want to implement myself \U0001F642)!"
title: ''
labels: enhancement
type: feature
---
### Description
<!-- Please leave a helpful description of the feature request here. -->
### Potential Terraform Configuration
<!-- Information about code formatting: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code -->
```hcl
# Copy-paste a potential Terraform configuration here - for large Terraform configs,
# please use an online file storage service and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public release key.
```
### References
<!-- Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation? -->
### Community Note
<!-- Please keep this note for the community -->
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
================================================
FILE: .github/ISSUE_TEMPLATE/question.md
================================================
---
name: "\U0001F914 Question"
about: "If you need help figuring something out"
title: ''
labels: question
---
<!---
Hi,
Please provide as much information as possible when asking your question.
Please understand that we make a best effort attempt to address questions, but our focus is on provider development. It's still valuable to ask your question because you may receive help from the community, and help us understand common asks.
-->
### Terraform Version, ArgoCD Provider Version and ArgoCD Version
<!--- Run `terraform -v` to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed. --->
```
Terraform version:
ArgoCD provider version:
ArgoCD version:
```
## Terraform configuration
```hcl
# Enter your configuration here.
```
## Question
<!-- Enter your question here. -->
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.MD
================================================
**What type of PR is this?**
[//]: # (Uncomment only one <!-- /kind ... --> line, and delete the rest.)
[//]: # (For example, <!-- /kind bug --> would simply become: /kind bug )
<!-- /kind bug -->
<!-- /kind chore -->
<!-- /kind cleanup -->
<!-- /kind failing-test -->
<!-- /kind enhancement -->
<!-- /kind documentation -->
<!-- /kind code-refactoring -->
**What does this PR do / why we need it**:
**Have you updated the necessary documentation?**
* [ ] Documentation update is required by this PR.
* [ ] Documentation has been updated.
**Which issue(s) this PR fixes**:
Fixes #?
**How to test changes / Special notes to the reviewer**:
================================================
FILE: .github/renovate.json
================================================
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"schedule:weekly"
],
"ignoreDeps": [
"k8s.io/api",
"k8s.io/apiextensions-apiserver",
"k8s.io/apimachinery",
"k8s.io/apiserver",
"k8s.io/cli-runtime",
"k8s.io/client-go",
"k8s.io/cloud-provider",
"k8s.io/cluster-bootstrap",
"k8s.io/code-generator",
"k8s.io/component-base",
"k8s.io/component-helpers",
"k8s.io/controller-manager",
"k8s.io/cri-api",
"k8s.io/cri-client",
"k8s.io/csi-translation-lib",
"k8s.io/dynamic-resource-allocation",
"k8s.io/endpointslice",
"k8s.io/externaljwt",
"k8s.io/kms",
"k8s.io/kube-aggregator",
"k8s.io/kube-controller-manager",
"k8s.io/kube-proxy",
"k8s.io/kube-scheduler",
"k8s.io/kubectl",
"k8s.io/kubelet",
"k8s.io/legacy-cloud-providers",
"k8s.io/metrics",
"k8s.io/mount-utils",
"k8s.io/pod-security-admission",
"k8s.io/sample-apiserver",
"k8s.io/sample-cli-plugin",
"k8s.io/sample-controller"
],
"postUpdateOptions": [
"gomodTidy"
],
"labels": [
"dependencies"
],
"packageRules": [
{
"matchPackageNames": [
"/terraform-plugin-framework/",
"/terraform-plugin-mux/",
"/terraform-plugin-go/",
"/terraform-plugin-testing/",
"/terraform-plugin-sdk/"
],
"groupName": "terraform-plugin-framework"
},
{
"matchPackageNames": [
"/go/"
],
"addLabels": [
"go"
]
},
{
"matchDepTypes": [
"/github/"
],
"addLabels": [
"github_actions"
]
}
],
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": [
"/(^|\\/).*\\.ya?ml$/"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+.+[vV]ersion: (?<currentValue>.*)"
]
}
]
}
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: "CodeQL"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "15 0 * * 5"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: go
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
if: matrix.language == 'go'
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
cache: true
- name: Initialize CodeQL
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended,security-and-quality
- name: Build provider
if: matrix.language == 'go'
run: make build
- name: Build tests
if: matrix.language == 'go'
run: TF_ACC=1 go test -c ./...
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
category: "/language:${{matrix.language}}"
================================================
FILE: .github/workflows/release.yml
================================================
---
name: Release
on:
push:
tags: ['v*']
# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-24.04
steps:
- name: Free up disk space
run: |
# Remove Java (JDKs)
sudo rm -rf /usr/lib/jvm
# Remove .NET SDKs
sudo rm -rf /usr/share/dotnet
# Remove Swift toolchain
sudo rm -rf /usr/share/swift
# Remove Haskell (GHC)
sudo rm -rf /usr/local/.ghcup
# Remove Julia
sudo rm -rf /usr/local/julia*
# Remove Android SDKs
sudo rm -rf /usr/local/lib/android
# Remove Chromium (optional if not using for browser tests)
sudo rm -rf /usr/local/share/chromium
# Remove Microsoft/Edge and Google Chrome builds
sudo rm -rf /opt/microsoft /opt/google
# Remove Azure CLI
sudo rm -rf /opt/az
# Remove PowerShell
sudo rm -rf /usr/local/share/powershell
docker system prune -af || true
docker builder prune -af || true
df -h
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
cache: true
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
================================================
FILE: .github/workflows/stale.yml
================================================
## Reference: https://github.com/actions/stale
name: 'Close stale Issues/PRs'
on:
schedule:
- cron: '30 12 * * *'
permissions:
contents: read
jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 90
days-before-close: 20
# Issue settings
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
exempt-issue-labels: "on-hold,pinned,good first issue,help wanted"
# PR Settings
stale-pr-message: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
exempt-pr-labels: "on-hold,pinned"
================================================
FILE: .github/workflows/tests.yml
================================================
---
name: Tests
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
pull_request:
branches: [main]
paths-ignore:
- 'README.md'
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
cache: true
- name: Build provider
run: make build
- name: Run linters
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
# renovate: datasource=github-tags depName=golangci/golangci-lint
version: v2.11.4
generate:
name: Generate
runs-on: ubuntu-24.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
cache: true
# We need the latest version of Terraform for our documentation generation to use
- uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
name: Setup Terraform
with:
terraform_wrapper: false
- name: Generate
run: make generate
- name: Confirm no diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate' command and commit."; exit 1)
acceptance_tests:
name: Acceptance Tests
needs:
- build
- generate
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
argocd_version: ['v3.1.12', 'v3.2.6', 'v3.3.0']
terraform_version: ['1.13.*']
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Setup Terraform ${{ matrix.terraform_version }}
uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false
- name: Install Kustomize
run: |
curl -sL "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
chmod +x ./kustomize
- name: Install Kind 0.24.0
run: |
curl -sLo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-$(uname)-amd64
chmod +x ./kind
- name: Set up ArgoCD ${{ matrix.argocd_version }}
env:
ARGOCD_VERSION: ${{ matrix.argocd_version }}
run: |
make testacc_prepare_env
until $(nc -z 127.0.0.1 8080); do sleep 2;done
netstat -tulpn
- name: Download go deps for tests
run: go mod download
- name: Run acceptance tests
env:
ARGOCD_VERSION: ${{ matrix.argocd_version }}
USE_TESTCONTAINERS: false
run: make testacc
# This job aggregates test results. It's the required check for branch protection.
# https://github.com/marketplace/actions/alls-green#why
# https://github.com/orgs/community/discussions/33579
success:
name: Acceptance Tests successful
if: always()
needs:
- acceptance_tests
runs-on: ubuntu-24.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
================================================
FILE: .gitignore
================================================
terraform-provider-argocd
/manifests/install/argocd.yml
/bin
.idea
# Env variables settings
/scripts/testacc
/scripts/testacc_prepare_env
# debug build
__debug_bin*
# local reproduction folders
reproduce/
================================================
FILE: .golangci.yml
================================================
version: "2"
linters:
default: none
enable:
- asasalint
- asciicheck
- containedctx
- contextcheck
- copyloopvar
- depguard
- dogsled
- durationcheck
- errcheck
- errname
- errorlint
- goconst
- gocritic
- govet
- ineffassign
- makezero
- misspell
- mnd
- nakedret
- nilerr
- nolintlint
- paralleltest
- predeclared
- staticcheck
- tparallel
- unconvert
- unparam
- unused
- usetesting
- whitespace
settings:
depguard:
rules:
main:
deny:
- pkg: github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest
desc: "Use github.com/hashicorp/terraform-plugin-testing/helper/acctest instead"
- pkg: github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource
desc: "Use github.com/hashicorp/terraform-plugin-testing/helper/resource instead"
- pkg: github.com/hashicorp/terraform-plugin-sdk/v2/terraform
desc: "Use github.com/hashicorp/terraform-plugin-testing/terraform instead"
dogsled:
max-blank-identifiers: 3
errcheck:
exclude-functions:
- github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set
- fmt:.*
- io:Close
errorlint:
errorf: false
goconst:
min-occurrences: 6
gocritic:
enabled-tags:
- diagnostic
disabled-tags:
- style
- performance
- experimental
- opinionated
mnd:
checks:
- argument
ignored-functions:
- resource.Retry
- schema.DefaultTimeout
- validation.*
- int64validator.*
- listvalidator.*
- stringvalidator.*
- SetDefaultCreateTimeout
- SetDefaultReadTimeout
- SetDefaultUpdateTimeout
- SetDefaultDeleteTimeout
- make
- strconv.FormatFloat
- strconv.FormatInt
- strconv.ParseFloat
- strconv.ParseInt
- strings.SplitN
nolintlint:
require-explanation: true
require-specific: true
allow-no-explanation:
- gomnd
- paralleltest
- tparallel
- unparam
allow-unused: false
predeclared:
ignore:
- cap
- close
- copy
- delete
- len
- new
staticcheck:
checks:
- -SA1019
- -ST1005
- all
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- paralleltest
text: Function TestAcc
- linters:
- tparallel
text: TestAcc
- linters:
- unparam
text: always receives
- linters:
- contextcheck
path: _test\.go
- linters:
- goconst
path: (.+)_test\.go
- linters:
- staticcheck
text: "ST1003:"
- linters:
- staticcheck
text: "SA1019:"
path: internal/types/pgp_public_key.go
paths:
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 0
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
================================================
FILE: .goreleaser.yml
================================================
---
version: 2
builds:
- env:
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
targets:
- darwin_arm64
- darwin_amd64
- linux_amd64
- linux_arm
- linux_arm64
- windows_amd64
- windows_arm
- windows_386
- freebsd_amd64
- freebsd_arm
binary: "{{ .ProjectName }}_v{{ .Version }}"
archives:
- formats: ["zip"]
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
signs:
- artifacts: checksum
args:
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
draft: false
disable: false
github:
owner: argoproj-labs
name: terraform-provider-argocd
changelog:
use: github-native
================================================
FILE: .run/Template Go Test.run.xml
================================================
<component name="ProjectRunConfigurationManager">
<configuration default="true" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="terraform-provider-argocd" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<envs>
<env name="ARGOCD_VERSION" value="v3.3.0" />
<env name="ARGOCD_INSECURE" value="true" />
<env name="ARGOCD_SERVER" value="127.0.0.1:8080" />
<env name="ARGOCD_AUTH_USERNAME" value="admin" />
<env name="ARGOCD_AUTH_PASSWORD" value="acceptancetesting" />
<env name="ARGOCD_CONTEXT" value="kind-argocd" />
<env name="USE_TESTCONTAINERS" value="true" />
<env name="K3S_VERSION" value="v1.34.3-k3s3" />
<env name="TF_ACC" value="1" />
</envs>
<framework value="gotest" />
<kind value="DIRECTORY" />
<package value="github.com/argoproj-labs/terraform-provider-argocd" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
</component>
================================================
FILE: .vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Terraform Provider",
"type": "go",
"request": "launch",
"mode": "debug",
"outputMode": "remote",
"program": "${workspaceFolder}",
"env": {},
"args": [
"-debug"
]
},
{
"name": "Debug Selected Test",
"request": "launch",
"type": "go",
"args": [
"-test.v",
"-test.run",
"^${selectedText}$"
],
"mode": "auto",
"program": "${fileDirname}",
"env": {
"PKG_NAME": "${relativeFileDirname}",
"TF_ACC": "1",
"TF_LOG": "info",
"ARGOCD_INSECURE": "true",
"ARGOCD_SERVER": "127.0.0.1:8080",
"ARGOCD_AUTH_USERNAME": "admin",
"ARGOCD_AUTH_PASSWORD": "acceptancetesting"
},
"showLog": true
}
]
}
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Code of conduct
While this provider is not a [Cloud Native Computing Foundation](https://www.cncf.io/) (CNCF) project, it supports, endorses, and
echoes the code of conduct presented by the CNCF. The CNCF code of conduct can be found
[here](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). Full credit goes to the CNCF project for
establishing the linked code of conduct principles.
Instances of behaviors that are not aligned with the values proposed by CNCF can be reported to the repository admins via Github's reporting feature.
See [Reporting Abuse or Spam](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam) for details how to do so.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
Contributions are welcome!
[](https://github.com/argoproj-labs/terraform-provider-argocd)
[](https://github.com/argoproj-labs/terraform-provider-argocd)
[](https://github.com/argoproj-labs/hera/terraofrm-provider-argocd)
## New Contributor Guide
If you are a new contributor this section aims to show you everything you need to get started.
We especially welcome contributions to issues that are labeled with ["good-first-issue"](https://github.com/argoproj-labs/terraform-provider-argocd/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22good%20first%20issue%22)
or
["help-wanted"](https://github.com/argoproj-labs/terraform-provider-argocd/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22help%20wanted%22).
We also encourage contributions in the form of:
- bug/crash reports
- Answering questions on [Slack](https://cloud-native.slack.com/archives/C07PQF40SF8)
- Posting your use-case for the provider on [Slack](https://cloud-native.slack.com/archives/C07PQF40SF8) / Blog Post
### Setting up
To contribute to this Provider you need the following tools installed locally:
* [Go](https://go.dev/doc/install) (1.25)
* [GNU Make](https://www.gnu.org/software/make/)
* [Kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/)
* [Container runtime](https://java.testcontainers.org/supported_docker_environment/)
* [Kind](https://kind.sigs.k8s.io) (optional)
* [golangci-lint](https://golangci-lint.run/usage/install/#local-installation) (optional)
#### Codespaces
If you don't want to install tools locally you can use Github Codespaces to contribute to this project. We have a pre-configured codespace that should have all tools installed already:
[](https://github.com/codespaces/new/argoproj-labs/terraform-provider-argocd)
## Contributing checklist
Please keep in mind the following guidelines and practices when contributing to the Provider:
1. Your commit must be signed (`git commit --signoff`). We use the [DCO application](https://github.com/apps/dco)
that enforces the Developer Certificate of Origin (DCO) on commits.
1. Use `make fmt` to format the repository code.
1. Use `make lint` to lint the project.
1. Use `make generate` to generate documentation on schema changes
1. Add unit tests for any new code you write.
1. Add an example, or extend an existing example in the [examples](./examples), with any new features you may add. Use `make generate` to add examples to the docs
## Building
1. `git clone` this repository and `cd` into its directory
2. `make build` will trigger the Golang build and place it's binary in `<git-repo-path>/bin/terraform-provider-argocd`
The provided `GNUmakefile` defines additional commands generally useful during
development, like for running tests, generating documentation, code formatting
and linting. Taking a look at its content is recommended.
## Testing
The acceptance tests run against a disposable ArgoCD installation within a containerized-K3s cluster. We are using [testcontainers](https://testcontainers.com) for this. If you have a [supported container runtime](https://java.testcontainers.org/supported_docker_environment/) installed you can simply run the tests using:
```sh
make testacc # to run all the Terraform tests
make test # to only run helper unit tests (minority of the testcases)
```
## Documentation
This provider uses [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/)
to generate documentation and store it in the `docs/` directory.
Once a release is cut, the Terraform Registry will download the documentation from `docs/`
and associate it with the release version. Read more about how this works on the
[official page](https://www.terraform.io/registry/providers/docs).
Use `make generate` to ensure the documentation is regenerated with any changes.
## Debugging
We have some pre-made config to debug and run the provider using VSCode. If you are using another IDE take a look at [Hashicorp's Debug docs](https://developer.hashicorp.com/terraform/plugin/debugging#starting-a-provider-in-debug-mode) for instructions or adapt [.vscode/launch.json](.vscode/launch.json) for your IDE
### Running the Terraform provider in debug mode (VSCode-specific)
To use the preconfigured debug config in VS Code open the Debug tab and select the profile "Debug Terraform Provider". Set some breakpoints and then run this task.
Head to the debug console and copy the line where it says `TF_REATTACH_PROVIDERS` to the clipboard.
Open a terminal session and export the `TF_REATTACH_PROVIDERS` variable in this session. Every Terraform CLI command in this terminal session will then ensure it's using the provider already running inside VS Code and attach to it.
Example of such a command:
```console
export TF_REATTACH_PROVIDERS='{"registry.terraform.io/argoproj-labs/argocd":{"Protocol":"grpc","ProtocolVersion":6,"Pid":2065,"Test":true,"Addr":{"Network":"unix","String":"/var/folders/rj/_02y2jmn3k1bxx45wlzt2dkc0000gn/T/plugin193859953"}}}'
terraform apply -auto-approve # will use the provider running in debug-mode
```
**Note**: if the provider crashes or you restart the debug-session you have to re-export this variable to your terminal for the Terraform CLI to find the already running provider!
### Running acceptance tests in debug mode (VSCode-specific)
Open a test file, **hover** over a test function's name and then in the Debug tab of VSCode select "Debug selected Test". This will run the test you selected with the specific arguments required for Terraform to run the acceptance test.
**Note**: You shouldn't use the builtin "Debug Test" profile that is shown when hovering over a test function since it doesn't contain the necessary configuration to find your Argo CD environment.
## Run Terraform using a local build
It's possible to set up a local terraform configuration to use a development build of the
provider. This can be achieved by leveraging the Terraform CLI [configuration
file development
overrides](https://www.terraform.io/cli/config/config-file#development-overrides-for-provider-developers).
First, use `make install` to place a fresh development build of the provider in
your
[`${GOBIN}`](https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies)
(defaults to `${GOPATH}/bin` or `${HOME}/go/bin` if `${GOPATH}` is not set).
Repeat this every time you make changes to the provider locally.
Note: you can also use `make build` to place the binary into `<git-repo-path>/bin/terraform-provider-argocd` instead.
Then write this config to a file:
```hcl filename="../reproduce/.terraformrc"
provider_installation {
dev_overrides {
"argoproj-labs/argocd" = "/Users/username/go/bin" # path must be absolute and point to the directoy containing the binary
}
direct {}
}
```
And lastly use the following environment variable in a terminal session to tell Terraform to use this file for picking up the development binary:
```console
export TF_CLI_CONFIG_FILE=../.reproduce/.terraformrc
terraform plan # will not use the local provider build
```
For further reference consult [HashiCorp's article](https://www.terraform.io/plugin/debugging#terraform-cli-development-overrides) about this topic.
## Dependency Management
### K8s version
In our CI we test against a Kubernetes version that is supported by all Argo CD versions we support.
That version can be obtained when looking at [this table](https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/#tested-versions) in the Argo CD documentation.
### Argo CD client-lib
Some dependencies we use are strictly aligned with the Argo CD client-lib that we use and should only be updated together:
- github.com/argoproj/gitops-engine
- k8s.io/*
Please **don't update** any of these dependencies without having discussed this first!
================================================
FILE: GNUmakefile
================================================
default: build
# To see which other env vars are set, please refer to internal/testhelpers/suite.go
TEST_FILTER?=
export
build:
go build -v -o bin/ ./...
install: build
go install -v ./...
# See https://golangci-lint.run/
lint:
golangci-lint run
generate:
cd tools; go generate ./...
fmt:
gofmt -s -w -e .
test:
go test -v -cover -timeout=120s -parallel=4 -run="$(TEST_FILTER)" ./...
testacc:
TF_ACC=1 go test -v -cover -timeout 20m -run="$(TEST_FILTER)" ./...
testacc_clean_env:
kind delete cluster --name argocd
testacc_prepare_env:
echo "\n--- Clearing current kube context\n"
kubectl config unset current-context
echo "\n--- Kustomize sanity checks\n"
kustomize version || exit 1
echo "\n--- Create Kind cluster\n"
kind create cluster --config kind-config.yml
echo "\n--- Kind sanity checks\n"
kubectl get nodes -o wide
kubectl get pods --all-namespaces -o wide
kubectl get services --all-namespaces -o wide
echo "\n--- Install ArgoCD ${ARGOCD_VERSION}\n"
kustomize build manifests/overlays/${ARGOCD_VERSION} | kubectl apply --server-side --force-conflicts -f -
echo "\n--- Wait until CRDs are established\n"
kubectl wait --for=condition=Established crd/applications.argoproj.io --timeout=60s
kubectl wait --for=condition=Established crd/applicationsets.argoproj.io --timeout=60s
kubectl wait --for=condition=Established crd/appprojects.argoproj.io --timeout=60s
echo "\n--- Install ArgoCD test data\n"
kubectl apply -f manifests/testdata/
echo "\n--- Wait for ArgoCD components to be ready...\n"
kubectl wait --for=condition=available --timeout=600s deployment/argocd-server -n argocd
kubectl wait --for=condition=available --timeout=30s deployment/argocd-repo-server -n argocd
kubectl wait --for=condition=available --timeout=30s deployment/argocd-dex-server -n argocd
kubectl wait --for=condition=available --timeout=30s deployment/argocd-redis -n argocd
clean:
git clean -fXd -e \!vendor -e \!vendor/**/* -e \!.vscode
.PHONY: build install lint generate fmt test testacc testacc_testcontainers testacc_clean_env testacc_prepare_env clean
================================================
FILE: LICENSE
================================================
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
================================================
FILE: README.md
================================================
<a href="https://terraform.io">
<img src=".github/tf.png" alt="Terraform logo" title="Terraform" align="left" height="50" />
</a>
<a href="https://argoproj.github.io/cd">
<img src=".github/argo-cd.png" alt="Terraform logo" title="Terraform" align="right" height="50" />
</a>
# Terraform Provider for ArgoCD
[](https://github.com/argoproj-labs/terraform-provider-argocd/actions/workflows/tests.yml)
The [ArgoCD Terraform
Provider](https://registry.terraform.io/providers/argoproj-labs/argocd/latest/docs)
provides lifecycle management of
[ArgoCD](https://argo-cd.readthedocs.io/en/stable/) resources.
**NB**: The provider is not concerned with the installation/configuration of
ArgoCD itself. To make use of the provider, you will need to have an existing
ArgoCD deployment and, the ArgoCD API server must be
[accessible](https://argo-cd.readthedocs.io/en/stable/getting_started/#3-access-the-argo-cd-api-server)
from where you are running Terraform.
---
## Documentation
Official documentation on how to use this provider can be found on the
[Terraform
Registry](https://registry.terraform.io/providers/argoproj-labs/argocd/latest/docs).
## Version Compatibility
The provider supports all versions Argo-CD itself currently supports. See the [Argo CD documentation](https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/#supported-versions) for supported versions.
The following table shows the versions of Argo CD that are tested with each version of the provider.
| Provider version | Argo CD versions |
|---|---|
| 7.13 | v3.1, v3.2, v3.3 |
| 7.12 | v3.0, v3.1, v3.2 |
| 7.11 | v2.14, v3.0, v3.1 |
| 7.7 | v2.13, v2.14, v3.0 |
| 7.5 | v2.12, v2.13, v2.14 |
| 7.4 | v2.11, v2.12, v2.13 |
| 7.2 | v2.10, v2.11, v2.12 |
| 7.1 | v2.9, v2.10, v2.11 |
| 7.0 | v2.8, v2.9, v2.10 |
| 6.x | v2.8, v2.9, v2.10 |
Note: these numbers are based on our testing matrix that tests the provider against these versions of Argo CD. You may be able to use other provider versions as the ones listed here and it may still work.
## Motivations
### *I thought ArgoCD already allowed for 100% declarative configuration?*
While that is true through the use of ArgoCD Kubernetes Custom Resources, there
are some resources that simply cannot be managed using Kubernetes manifests,
such as project roles JWTs whose respective lifecycles are better handled by a
tool like Terraform. Even more so when you need to export these JWTs to another
external system using Terraform, like a CI platform.
### *Wouldn't using a Kubernetes provider to handle ArgoCD configuration be enough?*
Existing Kubernetes providers do not patch arrays of objects, losing project
role JWTs when doing small project changes just happen.
ArgoCD Kubernetes admission webhook controller is not as exhaustive as ArgoCD
API validation, this can be seen with RBAC policies, where no validation occur
when creating/patching a project.
Using Terraform to manage Kubernetes Custom Resource becomes increasingly
difficult the further you use HCL2 DSL to merge different data structures *and*
want to preserve type safety.
Whatever the Kubernetes CRD provider you are using, you will probably end up
using `locals` and the `yamlencode` function **which does not preserve the
values' type**. In these cases, not only the readability of your Terraform plan
will worsen, but you will also be losing some safeties that Terraform provides
in the process.
## Upgrading
### Migrate provider source `oboukili` -> `argoproj-labs`
As announced in the releases [v6.2.0] and [v7.0.0], we moved the provider from "github.com/**oboukili**/terraform-provider-argocd/"
to "github.com/**argoproj-labs**/terraform-provider-argocd". Users need to migrate their Terraform state according to
HashiCorps [replace-provider] docs. In summary, you can do the following:
1. List currently used providers
```bash
$ terraform providers
Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/helm] 2.15.0
├── (..)
└── provider[registry.terraform.io/oboukili/argocd] 6.1.1
Providers required by state:
(..)
provider[registry.terraform.io/oboukili/argocd]
provider[registry.terraform.io/hashicorp/helm]
```
2. **If you see** the provider "registry.terraform.io/**oboukili**/argocd", you can update the provider specification:
```diff
--- a/versions.tf
+++ b/versions.tf
@@ -5,7 +5,7 @@ terraform {
}
argocd = {
- source = "oboukili/argocd"
+ source = "argoproj-labs/argocd"
version = "6.1.1"
}
helm = {
```
3. Download the new provider via `terraform init`:
```bash
$ terraform init
Initializing HCP Terraform...
Initializing provider plugins...
- Finding (..)
- Finding oboukili/argocd versions matching "6.1.1"...
- Finding latest version of argoproj-labs/argocd...
- (..)
- Installing oboukili/argocd v6.1.1...
- Installed oboukili/argocd v6.1.1 (self-signed, key ID 09A6EABF546E8638)
- Installing argoproj-labs/argocd v7.0.0...
- Installed argoproj-labs/argocd v7.0.0 (self-signed, key ID 6421DA8DFD8F48D0)
(..)
HCP Terraform has been successfully initialized!
(..)
```
4. Then, execute the migration via `terraform state replace-provider`:
```bash
$ terraform state replace-provider registry.terraform.io/oboukili/argocd registry.terraform.io/argoproj-labs/argocd
Terraform will perform the following actions:
~ Updating provider:
- registry.terraform.io/oboukili/argocd
+ registry.terraform.io/argoproj-labs/argocd
Changing 5 resources:
argocd_project.apps_with_clusterroles
argocd_application.app_of_apps
argocd_project.base
argocd_project.apps_restricted
argocd_project.core_services_unrestricted
Do you want to make these changes?
Only 'yes' will be accepted to continue.
Enter a value: yes
Successfully replaced provider for 5 resources.
```
5. You have successfully migrated
## Credits
* We would like to thank [Olivier Boukili] for creating this awesome Terraform provider and moving the project over to
[argoproj-labs] on Apr 5th 2024.
[argoproj-labs]: https://github.com/argoproj-labs
[Olivier Boukili]: https://github.com/oboukili
[v6.2.0]: https://github.com/argoproj-labs/terraform-provider-argocd/releases/tag/v6.2.0
[v7.0.0]: https://github.com/argoproj-labs/terraform-provider-argocd/releases/tag/v7.0.0
[replace-provider]: https://developer.hashicorp.com/terraform/cli/commands/state/replace-provider
================================================
FILE: RELEASE.md
================================================
# Provider release process
Our release process relies on [Goreleaser](https://goreleaser.com) for automatically building provider binaries for all architectures, signing them and generating a Github release with the binaries attached.
## Publishing a new version
Once the maintainers are ready to publish a new version, they can create a new git tag starting with `v*` and following [semver](https://semver.org). Pushing this tag will trigger a Github action that runs goreleaser.
They will find a new release with the appropriate version, changelog and attached artifacts on github, that was automatically marked as latest.
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Reporting a Vulnerability
We have enabled the ability to privately report security issues through the Security tab above.
[Here are the details on how to file a new vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability).
A repository owner/maintainer will respond as fast as possible to coordinate confirmation of the issue and remediation.
Thank you for helping to ensure this code stays secure!
================================================
FILE: argocd/model_provider.go
================================================
package argocd
import (
"bytes"
"context"
"fmt"
"net/url"
"github.com/argoproj-labs/terraform-provider-argocd/internal/diagnostics"
"github.com/argoproj/argo-cd/v3/cmd/argocd/commands/headless"
"github.com/argoproj/argo-cd/v3/pkg/apiclient"
"github.com/argoproj/argo-cd/v3/pkg/apiclient/session"
"github.com/argoproj/argo-cd/v3/util/io"
"github.com/argoproj/argo-cd/v3/util/localconfig"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/types"
apimachineryschema "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"
)
type ArgoCDProviderConfig struct {
// Configuration for standard login using either with username/password or auth_token
AuthToken types.String `tfsdk:"auth_token"`
Username types.String `tfsdk:"username"`
Password types.String `tfsdk:"password"`
// When using standard login either server address or port forwarding must be used
ServerAddr types.String `tfsdk:"server_addr"`
PortForward types.Bool `tfsdk:"port_forward"`
PortForwardWithNamespace types.String `tfsdk:"port_forward_with_namespace"`
Kubernetes []Kubernetes `tfsdk:"kubernetes"`
// Run ArgoCD API server locally
Core types.Bool `tfsdk:"core"`
// Login using credentials from local ArgoCD config file
UseLocalConfig types.Bool `tfsdk:"use_local_config"`
ConfigPath types.String `tfsdk:"config_path"`
Context types.String `tfsdk:"context"`
// Other configuration
CertFile types.String `tfsdk:"cert_file"`
ClientCertFile types.String `tfsdk:"client_cert_file"`
ClientCertKey types.String `tfsdk:"client_cert_key"`
GRPCWeb types.Bool `tfsdk:"grpc_web"`
GRPCWebRootPath types.String `tfsdk:"grpc_web_root_path"`
Headers types.Set `tfsdk:"headers"`
Insecure types.Bool `tfsdk:"insecure"`
PlainText types.Bool `tfsdk:"plain_text"`
UserAgent types.String `tfsdk:"user_agent"`
}
func (p ArgoCDProviderConfig) getApiClientOptions(ctx context.Context) (*apiclient.ClientOptions, diag.Diagnostics) {
var diags diag.Diagnostics
opts := &apiclient.ClientOptions{
AuthToken: getDefaultString(p.AuthToken, "ARGOCD_AUTH_TOKEN"),
CertFile: p.CertFile.ValueString(),
ClientCertFile: p.ClientCertFile.ValueString(),
ClientCertKeyFile: p.ClientCertKey.ValueString(),
GRPCWeb: p.GRPCWeb.ValueBool(),
GRPCWebRootPath: p.GRPCWebRootPath.ValueString(),
Insecure: getDefaultBool(ctx, p.Insecure, "ARGOCD_INSECURE"),
PlainText: p.PlainText.ValueBool(),
PortForward: p.PortForward.ValueBool(),
PortForwardNamespace: p.PortForwardWithNamespace.ValueString(),
ServerAddr: getDefaultString(p.ServerAddr, "ARGOCD_SERVER"),
UserAgent: p.Username.ValueString(),
}
if !p.Headers.IsNull() {
var h []string
diags.Append(p.Headers.ElementsAs(ctx, &h, false)...)
opts.Headers = h
}
coreEnabled, d := p.setCoreOpts(opts)
diags.Append(d...)
localConfigEnabled, d := p.setLocalConfigOpts(opts)
diags.Append(d...)
portForwardingEnabled, d := p.setPortForwardingOpts(ctx, opts)
diags.Append(d...)
username := getDefaultString(p.Username, "ARGOCD_AUTH_USERNAME")
password := getDefaultString(p.Password, "ARGOCD_AUTH_PASSWORD")
usernameAndPasswordSet := username != "" && password != ""
switch {
// Provider configuration errors
case !coreEnabled && !portForwardingEnabled && !localConfigEnabled && opts.ServerAddr == "":
diags.Append(diagnostics.Error("invalid provider configuration: one of `core,port_forward,port_forward_with_namespace,use_local_config,server_addr` must be specified", nil)...)
case portForwardingEnabled && opts.AuthToken == "" && !usernameAndPasswordSet:
diags.Append(diagnostics.Error("invalid provider configuration: either `username/password` or `auth_token` must be specified when port forwarding is enabled", nil)...)
case opts.ServerAddr != "" && !coreEnabled && opts.AuthToken == "" && !usernameAndPasswordSet:
diags.Append(diagnostics.Error("invalid provider configuration: either `username/password` or `auth_token` must be specified if `server_addr` is specified", nil)...)
}
if diags.HasError() {
return nil, diags
}
switch {
// Handle "special" configuration use-cases
case coreEnabled:
// HACK: `headless.StartLocalServer` manipulates this global variable
// when starting the local server without checking it's length/contents
// which leads to a panic if called multiple times. So, we need to
// ensure we "reset" it before calling the method.
if runtimeErrorHandlers == nil {
runtimeErrorHandlers = runtime.ErrorHandlers
} else {
runtime.ErrorHandlers = runtimeErrorHandlers
}
_, err := headless.MaybeStartLocalServer(ctx, opts, "", nil, nil, nil)
if err != nil {
diags.Append(diagnostics.Error("failed to start local server", err)...)
return nil, diags
}
case opts.ServerAddr != "" && opts.AuthToken == "" && usernameAndPasswordSet:
apiClient, err := apiclient.NewClient(opts)
if err != nil {
diags.Append(diagnostics.Error("failed to create new API client", err)...)
return nil, diags
}
closer, sc, err := apiClient.NewSessionClient()
if err != nil {
diags.Append(diagnostics.Error("failed to create new session client", err)...)
return nil, diags
}
defer io.Close(closer)
sessionOpts := session.SessionCreateRequest{
Username: username,
Password: password,
}
resp, err := sc.Create(ctx, &sessionOpts)
if err != nil {
diags.Append(diagnostics.Error("failed to create new session", err)...)
return nil, diags
}
opts.AuthToken = resp.Token
}
return opts, diags
}
func (p ArgoCDProviderConfig) setCoreOpts(opts *apiclient.ClientOptions) (bool, diag.Diagnostics) {
var diags diag.Diagnostics
coreEnabled := p.Core.ValueBool()
if coreEnabled {
if opts.ServerAddr != "" {
diags.AddWarning("`server_addr` is ignored by the provider and overwritten when `core = true`.", "")
}
opts.ServerAddr = "kubernetes"
opts.Core = true
if !p.Username.IsNull() {
diags.AddWarning("`username` is ignored when `core = true`.", "")
}
}
return coreEnabled, diags
}
func (p ArgoCDProviderConfig) setLocalConfigOpts(opts *apiclient.ClientOptions) (bool, diag.Diagnostics) {
var diags diag.Diagnostics
useLocalConfig := p.UseLocalConfig.ValueBool()
switch useLocalConfig {
case true:
if opts.ServerAddr != "" {
diags.AddWarning("setting `server_addr` alongside `use_local_config = true` is unnecessary and not recommended as this will overwrite the address retrieved from the local ArgoCD context.", "")
}
if !p.Username.IsNull() {
diags.AddWarning("`username` is ignored when `use_local_config = true`.", "")
}
opts.Context = getDefaultString(p.Context, "ARGOCD_CONTEXT")
cp := getDefaultString(p.ConfigPath, "ARGOCD_CONFIG_PATH")
if cp != "" {
opts.ConfigPath = p.ConfigPath.ValueString()
break
}
cp, err := localconfig.DefaultLocalConfigPath()
if err == nil {
opts.ConfigPath = cp
break
}
diags.Append(diagnostics.Error("failed to find default ArgoCD config path", err)...)
case false:
// Log warnings if explicit configuration has been provided for local config when `use_local_config` is not enabled.
if !p.ConfigPath.IsNull() {
diags.AddWarning("`config_path` is ignored by provider unless `use_local_config = true`.", "")
}
if !p.Context.IsNull() {
diags.AddWarning("`context` is ignored by provider unless `use_local_config = true`.", "")
}
}
return useLocalConfig, diags
}
func (p ArgoCDProviderConfig) setPortForwardingOpts(ctx context.Context, opts *apiclient.ClientOptions) (bool, diag.Diagnostics) {
var diags diag.Diagnostics
portForwardingEnabled := opts.PortForward || opts.PortForwardNamespace != ""
switch portForwardingEnabled {
case true:
if opts.ServerAddr != "" {
diags.AddWarning("`server_addr` is ignored by the provider and overwritten when port forwarding is enabled.", "")
}
opts.ServerAddr = "localhost" // will be overwritten by ArgoCD module when we initialize the API client but needs to be set here to ensure we
opts.ServerName = "argocd-server"
if opts.PortForwardNamespace == "" {
opts.PortForwardNamespace = "argocd"
}
if p.Kubernetes == nil {
break
}
k := p.Kubernetes[0]
opts.KubeOverrides = &clientcmd.ConfigOverrides{
AuthInfo: api.AuthInfo{
ClientCertificateData: bytes.NewBufferString(getDefaultString(k.ClientCertificate, "KUBE_CLIENT_CERT_DATA")).Bytes(),
Username: getDefaultString(k.Username, "KUBE_USER"),
Password: getDefaultString(k.Password, "KUBE_PASSWORD"),
ClientKeyData: bytes.NewBufferString(getDefaultString(k.ClientKey, "KUBE_CLIENT_KEY_DATA")).Bytes(),
Token: getDefaultString(k.Token, "KUBE_TOKEN"),
},
ClusterInfo: api.Cluster{
InsecureSkipTLSVerify: getDefaultBool(ctx, k.Insecure, "KUBE_INSECURE"),
CertificateAuthorityData: bytes.NewBufferString(getDefaultString(k.ClusterCACertificate, "KUBE_CLUSTER_CA_CERT_DATA")).Bytes(),
},
CurrentContext: getDefaultString(k.ConfigContext, "KUBE_CTX"),
Context: api.Context{
AuthInfo: getDefaultString(k.ConfigContextAuthInfo, "KUBE_CTX_AUTH_INFO"),
Cluster: getDefaultString(k.ConfigContextCluster, "KUBE_CTX_CLUSTER"),
},
}
h := getDefaultString(k.Host, "KUBE_HOST")
if h != "" {
// Server has to be the complete address of the Kubernetes cluster (scheme://hostname:port), not just the hostname,
// because `overrides` are processed too late to be taken into account by `defaultServerUrlFor()`.
// This basically replicates what defaultServerUrlFor() does with config but for overrides,
// see https://github.com/Kubernetes/client-go/blob/v12.0.0/rest/url_utils.go#L85-L87
hasCA := len(opts.KubeOverrides.ClusterInfo.CertificateAuthorityData) != 0
hasCert := len(opts.KubeOverrides.AuthInfo.ClientCertificateData) != 0
defaultTLS := hasCA || hasCert || opts.KubeOverrides.ClusterInfo.InsecureSkipTLSVerify
var host *url.URL
host, _, err := rest.DefaultServerURL(h, "", apimachineryschema.GroupVersion{}, defaultTLS)
if err == nil {
opts.KubeOverrides.ClusterInfo.Server = host.String()
} else {
diags.Append(diagnostics.Error(fmt.Sprintf("failed to extract default server URL for host %s", h), err)...)
}
}
if k.Exec == nil {
break
}
e := k.Exec[0]
exec := &api.ExecConfig{
InteractiveMode: api.IfAvailableExecInteractiveMode,
APIVersion: e.APIVersion.ValueString(),
Command: e.Command.ValueString(),
}
var a []string
diags.Append(e.Args.ElementsAs(ctx, &a, false)...)
exec.Args = a
var env map[string]string
diags.Append(e.Env.ElementsAs(ctx, &env, false)...)
for k, v := range env {
exec.Env = append(exec.Env, api.ExecEnvVar{Name: k, Value: v})
}
opts.KubeOverrides.AuthInfo.Exec = exec
case false:
if p.Kubernetes != nil {
diags.AddWarning("`Kubernetes` configuration block is ignored by provider unless `port_forward` or `port_forward_with_namespace` are configured.", "")
}
}
return portForwardingEnabled, diags
}
type Kubernetes struct {
Host types.String `tfsdk:"host"`
Username types.String `tfsdk:"username"`
Password types.String `tfsdk:"password"`
Insecure types.Bool `tfsdk:"insecure"`
ClientCertificate types.String `tfsdk:"client_certificate"`
ClientKey types.String `tfsdk:"client_key"`
ClusterCACertificate types.String `tfsdk:"cluster_ca_certificate"`
ConfigContext types.String `tfsdk:"config_context"`
ConfigContextAuthInfo types.String `tfsdk:"config_context_auth_info"`
ConfigContextCluster types.String `tfsdk:"config_context_cluster"`
Token types.String `tfsdk:"token"`
Exec []KubernetesExec `tfsdk:"exec"`
}
type KubernetesExec struct {
APIVersion types.String `tfsdk:"api_version"`
Command types.String `tfsdk:"command"`
Env types.Map `tfsdk:"env"`
Args types.List `tfsdk:"args"`
}
================================================
FILE: argocd/provider.go
================================================
package argocd
import (
"context"
"sync"
fwdiag "github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
// Import to initialize client auth plugins.
_ "k8s.io/client-go/plugin/pkg/client/auth"
)
// Used to handle concurrent access to ArgoCD common configuration
var tokenMutexConfiguration = &sync.RWMutex{}
// Used to handle concurrent access to ArgoCD clusters
var tokenMutexClusters = &sync.RWMutex{}
// Used to handle concurrent access to ArgoCD secrets
var tokenMutexSecrets = &sync.RWMutex{}
func Provider() *schema.Provider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"server_addr": {
Type: schema.TypeString,
Optional: true,
Description: "ArgoCD server address with port. Can be set through the `ARGOCD_SERVER` environment variable.",
},
"auth_token": {
Type: schema.TypeString,
Optional: true,
Description: "ArgoCD authentication token, takes precedence over `username`/`password`. Can be set through the `ARGOCD_AUTH_TOKEN` environment variable.",
Sensitive: true,
},
"username": {
Type: schema.TypeString,
Optional: true,
Description: "Authentication username. Can be set through the `ARGOCD_AUTH_USERNAME` environment variable.",
},
"password": {
Type: schema.TypeString,
Optional: true,
Description: "Authentication password. Can be set through the `ARGOCD_AUTH_PASSWORD` environment variable.",
Sensitive: true,
},
"cert_file": {
Type: schema.TypeString,
Optional: true,
Description: "Additional root CA certificates file to add to the client TLS connection pool.",
},
"client_cert_file": {
Type: schema.TypeString,
Optional: true,
Description: "Client certificate.",
},
"client_cert_key": {
Type: schema.TypeString,
Optional: true,
Description: "Client certificate key.",
},
"plain_text": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to initiate an unencrypted connection to ArgoCD server.",
},
"context": {
Type: schema.TypeString,
Optional: true,
Description: "Context to choose when using a local ArgoCD config file. Only relevant when `use_local_config`. Can be set through `ARGOCD_CONTEXT` environment variable.",
},
"user_agent": {
Type: schema.TypeString,
Optional: true,
Description: "User-Agent request header override.",
},
"core": {
Type: schema.TypeBool,
Optional: true,
Description: "Configure direct access using Kubernetes API server.\n\n " +
"**Warning**: this feature works by starting a local ArgoCD API server that talks directly to the Kubernetes API using the **current context " +
"in the default kubeconfig** (`~/.kube/config`). This behavior cannot be overridden using either environment variables or the `kubernetes` block " +
"in the provider configuration at present).\n\n If the server fails to start (e.g. your kubeconfig is misconfigured) then the provider will " +
"fail as a result of the `argocd` module forcing it to exit and no logs will be available to help you debug this. The error message will be " +
"similar to\n > `The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may " +
"contain more details.`\n\n To debug this, you will need to login via the ArgoCD CLI using `argocd login --core` and then running an operation. " +
"E.g. `argocd app list`.",
},
"grpc_web": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to use gRPC web proxy client. Useful if Argo CD server is behind proxy which does not support HTTP2.",
},
"grpc_web_root_path": {
Type: schema.TypeString,
Optional: true,
Description: "Use the gRPC web proxy client and set the web root, e.g. `argo-cd`. Useful if the Argo CD server is behind a proxy at a non-root path.",
},
"use_local_config": {
Type: schema.TypeBool,
Optional: true,
Description: "Use the authentication settings found in the local config file. Useful when you have previously logged in using SSO. Conflicts with `auth_token`, `username` and `password`.",
},
"config_path": {
Type: schema.TypeString,
Optional: true,
Description: "Override the default config path of `$HOME/.config/argocd/config`. Only relevant when `use_local_config`. Can be set through the `ARGOCD_CONFIG_PATH` environment variable.",
},
"port_forward": {
Type: schema.TypeBool,
Description: "Connect to a random argocd-server port using port forwarding.",
Optional: true,
},
"port_forward_with_namespace": {
Type: schema.TypeString,
Description: "Namespace name which should be used for port forwarding.",
Optional: true,
},
"headers": {
Type: schema.TypeSet,
Optional: true,
Description: "Additional headers to add to each request to the ArgoCD server.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"insecure": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to skip TLS server certificate. Can be set through the `ARGOCD_INSECURE` environment variable.",
},
"kubernetes": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Kubernetes configuration overrides. Only relevant when `port_forward = true` or `port_forward_with_namespace = \"foo\"`. The kubeconfig file that is used can be overridden using the [`KUBECONFIG` environment variable](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable)).",
Elem: kubernetesResource(),
},
},
ResourcesMap: map[string]*schema.Resource{
"argocd_account_token": resourceArgoCDAccountToken(),
"argocd_application": resourceArgoCDApplication(),
"argocd_application_set": resourceArgoCDApplicationSet(),
"argocd_cluster": resourceArgoCDCluster(),
},
ConfigureContextFunc: func(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) {
config, diags := argoCDProviderConfigFromResourceData(ctx, d)
server := NewServerInterface(config)
return server, diags
},
}
}
func kubernetesResource() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"host": {
Type: schema.TypeString,
Optional: true,
Description: "The hostname (in form of URI) of the Kubernetes API. Can be sourced from `KUBE_HOST`.",
},
"username": {
Type: schema.TypeString,
Optional: true,
Description: "The username to use for HTTP basic authentication when accessing the Kubernetes API. Can be sourced from `KUBE_USER`.",
},
"password": {
Type: schema.TypeString,
Optional: true,
Description: "The password to use for HTTP basic authentication when accessing the Kubernetes API. Can be sourced from `KUBE_PASSWORD`.",
Sensitive: true,
},
"insecure": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether server should be accessed without verifying the TLS certificate. Can be sourced from `KUBE_INSECURE`.",
},
"client_certificate": {
Type: schema.TypeString,
Optional: true,
Description: "PEM-encoded client certificate for TLS authentication. Can be sourced from `KUBE_CLIENT_CERT_DATA`.",
},
"client_key": {
Type: schema.TypeString,
Optional: true,
Description: "PEM-encoded client certificate key for TLS authentication. Can be sourced from `KUBE_CLIENT_KEY_DATA`.",
Sensitive: true,
},
"cluster_ca_certificate": {
Type: schema.TypeString,
Optional: true,
Description: "PEM-encoded root certificates bundle for TLS authentication. Can be sourced from `KUBE_CLUSTER_CA_CERT_DATA`.",
},
"config_context": {
Type: schema.TypeString,
Optional: true,
Description: "Context to choose from the config file. Can be sourced from `KUBE_CTX`.",
},
"config_context_auth_info": {
Type: schema.TypeString,
Optional: true,
Description: "",
},
"config_context_cluster": {
Type: schema.TypeString,
Optional: true,
Description: "",
},
"token": {
Type: schema.TypeString,
Optional: true,
Description: "Token to authenticate an service account. Can be sourced from `KUBE_TOKEN`.",
Sensitive: true,
},
"exec": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: "Configuration block to use an [exec-based credential plugin](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), e.g. call an external command to receive user credentials.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"api_version": {
Type: schema.TypeString,
Required: true,
Description: "API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`.",
},
"command": {
Type: schema.TypeString,
Required: true,
Description: "Command to execute.",
},
"env": {
Type: schema.TypeMap,
Optional: true,
Description: "List of arguments to pass when executing the plugin.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"args": {
Type: schema.TypeList,
Optional: true,
Description: "Map of environment variables to set when executing the plugin.",
Elem: &schema.Schema{Type: schema.TypeString},
},
},
},
},
},
}
}
func argoCDProviderConfigFromResourceData(ctx context.Context, d *schema.ResourceData) (ArgoCDProviderConfig, diag.Diagnostics) {
c := ArgoCDProviderConfig{
AuthToken: getStringFromResourceData(d, "auth_token"),
CertFile: getStringFromResourceData(d, "cert_file"),
ClientCertFile: getStringFromResourceData(d, "client_cert_file"),
ClientCertKey: getStringFromResourceData(d, "client_cert_key"),
ConfigPath: getStringFromResourceData(d, "config_path"),
Context: getStringFromResourceData(d, "context"),
Core: getBoolFromResourceData(d, "core"),
GRPCWeb: getBoolFromResourceData(d, "grpc_web"),
GRPCWebRootPath: getStringFromResourceData(d, "grpc_web_root_path"),
Insecure: getBoolFromResourceData(d, "insecure"),
Password: getStringFromResourceData(d, "password"),
PlainText: getBoolFromResourceData(d, "plain_text"),
PortForward: getBoolFromResourceData(d, "port_forward"),
PortForwardWithNamespace: getStringFromResourceData(d, "port_forward_with_namespace"),
ServerAddr: getStringFromResourceData(d, "server_addr"),
UseLocalConfig: getBoolFromResourceData(d, "use_local_config"),
UserAgent: getStringFromResourceData(d, "user_agent"),
Username: getStringFromResourceData(d, "username"),
}
headers, diags := getStringSetFromResourceData(ctx, d, "headers")
c.Headers = headers
k8s, ds := kubernetesConfigFromResourceData(ctx, d)
c.Kubernetes = k8s
diags.Append(ds...)
return c, pluginSDKDiags(diags)
}
func kubernetesConfigFromResourceData(ctx context.Context, d *schema.ResourceData) ([]Kubernetes, fwdiag.Diagnostics) {
if _, ok := d.GetOk("kubernetes"); !ok {
return nil, nil
}
k8s := Kubernetes{
ClientCertificate: getStringFromResourceData(d, "kubernetes.0.client_certificate"),
ClientKey: getStringFromResourceData(d, "kubernetes.0.client_key"),
ClusterCACertificate: getStringFromResourceData(d, "kubernetes.0.cluster_ca_certificate"),
ConfigContext: getStringFromResourceData(d, "kubernetes.0.config_context"),
ConfigContextAuthInfo: getStringFromResourceData(d, "kubernetes.0.config_context_auth_info"),
ConfigContextCluster: getStringFromResourceData(d, "kubernetes.0.config_context_cluster"),
Host: getStringFromResourceData(d, "kubernetes.0.host"),
Insecure: getBoolFromResourceData(d, "kubernetes.0.insecure"),
Password: getStringFromResourceData(d, "kubernetes.0.password"),
Token: getStringFromResourceData(d, "kubernetes.0.token"),
Username: getStringFromResourceData(d, "kubernetes.0.username"),
}
var diags fwdiag.Diagnostics
k8s.Exec, diags = kubernetesExecConfigFromResourceData(ctx, d)
return []Kubernetes{k8s}, diags
}
func kubernetesExecConfigFromResourceData(ctx context.Context, d *schema.ResourceData) ([]KubernetesExec, fwdiag.Diagnostics) {
if _, ok := d.GetOk("kubernetes.0.exec"); !ok {
return nil, nil
}
exec := KubernetesExec{
APIVersion: getStringFromResourceData(d, "kubernetes.0.exec.0.api_version"),
Command: getStringFromResourceData(d, "kubernetes.0.exec.0.command"),
}
args, diags := getStringListFromResourceData(ctx, d, "kubernetes.0.exec.0.args")
exec.Args = args
env, ds := getStringMapFromResourceData(ctx, d, "kubernetes.0.exec.0.env")
exec.Env = env
diags.Append(ds...)
return []KubernetesExec{exec}, diags
}
func getStringFromResourceData(d *schema.ResourceData, key string) types.String {
if v, ok := d.GetOk(key); ok {
return types.StringValue(v.(string))
}
return types.StringNull()
}
func getBoolFromResourceData(d *schema.ResourceData, key string) types.Bool {
if v, ok := d.GetOk(key); ok {
return types.BoolValue(v.(bool))
}
return types.BoolNull()
}
func getStringListFromResourceData(ctx context.Context, d *schema.ResourceData, key string) (types.List, fwdiag.Diagnostics) {
if v, ok := d.GetOk(key); ok {
return types.ListValueFrom(ctx, types.StringType, v.([]interface{}))
}
return types.ListNull(types.StringType), nil
}
func getStringMapFromResourceData(ctx context.Context, d *schema.ResourceData, key string) (types.Map, fwdiag.Diagnostics) {
if v, ok := d.GetOk(key); ok {
return types.MapValueFrom(ctx, types.StringType, v.(map[string]interface{}))
}
return types.MapNull(types.StringType), nil
}
func getStringSetFromResourceData(ctx context.Context, d *schema.ResourceData, key string) (types.Set, fwdiag.Diagnostics) {
if v, ok := d.GetOk(key); ok {
return types.SetValueFrom(ctx, types.StringType, v.(*schema.Set).List())
}
return types.SetNull(types.StringType), nil
}
================================================
FILE: argocd/provider_test.go
================================================
package argocd
import (
"context"
"fmt"
"os"
"testing"
"github.com/Masterminds/semver/v3"
"github.com/argoproj-labs/terraform-provider-argocd/internal/features"
"github.com/argoproj-labs/terraform-provider-argocd/internal/provider"
"github.com/argoproj-labs/terraform-provider-argocd/internal/testhelpers"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
"github.com/hashicorp/terraform-plugin-mux/tf5to6server"
"github.com/hashicorp/terraform-plugin-mux/tf6muxserver"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
var testAccProviders map[string]func() (*schema.Provider, error)
var testAccProtoV6ProviderFactories map[string]func() (tfprotov6.ProviderServer, error)
func init() {
testAccProviders = map[string]func() (*schema.Provider, error){
"argocd": func() (*schema.Provider, error) { //nolint:unparam
return Provider(), nil
},
}
testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"argocd": func() (tfprotov6.ProviderServer, error) {
ctx := context.Background()
upgradedSdkServer, err := tf5to6server.UpgradeServer(
ctx,
Provider().GRPCProvider,
)
if err != nil {
return nil, err
}
providers := []func() tfprotov6.ProviderServer{
providerserver.NewProtocol6(provider.New("test")),
func() tfprotov6.ProviderServer {
return upgradedSdkServer
},
}
muxServer, err := tf6muxserver.NewMuxServer(ctx, providers...)
if err != nil {
return nil, err
}
return muxServer.ProviderServer(), nil
},
}
}
func TestMain(m *testing.M) {
testhelpers.TestMain(m)
}
func TestProvider(t *testing.T) {
t.Parallel()
if err := Provider().InternalValidate(); err != nil {
t.Fatalf("err: %s", err)
}
}
func TestProvider_headers(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: fmt.Sprintf("%s %s", `
provider "argocd" {
headers = [
"Hello: HiThere",
]
}`, testAccArgoCDApplicationSimple(acctest.RandomWithPrefix("test-acc"), "0.33.0", false),
),
},
},
})
}
func testAccPreCheck(t *testing.T) {
if v := os.Getenv("ARGOCD_AUTH_USERNAME"); v == "" {
t.Fatal("ARGOCD_AUTH_USERNAME must be set for acceptance tests")
}
if v := os.Getenv("ARGOCD_AUTH_PASSWORD"); v == "" {
t.Fatal("ARGOCD_AUTH_PASSWORD must be set for acceptance tests")
}
if v := os.Getenv("ARGOCD_SERVER"); v == "" {
t.Fatal("ARGOCD_SERVER must be set for acceptance tests")
}
if v := os.Getenv("ARGOCD_INSECURE"); v == "" {
t.Fatal("ARGOCD_INSECURE should be set for acceptance tests")
}
}
// Skip test if feature is not supported
func testAccPreCheckFeatureSupported(t *testing.T, feature features.Feature) {
v := os.Getenv("ARGOCD_VERSION")
if v == "" {
t.Skip("ARGOCD_VERSION must be set set for feature supported acceptance tests")
}
serverVersion, err := semver.NewVersion(v)
if err != nil {
t.Fatalf("could not parse ARGOCD_VERSION as semantic version: %s", v)
}
fc, ok := features.ConstraintsMap[feature]
if !ok {
t.Fatal("feature constraint is not handled by the provider")
}
if i := fc.MinVersion.Compare(serverVersion); i == 1 {
t.Skipf("version %s does not support feature", v)
}
}
// Skip test if feature is supported
// Note: unused at present but left in the code in case it is needed again in future
// func testAccPreCheckFeatureNotSupported(t *testing.T, feature int) {
// v := os.Getenv("ARGOCD_VERSION")
// if v == "" {
// t.Skip("ARGOCD_VERSION must be set for feature supported acceptance tests")
// }
// serverVersion, err := semver.NewVersion(v)
// if err != nil {
// t.Fatalf("could not parse ARGOCD_VERSION as semantic version: %s", v)
// }
// versionConstraint, ok := featureVersionConstraintsMap[feature]
// if !ok {
// t.Fatal("feature constraint is not handled by the provider")
// }
// if i := versionConstraint.Compare(serverVersion); i != 1 {
// t.Skipf("not running test if feature is already supported (%s)", v)
// }
// }
================================================
FILE: argocd/resource_argocd_account_token.go
================================================
package argocd
import (
"context"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/argoproj/argo-cd/v3/pkg/apiclient/account"
"github.com/argoproj/argo-cd/v3/pkg/apiclient/session"
"github.com/cristalhq/jwt/v5"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func resourceArgoCDAccountToken() *schema.Resource {
return &schema.Resource{
Description: "Manages ArgoCD [account](https://argo-cd.readthedocs.io/en/latest/user-guide/commands/argocd_account/) JWT tokens.\n\n~> **Security Notice** The JWT token generated by this resource is treated as sensitive and, thus, not displayed in console output. However, it will be stored *unencrypted* in your Terraform state file. Read more about sensitive data handling in the [Terraform documentation](https://www.terraform.io/docs/language/state/sensitive-data.html).\n",
CreateContext: resourceArgoCDAccountTokenCreate,
ReadContext: resourceArgoCDAccountTokenRead,
UpdateContext: resourceArgoCDAccountTokenUpdate,
DeleteContext: resourceArgoCDAccountTokenDelete,
CustomizeDiff: func(ctx context.Context, d *schema.ResourceDiff, m interface{}) error {
ia := d.Get("issued_at").(string)
if ia == "" {
// Blank issued_at indicates a new token - nothing to do here
return nil
}
issuedAt, err := convertStringToInt64(ia)
if err != nil {
return fmt.Errorf("invalid issued_at: %w", err)
}
if ra, ok := d.GetOk("renew_after"); ok {
renewAfterDuration, err := time.ParseDuration(ra.(string))
if err != nil {
return fmt.Errorf("invalid renew_after: %w", err)
}
if time.Now().Unix()-issuedAt > int64(renewAfterDuration.Seconds()) {
// Token is older than renewAfterDuration - force recreation
if err := d.SetNewComputed("issued_at"); err != nil {
return fmt.Errorf("failed to force new resource on field %q: %w", "issued_at", err)
}
return nil
}
}
ea, ok := d.GetOk("expires_at")
if !ok {
return nil
}
expiresAt, err := convertStringToInt64(ea.(string))
if err != nil {
return fmt.Errorf("invalid expires_at: %w", err)
}
if expiresAt == 0 {
// Token not set to expire - no need to check anything else
return nil
}
if expiresAt < time.Now().Unix() {
// Token has expired - force recreation
if err := d.SetNewComputed("expires_at"); err != nil {
return fmt.Errorf("failed to force new resource on field %q: %w", "expires_at", err)
}
return nil
}
rb, ok := d.GetOk("renew_before")
if !ok {
return nil
}
renewBeforeDuration, err := time.ParseDuration(rb.(string))
if err != nil {
return fmt.Errorf("invalid renew_before: %w", err)
}
if expiresAt-time.Now().Unix() < int64(renewBeforeDuration.Seconds()) {
// Token will expire within renewBeforeDuration - force recreation
if err := d.SetNewComputed("issued_at"); err != nil {
return fmt.Errorf("failed to force new resource on field %q: %w", "issued_at", err)
}
}
return nil
},
Schema: map[string]*schema.Schema{
"account": {
Type: schema.TypeString,
Description: "Account name. Defaults to the current account. I.e. the account configured on the `provider` block.",
Optional: true,
ForceNew: true,
},
"expires_in": {
Type: schema.TypeString,
Description: "Duration before the token will expire. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. E.g. `30m`, `12h`. Default: No expiration.",
Optional: true,
ForceNew: true,
ValidateFunc: validateDuration,
},
"renew_after": {
Type: schema.TypeString,
Description: "Duration to control token silent regeneration based on token age. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. If set, then the token will be regenerated if it is older than `renew_after`. I.e. if `currentDate - issued_at > renew_after`.",
Optional: true,
ValidateFunc: validateDuration,
},
"renew_before": {
Type: schema.TypeString,
Description: "Duration to control token silent regeneration based on remaining token lifetime. If `expires_in` is set, Terraform will regenerate the token if `expires_at - currentDate < renew_before`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.",
Optional: true,
ValidateFunc: validateDuration,
RequiredWith: []string{"expires_in"},
},
"jwt": {
Type: schema.TypeString,
Description: "The raw JWT.",
Computed: true,
Sensitive: true,
},
"issued_at": {
Type: schema.TypeString,
Description: "Unix timestamp at which the token was issued.",
Computed: true,
ForceNew: true,
},
"expires_at": {
Type: schema.TypeString,
Description: "If `expires_in` is set, Unix timestamp upon which the token will expire.",
Computed: true,
ForceNew: true,
},
},
}
}
func resourceArgoCDAccountTokenCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
accountName, err := getAccount(ctx, si, d)
if err != nil {
return errorToDiagnostics("failed to get account", err)
}
opts := &account.CreateTokenRequest{
Name: accountName,
}
var expiresIn int64
_expiresIn, expiresInOk := d.GetOk("expires_in")
if expiresInOk {
ei := _expiresIn.(string)
expiresInDuration, err := time.ParseDuration(ei)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("token expiration duration (%s) for account %s could not be parsed", ei, accountName), err)
}
expiresIn = int64(expiresInDuration.Seconds())
opts.ExpiresIn = expiresIn
}
_renewBefore, renewBeforeOk := d.GetOk("renew_before")
if renewBeforeOk {
rb := _renewBefore.(string)
renewBeforeDuration, err := time.ParseDuration(rb)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("token renewal duration (%s) for account %s could not be parsed", rb, accountName), err)
}
renewBefore := int64(renewBeforeDuration.Seconds())
if renewBefore > expiresIn {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("renew_before (%d) cannot be greater than expires_in (%d) for account token", renewBefore, expiresIn),
},
}
}
}
tokenMutexSecrets.Lock()
resp, err := si.AccountClient.CreateToken(ctx, opts)
tokenMutexSecrets.Unlock()
if err != nil {
return argoCDAPIError("create", "token for account", accountName, err)
}
token, err := jwt.ParseNoVerify([]byte(resp.GetToken()))
if err != nil {
return errorToDiagnostics(fmt.Sprintf("token for account %s is not a valid jwt", accountName), err)
}
var claims jwt.RegisteredClaims
if err = json.Unmarshal(token.Claims(), &claims); err != nil {
return errorToDiagnostics(fmt.Sprintf("token claims for account %s could not be parsed", accountName), err)
}
if expiresInOk {
if claims.ExpiresAt == nil {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("token claims expiration date for account %s is missing", accountName),
},
}
} else {
err = d.Set("expires_at", convertInt64ToString(claims.ExpiresAt.Unix()))
if err != nil {
return errorToDiagnostics(fmt.Sprintf("token claims expiration date for account %s could not be persisted to state", accountName), err)
}
}
}
if err = d.Set("issued_at", convertInt64ToString(claims.IssuedAt.Unix())); err != nil {
return errorToDiagnostics(fmt.Sprintf("token claims issue date for account %s could not be persisted to state", accountName), err)
}
if err := d.Set("jwt", token.String()); err != nil {
return errorToDiagnostics(fmt.Sprintf("token for account %s could not be persisted to state", accountName), err)
}
d.SetId(claims.ID)
return resourceArgoCDAccountTokenRead(ctx, d, meta)
}
func resourceArgoCDAccountTokenRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
accountName, err := getAccount(ctx, si, d)
if err != nil {
return errorToDiagnostics("failed to get account", err)
}
tokenMutexConfiguration.RLock() // Yes, this is a different mutex - accounts are stored in `argocd-cm` whereas tokens are stored in `argocd-secret`
_, err = si.AccountClient.GetAccount(ctx, &account.GetAccountRequest{
Name: accountName,
})
tokenMutexConfiguration.RUnlock()
if err != nil {
if strings.Contains(err.Error(), "NotFound") {
// Delete token from state if account has been deleted in an out-of-band fashion
d.SetId("")
return nil
} else {
return argoCDAPIError("read", "account", accountName, err)
}
}
return nil
}
func resourceArgoCDAccountTokenUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
accountName := d.Get("account").(string)
var expiresIn int64
_expiresIn, expiresInOk := d.GetOk("expires_in")
if expiresInOk {
ei := _expiresIn.(string)
expiresInDuration, err := time.ParseDuration(ei)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("token expiration duration (%s) for account %s could not be parsed", ei, accountName), err)
}
expiresIn = int64(expiresInDuration.Seconds())
}
_renewBefore, renewBeforeOk := d.GetOk("renew_before")
if renewBeforeOk {
rb := _renewBefore.(string)
renewBeforeDuration, err := time.ParseDuration(rb)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("token renewal duration (%s) for account %s could not be parsed", rb, accountName), err)
}
renewBefore := int64(renewBeforeDuration.Seconds())
if renewBefore > expiresIn {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("renew_before (%d) cannot be greater than expires_in (%d) for account %s", renewBefore, expiresIn, accountName),
},
}
}
}
return resourceArgoCDAccountTokenRead(ctx, d, meta)
}
func resourceArgoCDAccountTokenDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
accountName, err := getAccount(ctx, si, d)
if err != nil {
return errorToDiagnostics("failed to get account", err)
}
tokenMutexSecrets.Lock()
_, err = si.AccountClient.DeleteToken(ctx, &account.DeleteTokenRequest{
Name: accountName,
Id: d.Id(),
})
tokenMutexSecrets.Unlock()
if err != nil && !strings.Contains(err.Error(), "NotFound") {
return argoCDAPIError("delete", "token for account", accountName, err)
}
d.SetId("")
return nil
}
func getAccount(ctx context.Context, si *ServerInterface, d *schema.ResourceData) (string, error) {
accountName := d.Get("account").(string)
if len(accountName) > 0 {
return accountName, nil
}
userInfo, err := si.SessionClient.GetUserInfo(ctx, &session.GetUserInfoRequest{})
if err != nil {
return "", fmt.Errorf("failed to get current account: %w", err)
}
return userInfo.Username, nil
}
================================================
FILE: argocd/resource_argocd_account_token_test.go
================================================
package argocd
import (
"fmt"
"math/rand"
"regexp"
"testing"
"time"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
"github.com/stretchr/testify/assert"
)
func TestAccArgoCDAccountToken_DefaultAccount(t *testing.T) {
expIn1, err := time.ParseDuration(fmt.Sprintf("%ds", rand.Intn(100000)))
assert.NoError(t, err)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDAccountToken_DefaultAccount(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_account_token.this",
"issued_at",
),
testCheckTokenIssuedAt(
"argocd_account_token.this",
),
),
},
{
Config: testAccArgoCDAccountToken_Expiry(int64(expIn1.Seconds())),
Check: testCheckTokenExpiresAt(
"argocd_account_token.this",
int64(expIn1.Seconds()),
),
},
},
})
}
func TestAccArgoCDAccountToken_ExplicitAccount(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDAccountToken_ExplicitAccount(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_account_token.this",
"issued_at",
),
resource.TestCheckResourceAttr(
"argocd_account_token.this",
"account",
"test",
),
testCheckTokenIssuedAt(
"argocd_account_token.this",
),
),
},
},
})
}
func TestAccArgoCDAccountToken_Multiple(t *testing.T) {
count := 3 + rand.Intn(7)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDAccountToken_Multiple(count),
Check: resource.ComposeTestCheckFunc(
testTokenIssuedAtSet(
"argocd_account_token.multiple1a",
count,
),
testTokenIssuedAtSet(
"argocd_account_token.multiple1b",
count,
),
testTokenIssuedAtSet(
"argocd_account_token.multiple2a",
count,
),
testTokenIssuedAtSet(
"argocd_account_token.multiple2b",
count,
),
),
},
},
})
}
func TestAccArgoCDAccountToken_RenewBefore(t *testing.T) {
resourceName := "argocd_account_token.renew_before"
expiresInSeconds := 30
expiresIn := fmt.Sprintf("%ds", expiresInSeconds)
expiresInDuration, _ := time.ParseDuration(expiresIn)
renewBeforeSeconds := expiresInSeconds - 1
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDAccountTokenRenewBeforeSuccess(expiresIn, "20s"),
Check: resource.ComposeTestCheckFunc(
testCheckTokenExpiresAt(resourceName, int64(expiresInDuration.Seconds())),
resource.TestCheckResourceAttr(resourceName, "renew_before", "20s"),
),
},
{
Config: testAccArgoCDAccountTokenRenewBeforeSuccess(expiresIn, fmt.Sprintf("%ds", renewBeforeSeconds)),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "renew_before", fmt.Sprintf("%ds", renewBeforeSeconds)),
testDelay(renewBeforeSeconds+1),
),
ExpectNonEmptyPlan: true, // token should be recreated when refreshed at end of step due to delay above
},
{
Config: testAccArgoCDAccountTokenRenewBeforeFailure(expiresInDuration),
ExpectError: regexp.MustCompile("renew_before .* cannot be greater than expires_in .*"),
},
},
})
}
func TestAccArgoCDAccountToken_RenewAfter(t *testing.T) {
resourceName := "argocd_account_token.renew_after"
renewAfterSeconds := 30
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDAccountTokenRenewAfter(renewAfterSeconds),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "renew_after", fmt.Sprintf("%ds", renewAfterSeconds)),
),
},
{
Config: testAccArgoCDAccountTokenRenewAfter(renewAfterSeconds),
Check: resource.ComposeTestCheckFunc(
testDelay(renewAfterSeconds + 1),
),
ExpectNonEmptyPlan: true, // token should be recreated when refreshed at end of step due to delay above
},
{
Config: testAccArgoCDAccountTokenRenewAfter(renewAfterSeconds),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "renew_after", fmt.Sprintf("%ds", renewAfterSeconds)),
),
},
},
})
}
func testAccArgoCDAccountToken_DefaultAccount() string {
return `
resource "argocd_account_token" "this" {}
`
}
func testAccArgoCDAccountToken_Expiry(expiresIn int64) string {
return fmt.Sprintf(`
resource "argocd_account_token" "this" {
expires_in = "%ds"
}
`, expiresIn)
}
func testAccArgoCDAccountToken_ExplicitAccount() string {
return `
resource "argocd_account_token" "this" {
account = "test"
}
`
}
func testAccArgoCDAccountToken_Multiple(count int) string {
return fmt.Sprintf(`
resource "argocd_account_token" "multiple1a" {
count = %d
}
resource "argocd_account_token" "multiple1b" {
count = %d
}
resource "argocd_account_token" "multiple2a" {
account = "test"
count = %d
}
resource "argocd_account_token" "multiple2b" {
account = "test"
count = %d
}
`, count, count, count, count)
}
func testAccArgoCDAccountTokenRenewBeforeSuccess(expiresIn, renewBefore string) string {
return fmt.Sprintf(`
resource "argocd_account_token" "renew_before" {
expires_in = "%s"
renew_before = "%s"
}
`, expiresIn, renewBefore)
}
func testAccArgoCDAccountTokenRenewBeforeFailure(expiresInDuration time.Duration) string {
expiresIn := int64(expiresInDuration.Seconds())
renewBefore := int64(expiresInDuration.Seconds() + 1.0)
return fmt.Sprintf(`
resource "argocd_account_token" "renew_before" {
expires_in = "%ds"
renew_before = "%ds"
}
`, expiresIn, renewBefore)
}
func testAccArgoCDAccountTokenRenewAfter(renewAfter int) string {
return fmt.Sprintf(`
resource "argocd_account_token" "renew_after" {
account = "test"
renew_after = "%ds"
}
`, renewAfter)
}
func testCheckTokenIssuedAt(resourceName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[resourceName]
if !ok {
return fmt.Errorf("not found: %s", resourceName)
}
if rs.Primary.ID == "" {
return fmt.Errorf("token ID is not set")
}
_issuedAt, ok := rs.Primary.Attributes["issued_at"]
if !ok {
return fmt.Errorf("testCheckTokenIssuedAt: issued_at is not set")
}
_, err := convertStringToInt64(_issuedAt)
if err != nil {
return fmt.Errorf("testCheckTokenIssuedAt: string attribute 'issued_at' stored in state cannot be converted to int64: %s", err)
}
return nil
}
}
func testCheckTokenExpiresAt(resourceName string, expiresIn int64) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[resourceName]
if !ok {
return fmt.Errorf("not found: %s", resourceName)
}
if rs.Primary.ID == "" {
return fmt.Errorf("token ID is not set")
}
_expiresAt, ok := rs.Primary.Attributes["expires_at"]
if !ok {
return fmt.Errorf("expires_at is not set")
}
_issuedAt, ok := rs.Primary.Attributes["issued_at"]
if !ok {
return fmt.Errorf("testCheckTokenExpiresAt: issued_at is not set")
}
expiresAt, err := convertStringToInt64(_expiresAt)
if err != nil {
return fmt.Errorf("testCheckTokenExpiresAt: string attribute 'expires_at' stored in state cannot be converted to int64: %s", err)
}
issuedAt, err := convertStringToInt64(_issuedAt)
if err != nil {
return fmt.Errorf("testCheckTokenExpiresAt: string attribute 'issued_at' stored in state cannot be converted to int64: %s", err)
}
if issuedAt+expiresIn != expiresAt {
return fmt.Errorf("testCheckTokenExpiresAt: issuedAt + expiresIn != expiresAt : %d + %d != %d", issuedAt, expiresIn, expiresAt)
}
return nil
}
}
func testTokenIssuedAtSet(name string, count int) resource.TestCheckFunc {
return func(s *terraform.State) error {
key := "issued_at"
for i := 0; i < count; i++ {
ms := s.RootModule()
_name := fmt.Sprintf("%s.%d", name, i)
rs, ok := ms.Resources[_name]
if !ok {
return fmt.Errorf("not found: %s in %s", _name, ms.Path)
}
is := rs.Primary
if is == nil {
return fmt.Errorf("no primary instance: %s in %s", _name, ms.Path)
}
if val, ok := is.Attributes[key]; !ok || val == "" {
return fmt.Errorf("%s: Attribute '%s' expected to be set", _name, key)
}
}
return nil
}
}
func testDelay(seconds int) resource.TestCheckFunc {
return func(s *terraform.State) error {
time.Sleep(time.Duration(seconds) * time.Second)
return nil
}
}
================================================
FILE: argocd/resource_argocd_application.go
================================================
package argocd
import (
"context"
"fmt"
"strings"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/argoproj-labs/terraform-provider-argocd/internal/features"
applicationClient "github.com/argoproj/argo-cd/v3/pkg/apiclient/application"
application "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
"github.com/argoproj/gitops-engine/pkg/health"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func resourceArgoCDApplication() *schema.Resource {
return &schema.Resource{
Description: "Manages [applications](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#applications) within ArgoCD.",
CreateContext: resourceArgoCDApplicationCreate,
ReadContext: resourceArgoCDApplicationRead,
UpdateContext: resourceArgoCDApplicationUpdate,
DeleteContext: resourceArgoCDApplicationDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Schema: map[string]*schema.Schema{
"metadata": metadataSchema("applications.argoproj.io"),
"spec": applicationSpecSchemaV4(false, false),
"wait": {
Type: schema.TypeBool,
Description: "Upon application creation or update, wait for application health/sync status to be healthy/Synced, upon application deletion, wait for application to be removed, when set to true. Wait timeouts are controlled by Terraform Create, Update and Delete resource timeouts (all default to 5 minutes). **Note**: if ArgoCD decides not to sync an application (e.g. because the project to which the application belongs has a `sync_window` applied) then you will experience an expected timeout event if `wait = true`.",
Optional: true,
Default: false,
},
"sync": {
Type: schema.TypeBool,
Description: "Trigger sync immediately after create/update. Helps in case when a Sync window is defined. It is required that the sync window is defined with `manual_sync = true`.",
Optional: true,
},
"cascade": {
Type: schema.TypeBool,
Description: "Whether to applying cascading deletion when application is removed.",
Optional: true,
Default: true,
},
"validate": {
Type: schema.TypeBool,
Description: "Whether to validate the application spec before creating or updating the application.",
Optional: true,
Default: true,
},
"status": applicationStatusSchema(),
},
SchemaVersion: 4,
StateUpgraders: []schema.StateUpgrader{
{
Type: resourceArgoCDApplicationV0().CoreConfigSchema().ImpliedType(),
Upgrade: resourceArgoCDApplicationStateUpgradeV0,
Version: 0,
},
{
Type: resourceArgoCDApplicationV1().CoreConfigSchema().ImpliedType(),
Upgrade: resourceArgoCDApplicationStateUpgradeV1,
Version: 1,
},
{
Type: resourceArgoCDApplicationV2().CoreConfigSchema().ImpliedType(),
Upgrade: resourceArgoCDApplicationStateUpgradeV2,
Version: 2,
},
{
Type: resourceArgoCDApplicationV3().CoreConfigSchema().ImpliedType(),
Upgrade: resourceArgoCDApplicationStateUpgradeV3,
Version: 3,
},
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(5 * time.Minute),
Update: schema.DefaultTimeout(5 * time.Minute),
Delete: schema.DefaultTimeout(5 * time.Minute),
},
}
}
func resourceArgoCDApplicationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
objectMeta, spec, err := expandApplication(d, si.IsFeatureSupported(features.ApplicationSourceName))
if err != nil {
return errorToDiagnostics("failed to expand application", err)
}
apps, err := si.ApplicationClient.List(ctx, &applicationClient.ApplicationQuery{
Name: &objectMeta.Name,
AppNamespace: &objectMeta.Namespace,
})
if err != nil && !strings.Contains(err.Error(), "NotFound") {
return errorToDiagnostics(fmt.Sprintf("failed to list existing applications when creating application %s", objectMeta.Name), err)
}
if apps != nil {
l := len(apps.Items)
switch {
case l < 1:
break
case l == 1:
switch apps.Items[0].DeletionTimestamp {
case nil:
default:
// Pre-existing app is still in Kubernetes soft deletion queue
time.Sleep(time.Duration(*apps.Items[0].DeletionGracePeriodSeconds))
}
case l > 1:
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("found multiple applications matching name '%s' and namespace '%s'", objectMeta.Name, objectMeta.Namespace),
},
}
}
}
l := len(spec.Sources)
switch {
case l == 1:
spec.Source = &spec.Sources[0]
spec.Sources = nil
case l > 1 && !si.IsFeatureSupported(features.MultipleApplicationSources):
return featureNotSupported(features.MultipleApplicationSources)
}
if spec.SyncPolicy != nil && spec.SyncPolicy.ManagedNamespaceMetadata != nil && !si.IsFeatureSupported(features.ManagedNamespaceMetadata) {
return featureNotSupported(features.ManagedNamespaceMetadata)
}
validate := d.Get("validate").(bool)
app, err := si.ApplicationClient.Create(ctx, &applicationClient.ApplicationCreateRequest{
Application: &application.Application{
ObjectMeta: objectMeta,
Spec: spec,
TypeMeta: metav1.TypeMeta{
Kind: "Application",
APIVersion: "argoproj.io/v1alpha1",
},
},
Validate: &validate,
})
if err != nil {
return argoCDAPIError("create", "application", objectMeta.Name, err)
} else if app == nil {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("application %s could not be created: unknown reason", objectMeta.Name),
},
}
}
d.SetId(fmt.Sprintf("%s:%s", app.Name, objectMeta.Namespace))
if sync, ok := d.GetOk("sync"); ok && sync.(bool) {
prune := false
if spec.SyncPolicy.Automated != nil && spec.SyncPolicy.Automated.Prune {
prune = true
}
_, err := si.ApplicationClient.Sync(ctx, &applicationClient.ApplicationSyncRequest{
Name: &app.Name,
AppNamespace: &app.Namespace,
Prune: &prune,
})
if err != nil {
return errorToDiagnostics(fmt.Sprintf("error while triggering sync of application %s", app.Name), err)
}
}
if wait, ok := d.GetOk("wait"); ok && wait.(bool) {
if err = retry.RetryContext(ctx, d.Timeout(schema.TimeoutCreate), func() *retry.RetryError {
var list *application.ApplicationList
if list, err = si.ApplicationClient.List(ctx, &applicationClient.ApplicationQuery{
Name: &app.Name,
AppNamespace: &app.Namespace,
}); err != nil {
return retry.NonRetryableError(fmt.Errorf("error while waiting for application %s to be synced and healthy: %s", app.Name, err))
}
if len(list.Items) != 1 {
return retry.NonRetryableError(fmt.Errorf("found unexpected number of applications matching name '%s' and namespace '%s'. Items: %d", app.Name, app.Namespace, len(list.Items)))
}
if list.Items[0].Status.Health.Status != health.HealthStatusHealthy {
return retry.RetryableError(fmt.Errorf("expected application health status to be healthy but was %s", list.Items[0].Status.Health.Status))
}
if list.Items[0].Status.Sync.Status != application.SyncStatusCodeSynced {
return retry.RetryableError(fmt.Errorf("expected application sync status to be synced but was %s", list.Items[0].Status.Sync.Status))
}
return nil
}); err != nil {
return errorToDiagnostics(fmt.Sprintf("error while waiting for application %s to be created", objectMeta.Name), err)
}
}
return resourceArgoCDApplicationRead(ctx, d, meta)
}
func resourceArgoCDApplicationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
ids := strings.Split(d.Id(), ":")
appName := ids[0]
namespace := ids[1]
apps, err := si.ApplicationClient.List(ctx, &applicationClient.ApplicationQuery{
Name: &appName,
AppNamespace: &namespace,
})
if err != nil {
if strings.Contains(err.Error(), "NotFound") {
d.SetId("")
return diag.Diagnostics{}
}
return argoCDAPIError("read", "application", appName, err)
}
l := len(apps.Items)
switch {
case l < 1:
d.SetId("")
return diag.Diagnostics{}
case l == 1:
break
case l > 1:
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("found multiple applications matching name '%s' and namespace '%s'", appName, namespace),
},
}
}
err = flattenApplication(&apps.Items[0], d)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("failed to flatten application %s", appName), err)
}
return nil
}
func resourceArgoCDApplicationUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
if ok := d.HasChanges("metadata", "spec"); !ok {
return resourceArgoCDApplicationRead(ctx, d, meta)
}
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
ids := strings.Split(d.Id(), ":")
appQuery := &applicationClient.ApplicationQuery{
Name: &ids[0],
AppNamespace: &ids[1],
}
objectMeta, spec, err := expandApplication(d, si.IsFeatureSupported(features.ApplicationSourceName))
if err != nil {
return errorToDiagnostics(fmt.Sprintf("failed to expand application %s", *appQuery.Name), err)
}
l := len(spec.Sources)
switch {
case l == 1:
spec.Source = &spec.Sources[0]
spec.Sources = nil
case l > 1 && !si.IsFeatureSupported(features.MultipleApplicationSources):
return featureNotSupported(features.MultipleApplicationSources)
}
if spec.SyncPolicy != nil && spec.SyncPolicy.ManagedNamespaceMetadata != nil && !si.IsFeatureSupported(features.ManagedNamespaceMetadata) {
return featureNotSupported(features.ManagedNamespaceMetadata)
}
apps, err := si.ApplicationClient.List(ctx, appQuery)
if err != nil {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: "failed to get application",
Detail: err.Error(),
},
}
}
// Kubernetes API requires providing the up-to-date correct ResourceVersion for updates
// FIXME ResourceVersion not available anymore
// if app != nil {
// appRequest.ResourceVersion = app.ResourceVersion
// }
if len(apps.Items) > 1 {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("found multiple applications matching name '%s' and namespace '%s'", *appQuery.Name, *appQuery.AppNamespace),
Detail: err.Error(),
},
}
}
validate := d.Get("validate").(bool)
if _, err = si.ApplicationClient.Update(ctx, &applicationClient.ApplicationUpdateRequest{
Application: &application.Application{
ObjectMeta: objectMeta,
Spec: spec,
TypeMeta: metav1.TypeMeta{
Kind: "Application",
APIVersion: "argoproj.io/v1alpha1",
},
},
Validate: &validate,
}); err != nil {
return argoCDAPIError("update", "application", objectMeta.Name, err)
}
if sync, ok := d.GetOk("sync"); ok && sync.(bool) {
prune := false
if spec.SyncPolicy.Automated != nil && spec.SyncPolicy.Automated.Prune {
prune = true
}
_, err = si.ApplicationClient.Sync(ctx, &applicationClient.ApplicationSyncRequest{
Name: &objectMeta.Name,
AppNamespace: &objectMeta.Namespace,
Prune: &prune,
})
if err != nil {
return errorToDiagnostics(fmt.Sprintf("error while triggering sync of application %s", *appQuery.Name), err)
}
}
if wait, _ok := d.GetOk("wait"); _ok && wait.(bool) {
if err = retry.RetryContext(ctx, d.Timeout(schema.TimeoutUpdate), func() *retry.RetryError {
var list *application.ApplicationList
if list, err = si.ApplicationClient.List(ctx, appQuery); err != nil {
return retry.NonRetryableError(fmt.Errorf("error while waiting for application %s to be synced and healthy: %s", list.Items[0].Name, err))
}
if len(list.Items) != 1 {
return retry.NonRetryableError(fmt.Errorf("found unexpected number of applications matching name '%s' and namespace '%s'. Items: %d", *appQuery.Name, *appQuery.AppNamespace, len(list.Items)))
}
if list.Items[0].Status.ReconciledAt.Equal(apps.Items[0].Status.ReconciledAt) {
return retry.RetryableError(fmt.Errorf("reconciliation has not begun"))
}
if list.Items[0].Status.Health.Status != health.HealthStatusHealthy {
return retry.RetryableError(fmt.Errorf("expected application health status to be healthy but was %s", list.Items[0].Status.Health.Status))
}
if list.Items[0].Status.Sync.Status != application.SyncStatusCodeSynced {
return retry.RetryableError(fmt.Errorf("expected application sync status to be synced but was %s", list.Items[0].Status.Sync.Status))
}
return nil
}); err != nil {
return errorToDiagnostics(fmt.Sprintf("error while waiting for application %s to be updated", *appQuery.Name), err)
}
}
return resourceArgoCDApplicationRead(ctx, d, meta)
}
func resourceArgoCDApplicationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
ids := strings.Split(d.Id(), ":")
appName := ids[0]
namespace := ids[1]
cascade := d.Get("cascade").(bool)
if _, err := si.ApplicationClient.Delete(ctx, &applicationClient.ApplicationDeleteRequest{
Name: &appName,
Cascade: &cascade,
AppNamespace: &namespace,
}); err != nil && !strings.Contains(err.Error(), "NotFound") {
return argoCDAPIError("delete", "application", appName, err)
}
if wait, ok := d.GetOk("wait"); ok && wait.(bool) {
if err := retry.RetryContext(ctx, d.Timeout(schema.TimeoutDelete), func() *retry.RetryError {
apps, err := si.ApplicationClient.List(ctx, &applicationClient.ApplicationQuery{
Name: &appName,
AppNamespace: &namespace,
})
switch err {
case nil:
if apps != nil && len(apps.Items) > 0 {
return retry.RetryableError(fmt.Errorf("application %s is still present", appName))
}
default:
if !strings.Contains(err.Error(), "NotFound") {
return retry.NonRetryableError(err)
}
}
d.SetId("")
return nil
}); err != nil {
return errorToDiagnostics(fmt.Sprintf("error while waiting for application %s to be deleted", appName), err)
}
}
d.SetId("")
return nil
}
================================================
FILE: argocd/resource_argocd_application_set.go
================================================
package argocd
import (
"context"
"fmt"
"strings"
"github.com/argoproj-labs/terraform-provider-argocd/internal/features"
"github.com/argoproj/argo-cd/v3/pkg/apiclient/applicationset"
application "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func resourceArgoCDApplicationSet() *schema.Resource {
return &schema.Resource{
Description: "Manages [application sets](https://argo-cd.readthedocs.io/en/stable/user-guide/application-set/) within ArgoCD.",
CreateContext: resourceArgoCDApplicationSetCreate,
ReadContext: resourceArgoCDApplicationSetRead,
UpdateContext: resourceArgoCDApplicationSetUpdate,
DeleteContext: resourceArgoCDApplicationSetDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Schema: map[string]*schema.Schema{
"metadata": metadataSchema("applicationsets.argoproj.io"),
"spec": applicationSetSpecSchemaV1(),
},
SchemaVersion: 1,
StateUpgraders: []schema.StateUpgrader{
{
Type: resourceArgoCDApplicationV1().CoreConfigSchema().ImpliedType(),
Upgrade: resourceArgoCDApplicationSetStateUpgradeV0,
Version: 0,
},
},
}
}
func resourceArgoCDApplicationSetCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
if !si.IsFeatureSupported(features.ApplicationSet) {
return featureNotSupported(features.ApplicationSet)
}
objectMeta, spec, err := expandApplicationSet(
d,
si.IsFeatureSupported(features.MultipleApplicationSources),
si.IsFeatureSupported(features.ApplicationSetIgnoreApplicationDifferences),
si.IsFeatureSupported(features.ApplicationSetTemplatePatch),
si.IsFeatureSupported(features.ApplicationSourceName),
)
if err != nil {
return errorToDiagnostics("failed to expand application set", err)
}
if !si.IsFeatureSupported(features.ApplicationSetProgressiveSync) && spec.Strategy != nil {
return featureNotSupported(features.ApplicationSetProgressiveSync)
}
if !si.IsFeatureSupported(features.ApplicationSetIgnoreApplicationDifferences) && spec.IgnoreApplicationDifferences != nil {
return featureNotSupported(features.ApplicationSetIgnoreApplicationDifferences)
}
if !si.IsFeatureSupported(features.ApplicationSetApplicationsSyncPolicy) && spec.SyncPolicy != nil && spec.SyncPolicy.ApplicationsSync != nil {
return featureNotSupported(features.ApplicationSetApplicationsSyncPolicy)
}
if !si.IsFeatureSupported(features.ApplicationSetTemplatePatch) && spec.TemplatePatch != nil {
return featureNotSupported(features.ApplicationSetTemplatePatch)
}
as, err := si.ApplicationSetClient.Create(ctx, &applicationset.ApplicationSetCreateRequest{
Applicationset: &application.ApplicationSet{
ObjectMeta: objectMeta,
Spec: spec,
TypeMeta: metav1.TypeMeta{
Kind: "ApplicationSet",
APIVersion: "argoproj.io/v1alpha1",
},
},
})
if err != nil {
return argoCDAPIError("create", "application set", objectMeta.Name, err)
} else if as == nil {
return []diag.Diagnostic{
{
Severity: diag.Error,
Summary: fmt.Sprintf("application set %s not created: unknown reason", objectMeta.Name),
},
}
}
d.SetId(fmt.Sprintf("%s:%s", as.Name, objectMeta.Namespace))
return resourceArgoCDApplicationSetRead(ctx, d, meta)
}
func resourceArgoCDApplicationSetRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
ids := strings.Split(d.Id(), ":")
appSetName := ids[0]
namespace := ids[1]
appSet, err := si.ApplicationSetClient.Get(ctx, &applicationset.ApplicationSetGetQuery{
Name: appSetName,
AppsetNamespace: namespace,
})
if err != nil {
if strings.Contains(err.Error(), "NotFound") {
d.SetId("")
return diag.Diagnostics{}
}
return argoCDAPIError("read", "application set", appSetName, err)
}
err = flattenApplicationSet(appSet, d)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("failed to flatten application set %s", appSetName), err)
}
return nil
}
func resourceArgoCDApplicationSetUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
if !si.IsFeatureSupported(features.ApplicationSet) {
return featureNotSupported(features.ApplicationSet)
}
if !d.HasChanges("metadata", "spec") {
return nil
}
objectMeta, spec, err := expandApplicationSet(
d,
si.IsFeatureSupported(features.MultipleApplicationSources),
si.IsFeatureSupported(features.ApplicationSetIgnoreApplicationDifferences),
si.IsFeatureSupported(features.ApplicationSetTemplatePatch),
si.IsFeatureSupported(features.ApplicationSourceName),
)
if err != nil {
return errorToDiagnostics(fmt.Sprintf("failed to expand application set %s", d.Id()), err)
}
if !si.IsFeatureSupported(features.ApplicationSetProgressiveSync) && spec.Strategy != nil {
return featureNotSupported(features.ApplicationSetProgressiveSync)
}
if !si.IsFeatureSupported(features.ApplicationSetIgnoreApplicationDifferences) && spec.IgnoreApplicationDifferences != nil {
return featureNotSupported(features.ApplicationSetIgnoreApplicationDifferences)
}
if !si.IsFeatureSupported(features.ApplicationSetApplicationsSyncPolicy) && spec.SyncPolicy != nil && spec.SyncPolicy.ApplicationsSync != nil {
return featureNotSupported(features.ApplicationSetApplicationsSyncPolicy)
}
_, err = si.ApplicationSetClient.Create(ctx, &applicationset.ApplicationSetCreateRequest{
Applicationset: &application.ApplicationSet{
ObjectMeta: objectMeta,
Spec: spec,
TypeMeta: metav1.TypeMeta{
Kind: "ApplicationSet",
APIVersion: "argoproj.io/v1alpha1",
},
},
Upsert: true,
})
if err != nil {
return argoCDAPIError("update", "application set", objectMeta.Name, err)
}
return resourceArgoCDApplicationSetRead(ctx, d, meta)
}
func resourceArgoCDApplicationSetDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
si := meta.(*ServerInterface)
if diags := si.InitClients(ctx); diags != nil {
return pluginSDKDiags(diags)
}
ids := strings.Split(d.Id(), ":")
appSetName := ids[0]
namespace := ids[1]
if _, err := si.ApplicationSetClient.Delete(ctx, &applicationset.ApplicationSetDeleteRequest{
Name: appSetName,
AppsetNamespace: namespace,
}); err != nil && !strings.Contains(err.Error(), "NotFound") {
return argoCDAPIError("delete", "application set", appSetName, err)
}
d.SetId("")
return nil
}
================================================
FILE: argocd/resource_argocd_application_set_test.go
================================================
package argocd
import (
"fmt"
"reflect"
"regexp"
"testing"
"github.com/argoproj-labs/terraform-provider-argocd/internal/features"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
func TestAccArgoCDApplicationSet_clusters(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_clusters(),
Check: resource.TestCheckResourceAttrSet(
"argocd_application_set.clusters",
"metadata.0.uid",
),
},
{
ResourceName: "argocd_application_set.clusters",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_clustersSelector(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_clustersSelector(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.clusters_selector",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.clusters_selector",
"spec.0.generator.0.clusters.0.selector.0.match_labels.%",
),
),
},
{
ResourceName: "argocd_application_set.clusters_selector",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_clusterDecisionResource(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_clusterDecisionResource(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.cluster_decision_resource",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.cluster_decision_resource",
"spec.0.generator.0.cluster_decision_resource.0.config_map_ref",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.cluster_decision_resource",
"spec.0.generator.0.cluster_decision_resource.0.name",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.cluster_decision_resource",
"spec.0.generator.0.cluster_decision_resource.0.label_selector.0.match_labels.%",
),
),
},
{
ResourceName: "argocd_application_set.cluster_decision_resource",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_gitDirectories(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderGitDirectories(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.git_directories",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.git_directories",
"spec.0.generator.0.git.0.directory.0.path",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.git_directories",
"spec.0.generator.0.git.0.directory.1.path",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.git_directories",
"spec.0.generator.0.git.0.directory.1.exclude",
),
),
},
{
ResourceName: "argocd_application_set.git_directories",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_gitFiles(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderGitFiles(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.git_files",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.git_files",
"spec.0.generator.0.git.0.file.0.path",
),
resource.TestCheckResourceAttr(
"argocd_application_set.git_files",
"spec.0.generator.0.git.0.values.foo",
"bar",
),
),
},
{
ResourceName: "argocd_application_set.git_files",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_plugin(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_plugin(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.plugin",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.plugin",
"spec.0.generator.0.plugin.0.requeue_after_seconds",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.plugin",
"spec.0.generator.0.plugin.0.config_map_ref",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.plugin",
"spec.0.generator.0.plugin.0.input.0.parameters.key1",
),
),
},
{
ResourceName: "argocd_application_set.plugin",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_list(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_list(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.list",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.list",
"spec.0.generator.0.list.0.elements.0.cluster",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.list",
"spec.0.generator.0.list.0.elements.0.url",
),
),
},
{
ResourceName: "argocd_application_set.list",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_listElementsYaml(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_listElementsYaml(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.list_elements_yaml",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.list_elements_yaml",
"spec.0.generator.0.list.0.elements_yaml",
"- cluster: engineering-dev\n url: https://kubernetes.default.svc\n environment: development\n- cluster: engineering-prod\n url: https://kubernetes.default.svc\n environment: production\n foo: bar\n",
),
),
},
{
ResourceName: "argocd_application_set.list_elements_yaml",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_matrix(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_matrix(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix",
"spec.0.generator.0.matrix.0.generator.0.git.0.directory.0.path",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix",
"spec.0.generator.0.matrix.0.generator.1.clusters.0.selector.0.match_labels.%",
),
),
},
{
ResourceName: "argocd_application_set.matrix",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_matrixPluginGenerator(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_matrixPluginGenerator(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix-plugin_generator",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix-plugin_generator",
"spec.0.generator.0.matrix.0.generator.1.clusters.0.selector.0.match_labels.%",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix-plugin_generator",
"spec.0.generator.0.matrix.0.generator.0.plugin.0.requeue_after_seconds",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix-plugin_generator",
"spec.0.generator.0.matrix.0.generator.0.plugin.0.config_map_ref",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix-plugin_generator",
"spec.0.generator.0.matrix.0.generator.0.plugin.0.input.0.parameters.key1",
),
),
},
{
ResourceName: "argocd_application_set.matrix-plugin_generator",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_matrixGitPathParamPrefix(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_matrixGitPathParamPrefix(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix_git_path_param_prefix",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.matrix_git_path_param_prefix",
"spec.0.generator.0.matrix.0.generator.0.git.0.path_param_prefix",
"foo",
),
resource.TestCheckResourceAttr(
"argocd_application_set.matrix_git_path_param_prefix",
"spec.0.generator.0.matrix.0.generator.1.git.0.path_param_prefix",
"bar",
),
),
},
{
ResourceName: "argocd_application_set.matrix_git_path_param_prefix",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_matrixNested(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_matrixNested(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix_nested",
"metadata.0.uid",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix_nested",
"spec.0.generator.0.matrix.0.generator.0.clusters.0.selector.0.match_labels.%",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix_nested",
"spec.0.generator.0.matrix.0.generator.1.matrix.0.generator.0.git.0.repo_url",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.matrix_nested",
"spec.0.generator.0.matrix.0.generator.1.matrix.0.generator.1.list.0.elements.0.cluster",
),
),
},
{
ResourceName: "argocd_application_set.matrix_nested",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_matrixInvalid(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_matrixInsufficientGenerators(),
ExpectError: regexp.MustCompile("Error: Insufficient generator blocks"),
},
{
Config: testAccArgoCDApplicationSet_matrixTooManyGenerators(),
ExpectError: regexp.MustCompile("Error: Too many generator blocks"),
},
{
Config: testAccArgoCDApplicationSet_matrixNestedInsufficientGenerators(),
ExpectError: regexp.MustCompile("Error: Insufficient generator blocks"),
},
{
Config: testAccArgoCDApplicationSet_matrixOnly1LevelOfNesting(),
ExpectError: regexp.MustCompile("Blocks of type \"matrix\" are not expected here."),
},
},
})
}
func TestAccArgoCDApplicationSet_merge(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_merge(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.merge",
"spec.0.generator.0.merge.0.merge_keys.0",
"server",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge",
"spec.0.generator.0.merge.0.generator.0.clusters.0.values.%",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge",
"spec.0.generator.0.merge.0.generator.1.clusters.0.selector.0.match_labels.%",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge",
"spec.0.generator.0.merge.0.generator.2.list.0.elements.0.server",
),
),
},
{
ResourceName: "argocd_application_set.merge",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string", "spec.0.template.0.spec.0.source.0.helm.0.parameter.1.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_mergeNested(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_mergeNested(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge_nested",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.merge_nested",
"spec.0.generator.0.merge.0.merge_keys.0",
"server",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge_nested",
"spec.0.generator.0.merge.0.generator.0.list.0.elements.0.server",
),
resource.TestCheckResourceAttr(
"argocd_application_set.merge_nested",
"spec.0.generator.0.merge.0.generator.1.merge.0.merge_keys.0",
"server",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge_nested",
"spec.0.generator.0.merge.0.generator.1.merge.0.generator.1.clusters.0.values.%",
),
resource.TestCheckResourceAttrSet(
"argocd_application_set.merge_nested",
"spec.0.generator.0.merge.0.generator.1.merge.0.generator.1.clusters.0.selector.0.match_labels.%",
),
),
},
{
ResourceName: "argocd_application_set.merge_nested",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string", "spec.0.template.0.spec.0.source.0.helm.0.parameter.1.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderAzureDevOps(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderAzureDevOps(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_ado",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_ado",
"spec.0.generator.0.scm_provider.0.azure_devops.0.organization",
"myorg",
),
),
},
{
ResourceName: "argocd_application_set.scm_ado",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderBitbucketCloud(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderBitbucketCloud(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_bitbucket_cloud",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_bitbucket_cloud",
"spec.0.generator.0.scm_provider.0.bitbucket_cloud.0.owner",
"example-owner",
),
),
},
{
ResourceName: "argocd_application_set.scm_bitbucket_cloud",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderBitbucketServer(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderBitbucketServer(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_bitbucket_server",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_bitbucket_server",
"spec.0.generator.0.scm_provider.0.bitbucket_server.0.project",
"myproject",
),
),
},
{
ResourceName: "argocd_application_set.scm_bitbucket_server",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderGitea(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderGitea(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_gitea",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_gitea",
"spec.0.generator.0.scm_provider.0.gitea.0.owner",
"myorg",
),
),
},
{
ResourceName: "argocd_application_set.scm_gitea",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderGithub(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderGithub(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_github",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_github",
"spec.0.generator.0.scm_provider.0.github.0.organization",
"myorg",
),
),
},
{
ResourceName: "argocd_application_set.scm_github",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderGitlab(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderGitlab(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_gitlab",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_gitlab",
"spec.0.generator.0.scm_provider.0.gitlab.0.group",
"8675309",
),
),
},
{
ResourceName: "argocd_application_set.scm_gitlab",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_scmProviderWithFilters(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_scmProviderWithFilters(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.scm_filters",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_filters",
"spec.0.generator.0.scm_provider.0.filter.0.repository_match",
"^myapp",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_filters",
"spec.0.generator.0.scm_provider.0.filter.0.paths_exist.0",
"kubernetes/kustomization.yaml",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_filters",
"spec.0.generator.0.scm_provider.0.filter.1.repository_match",
"^otherapp",
),
resource.TestCheckResourceAttr(
"argocd_application_set.scm_filters",
"spec.0.generator.0.scm_provider.0.filter.1.paths_do_not_exist.0",
"disabledrepo.txt",
),
),
},
{
ResourceName: "argocd_application_set.scm_filters",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_pullRequestBitbucketServer(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_pullRequestBitbucketServer(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.pr_bitbucket_server",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_bitbucket_server",
"spec.0.generator.0.pull_request.0.bitbucket_server.0.project",
"myproject",
),
),
},
{
ResourceName: "argocd_application_set.pr_bitbucket_server",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_pullRequestGitea(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_pullRequestGitea(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.pr_gitea",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitea",
"spec.0.generator.0.pull_request.0.gitea.0.owner",
"myorg",
),
),
},
{
ResourceName: "argocd_application_set.pr_gitea",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_pullRequestGithub(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_pullRequestGithub(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.pr_github",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_github",
"spec.0.generator.0.pull_request.0.github.0.owner",
"myorg",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_github",
"spec.0.generator.0.pull_request.0.github.0.labels.0",
"preview",
),
),
},
{
ResourceName: "argocd_application_set.pr_github",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_pullRequestGitlab(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_pullRequestGitlab(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.pr_gitlab",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitlab",
"spec.0.generator.0.pull_request.0.gitlab.0.project",
"myproject",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitlab",
"spec.0.generator.0.pull_request.0.gitlab.0.labels.0",
"preview",
),
),
},
{
ResourceName: "argocd_application_set.pr_gitlab",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_pullRequestGitlabInsecureAndCARef(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_pullRequestGitlabInsecureAndCARef(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.pr_gitlab_insecure",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitlab_insecure",
"spec.0.generator.0.pull_request.0.gitlab.0.project",
"myproject",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitlab_insecure",
"spec.0.generator.0.pull_request.0.gitlab.0.insecure",
"true",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitlab_insecure",
"spec.0.generator.0.pull_request.0.gitlab.0.ca_ref.0.key",
"ca.crt",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_gitlab_insecure",
"spec.0.generator.0.pull_request.0.gitlab.0.ca_ref.0.config_map_name",
"gitlab-ca-cert",
),
),
},
{
ResourceName: "argocd_application_set.pr_gitlab_insecure",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_pullRequestAzureDevOps(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_pullRequestAzureDevOps(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.pr_azure_devops",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.pr_azure_devops",
"spec.0.generator.0.pull_request.0.azure_devops.0.organization",
"myorg",
),
),
},
{
ResourceName: "argocd_application_set.pr_azure_devops",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string"},
},
},
})
}
func TestAccArgoCDApplicationSet_mergeInvalid(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_mergeInsufficientGenerators(),
ExpectError: regexp.MustCompile("Error: Insufficient generator blocks"),
},
{
Config: testAccArgoCDApplicationSet_mergeNestedInsufficientGenerators(),
ExpectError: regexp.MustCompile("Error: Insufficient generator blocks"),
},
{
Config: testAccArgoCDApplicationSet_mergeOnly1LevelOfNesting(),
ExpectError: regexp.MustCompile("Blocks of type \"merge\" are not expected here."),
},
},
})
}
func TestAccArgoCDApplicationSet_generatorTemplate(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_generatorTemplate(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.generator_template",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.generator_template",
"spec.0.generator.0.list.0.elements.0.cluster",
"engineering-dev",
),
resource.TestCheckResourceAttr(
"argocd_application_set.generator_template",
"spec.0.generator.0.list.0.template.0.spec.0.project",
"default",
),
),
},
{
ResourceName: "argocd_application_set.generator_template",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_goTemplate(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_goTemplate(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.go_template",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.go_template",
"spec.0.go_template",
"true",
),
resource.TestCheckResourceAttr(
"argocd_application_set.go_template",
"spec.0.go_template_options.0",
"missingkey=error",
),
),
},
{
ResourceName: "argocd_application_set.go_template",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_syncPolicy(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_syncPolicy(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.sync_policy",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.sync_policy",
"spec.0.sync_policy.0.preserve_resources_on_deletion",
"true",
),
),
},
{
ResourceName: "argocd_application_set.sync_policy",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_syncPolicyWithApplicationsSyncPolicy(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccPreCheckFeatureSupported(t, features.ApplicationSetApplicationsSyncPolicy)
},
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_syncPolicyWithApplicationsSync(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.applications_sync_policy",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.applications_sync_policy",
"spec.0.sync_policy.0.preserve_resources_on_deletion",
"true",
),
resource.TestCheckResourceAttr(
"argocd_application_set.applications_sync_policy",
"spec.0.sync_policy.0.applications_sync",
"create-update",
),
),
},
{
ResourceName: "argocd_application_set.applications_sync_policy",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_progressiveSync(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSetProgressiveSync) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_progressiveSync(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.progressive_sync",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.progressive_sync",
"spec.0.strategy.0.type",
"RollingSync",
),
),
},
{
ResourceName: "argocd_application_set.progressive_sync",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_templatePatch(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSetTemplatePatch) },
ProviderFactories: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSet_templatePatch(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.template_patch",
"metadata.0.uid",
),
resource.TestCheckResourceAttr(
"argocd_application_set.template_patch",
"spec.0.template_patch",
" spec:\n source:\n helm:\n valueFiles:\n {{- range $valueFile := .valueFiles }}\n - {{ $valueFile }}\n {{- end }}\n {{- if .autoSync }}\n syncPolicy:\n automated:\n prune: {{ .prune }}\n {{- end }}\n",
),
),
},
{
ResourceName: "argocd_application_set.template_patch",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}
func TestAccArgoCDApplicationSet_CustomNamespace(t *testing.T) {
name := acctest.RandomWithPrefix("appset-ns")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckFeatureSupported(t, features.ApplicationSet) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccArgoCDApplicationSetCustomNamespace(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(
"argocd_application_set.custom_namespace",
"metadata.0.uid",
),
),
},
{
ResourceName: "argocd_application_set.custom_namespace",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"wait", "cascade", "status", "validate", "metadata.0.resource_version", "spec.0.template.0.spec.0.source.0.helm.0.parameter.0.force_string", "spec.0.template.0.spec.0.source.0.helm.0.parameter.1.force_string"},
},
},
})
}
func TestUpgradeSchemaApplicationSet_V0V1_Default_NoChange(t *testing.T) {
t.Parallel()
v0 := map[string]interface{}{
"metadata": []interface{}{
map[string]interface{}{
"name": "test",
"namespace": "argocd",
},
},
"spec": []interface{}{
map[string]interface{}{
"generator": []interface{}{
map[string]interface{}{
"clusters": []interface{}{map[string]interface{}{}},
},
},
"template": []interface{}{
map[string]interface{}{
"metadata": []interface{}{map[string]interface{}{
"name": "{{ name }}-clusters",
}},
"spec": []interface{}{map[string]interface{}{
"source": []interface{}{map[string]interface{}{
"repo_url": "https://github.com/argoproj/argocd-example-apps",
"target_revision": "HEAD",
"path": "guestbook",
}},
"destination": []interface{}{map[string]interface{}{
"server": "{{ server }}",
"namespace": "default",
}},
}},
},
},
},
},
}
actual, _ := resourceArgoCDApplicationStateUpgradeV0(t.Context(), v0, nil)
if !reflect.DeepEqual(v0, actual) {
t.Fatalf("\n\nexpected:\n\n%#v\n\ngot:\n\n%#v\n\n", v0, actual)
}
}
func testAccArgoCDApplicationSet_clusters() string {
return `
resource "argocd_application_set" "clusters" {
metadata {
name = "clusters"
}
spec {
generator {
clusters {} # Automatically use all clusters defined within Argo CD
}
template {
metadata {
name = "{{name}}-clusters"
}
spec {
source {
repo_url = "https://github.com/argoproj/argo-cd/"
target_revision = "HEAD"
path = "test/e2e/testdata/guestbook"
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_clustersSelector() string {
return `
resource "argocd_application_set" "clusters_selector" {
metadata {
name = "clusters-selector"
}
spec {
generator {
clusters {
selector {
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
}
}
}
template {
metadata {
name = "{{name}}-clusters-selector"
}
spec {
source {
repo_url = "https://github.com/argoproj/argo-cd/"
target_revision = "HEAD"
path = "test/e2e/testdata/guestbook"
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_clusterDecisionResource() string {
return `
resource "argocd_application_set" "cluster_decision_resource" {
metadata {
name = "cluster-decision-resource"
}
spec {
generator {
cluster_decision_resource {
config_map_ref = "my-configmap"
name = "quak"
requeue_after_seconds = "180"
label_selector {
match_labels = {
duck = "spotted"
}
match_expressions {
key = "duck"
operator = "In"
values = [
"spotted",
"canvasback"
]
}
}
}
}
template {
metadata {
name = "{{name}}-cluster-decision-resource"
}
spec {
source {
repo_url = "https://github.com/argoproj/argo-cd/"
target_revision = "HEAD"
path = "test/e2e/testdata/guestbook"
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_scmProviderGitDirectories() string {
return `
resource "argocd_application_set" "git_directories" {
metadata {
name = "git-directories"
}
spec {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/git-generator-directory/cluster-addons/*"
}
directory {
path = "applicationset/examples/git-generator-directory/excludes/cluster-addons/exclude-helm-guestbook"
exclude = true
}
requeue_after_seconds = "30"
}
}
template {
metadata {
name = "{{path.basename}}-git-directories"
}
spec {
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "https://kubernetes.default.svc"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_scmProviderGitFiles() string {
return `
resource "argocd_application_set" "git_files" {
metadata {
name = "git-files"
}
spec {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
file {
path = "applicationset/examples/git-generator-files-discovery/cluster-config/**/config.json"
}
values = {
foo = "bar"
}
}
}
template {
metadata {
name = "{{cluster.name}}-git-files"
}
spec {
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "applicationset/examples/git-generator-files-discovery/apps/guestbook"
}
destination {
server = "{{cluster.address}}"
namespace = "guestbook"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_plugin() string {
return `
resource "argocd_application_set" "plugin" {
metadata {
name = "plugin"
}
spec {
generator {
plugin {
config_map_ref = "plugin"
input {
parameters = {
key1 = "value1"
}
}
requeue_after_seconds = 30
}
}
template {
metadata {
name = "{{cluster}}-guestbook"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "applicationset/examples/list-generator/guestbook/{{cluster}}"
}
destination {
server = "{{url}}"
namespace = "guestbook"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_list() string {
return `
resource "argocd_application_set" "list" {
metadata {
name = "list"
}
spec {
generator {
list {
elements = [
{
cluster = "engineering-dev"
url = "https://kubernetes.default.svc"
}
]
}
}
template {
metadata {
name = "{{cluster}}-guestbook"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "applicationset/examples/list-generator/guestbook/{{cluster}}"
}
destination {
server = "{{url}}"
namespace = "guestbook"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_listElementsYaml() string {
return `
resource "argocd_application_set" "list_elements_yaml" {
metadata {
name = "list-elements-yaml"
}
spec {
generator {
list {
elements = []
elements_yaml = <<-EOT
- cluster: engineering-dev
url: https://kubernetes.default.svc
environment: development
- cluster: engineering-prod
url: https://kubernetes.default.svc
environment: production
foo: bar
EOT
}
}
template {
metadata {
name = "{{cluster}}-guestbook"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "applicationset/examples/list-generator/guestbook/{{cluster}}"
}
destination {
server = "{{url}}"
namespace = "guestbook"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrix() string {
return `
resource "argocd_application_set" "matrix" {
metadata {
name = "matrix"
}
spec {
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
requeue_after_seconds = "30"
}
}
generator {
clusters{
selector{
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
}
}
}
}
}
template {
metadata {
name = "{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixPluginGenerator() string {
return `
resource "argocd_application_set" "matrix-plugin_generator" {
metadata {
name = "matrix-plugin-generator"
}
spec {
generator {
matrix {
generator {
plugin {
config_map_ref = "plugin"
input {
parameters = {
key1 = "value1"
}
}
requeue_after_seconds = 30
}
}
generator {
clusters{
selector{
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
}
}
}
}
}
template {
metadata {
name = "{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixGitPathParamPrefix() string {
return `
resource "argocd_application_set" "matrix_git_path_param_prefix" {
metadata {
name = "matrix-git-path-param-prefix"
}
spec {
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
path_param_prefix = "foo"
file {
path = "applicationset/examples/git-generator-files-discovery/cluster-config/**/config.json"
}
}
}
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
path_param_prefix = "bar"
file {
path = "applicationset/examples/git-generator-files-discovery/cluster-config/**/config.json"
}
}
}
}
}
template {
metadata {
name = "matrix-git-path-param-prefix"
}
spec {
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "applicationset/examples/git-generator-files-discovery/apps/guestbook"
}
destination {
server = "{{cluster.address}}"
namespace = "guestbook"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixNested() string {
return `
resource "argocd_application_set" "matrix_nested" {
metadata {
name = "matrix-nested"
}
spec {
generator {
matrix {
generator {
clusters{
selector{
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
}
}
}
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
generator {
list {
elements = [
{
cluster = "engineering-dev"
url = "https://kubernetes.default.svc"
}
]
}
}
}
}
}
}
template {
metadata {
name = "nested-{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixInsufficientGenerators() string {
return `
resource "argocd_application_set" "matrix_insufficient_generators" {
metadata {
name = "matrix-insufficient-generators"
}
spec {
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
}
}
template {
metadata {
name = "{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixTooManyGenerators() string {
return `
resource "argocd_application_set" "matrix_too_many_generators" {
metadata {
name = "matrix-too-many-generators"
}
spec {
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
}
}
template {
metadata {
name = "{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixNestedInsufficientGenerators() string {
return `
resource "argocd_application_set" "matrix_nested_insufficient_generators" {
metadata {
name = "matrix-nested-insufficient-generators"
}
spec {
generator {
matrix {
generator {
clusters{
selector{
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
}
}
}
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
}
}
}
}
template {
metadata {
name = "nested-{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_matrixOnly1LevelOfNesting() string {
return `
resource "argocd_application_set" "matrix_nested_invalid" {
metadata {
name = "matrix-nested-invalid"
}
spec {
generator {
matrix {
generator {
clusters{
selector{
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
}
}
}
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
generator {
matrix {
generator {
git {
repo_url = "https://github.com/argoproj/argo-cd.git"
revision = "HEAD"
directory {
path = "applicationset/examples/matrix/cluster-addons/*"
}
}
}
generator {
list {
elements = [
{
cluster = "engineering-dev"
url = "https://kubernetes.default.svc"
}
]
}
}
}
}
}
}
}
}
template {
metadata {
name = "nested-{{path.basename}}-{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
target_revision = "HEAD"
path = "{{path}}"
}
destination {
server = "{{server}}"
namespace = "{{path.basename}}"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_merge() string {
return `
resource "argocd_application_set" "merge" {
metadata {
name = "merge"
}
spec {
generator {
merge {
merge_keys = [
"server"
]
generator {
clusters {
values = {
kafka = true
redis = false
}
}
}
generator {
clusters {
selector {
match_labels = {
use-kafka = "false"
}
}
values = {
kafka = "false"
}
}
}
generator {
list {
elements = [
{
server = "https://2.4.6.8"
"values.redis" = "true"
},
]
}
}
}
}
template {
metadata {
name = "{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
path = "app"
target_revision = "HEAD"
helm {
parameter {
name = "kafka"
value = "{{values.kafka}}"
}
parameter {
name = "redis"
value = "{{values.redis}}"
}
}
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_mergeNested() string {
return `
resource "argocd_application_set" "merge_nested" {
metadata {
name = "merge-nested"
}
spec {
generator {
merge {
merge_keys = [
"server"
]
generator {
list {
elements = [
{
server = "https://2.4.6.8"
"values.redis" = "true"
},
]
}
}
generator {
merge {
merge_keys = [
"server"
]
generator {
clusters {
values = {
kafka = true
redis = false
}
}
}
generator {
clusters {
selector {
match_labels = {
use-kafka = "false"
}
}
values = {
kafka = "false"
}
}
}
}
}
}
}
template {
metadata {
name = "{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
path = "app"
target_revision = "HEAD"
helm {
parameter {
name = "kafka"
value = "{{values.kafka}}"
}
parameter {
name = "redis"
value = "{{values.redis}}"
}
}
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_mergeInsufficientGenerators() string {
return `
resource "argocd_application_set" "merge_insufficient_generators" {
metadata {
name = "merge-insufficient-generators"
}
spec {
generator {
merge {
merge_keys = [
"server"
]
generator {
clusters {
values = {
kafka = true
redis = false
}
}
}
}
}
template {
metadata {
name = "{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
path = "app"
target_revision = "HEAD"
helm {
parameter {
name = "kafka"
value = "{{values.kafka}}"
}
parameter {
name = "redis"
value = "{{values.redis}}"
}
}
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_mergeNestedInsufficientGenerators() string {
return `
resource "argocd_application_set" "merge_nested_insufficient_generators" {
metadata {
name = "merge-nested-insufficient-generators"
}
spec {
generator {
merge {
merge_keys = [
"server"
]
generator {
list {
elements = [
{
server = "https://2.4.6.8"
"values.redis" = "true"
},
]
}
}
generator {
merge {
merge_keys = [
"server"
]
generator {
clusters {
values = {
kafka = true
redis = false
}
}
}
}
}
}
}
template {
metadata {
name = "{{name}}"
}
spec {
project = "default"
source {
repo_url = "https://github.com/argoproj/argo-cd.git"
path = "app"
target_revision = "HEAD"
helm {
parameter {
name = "kafka"
value = "{{values.kafka}}"
}
parameter {
name = "redis"
value = "{{values.redis}}"
}
}
}
destination {
server = "{{server}}"
namespace = "default"
}
}
}
}
}`
}
func testAccArgoCDApplicationSet_mergeOnly1LevelOfNesting() string {
return `
resource "argocd_application_set" "merge_nested_invalid" {
metadata {
name = "merge-nested-invalid"
}
spec {
generator {
merge {
merge_keys = [
"server"
]
generator {
list {
elements = [
{
server = "https://2.4.6.8"
"values.redis" = "true"
},
]
}
}
generator {
merge {
merge_keys = [
"server"
]
generator {
clusters {
values = {
kafka = true
redis = false
}
}
}
generator {
merge {
merge_keys = [
"server"
]
generator {
clusters {
gitextract_3leo_80w/
├── .devcontainer.json
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.md
│ │ ├── config.yml
│ │ ├── feature-request.md
│ │ └── question.md
│ ├── PULL_REQUEST_TEMPLATE.MD
│ ├── renovate.json
│ └── workflows/
│ ├── codeql-analysis.yml
│ ├── release.yml
│ ├── stale.yml
│ └── tests.yml
├── .gitignore
├── .golangci.yml
├── .goreleaser.yml
├── .run/
│ └── Template Go Test.run.xml
├── .vscode/
│ └── launch.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── GNUmakefile
├── LICENSE
├── README.md
├── RELEASE.md
├── SECURITY.md
├── argocd/
│ ├── model_provider.go
│ ├── provider.go
│ ├── provider_test.go
│ ├── resource_argocd_account_token.go
│ ├── resource_argocd_account_token_test.go
│ ├── resource_argocd_application.go
│ ├── resource_argocd_application_set.go
│ ├── resource_argocd_application_set_test.go
│ ├── resource_argocd_application_test.go
│ ├── resource_argocd_cluster.go
│ ├── resource_argocd_cluster_test.go
│ ├── schema_application.go
│ ├── schema_application_set.go
│ ├── schema_application_test.go
│ ├── schema_cluster.go
│ ├── schema_label_selector.go
│ ├── schema_metadata.go
│ ├── server_interface.go
│ ├── server_interface_test.go
│ ├── structure_application.go
│ ├── structure_application_set.go
│ ├── structure_cluster.go
│ ├── structure_label_selector.go
│ ├── structure_metadata.go
│ ├── structure_metadata_test.go
│ ├── structures.go
│ ├── utils.go
│ ├── utils_test.go
│ ├── validators.go
│ └── validators_test.go
├── docs/
│ ├── data-sources/
│ │ └── application.md
│ ├── index.md
│ └── resources/
│ ├── account_token.md
│ ├── application.md
│ ├── application_set.md
│ ├── cluster.md
│ ├── gpg_key.md
│ ├── project.md
│ ├── project_token.md
│ ├── repository.md
│ ├── repository_certificate.md
│ └── repository_credentials.md
├── examples/
│ ├── data-sources/
│ │ └── argocd_application/
│ │ └── data-source.tf
│ ├── provider/
│ │ └── provider.tf
│ └── resources/
│ ├── argocd_account_token/
│ │ └── resource.tf
│ ├── argocd_application/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_application_set/
│ │ └── resource.tf
│ ├── argocd_cluster/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_gpg_key/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_project/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_project_token/
│ │ └── resource.tf
│ ├── argocd_repository/
│ │ ├── import.sh
│ │ └── resource.tf
│ ├── argocd_repository_certificate/
│ │ └── resource.tf
│ └── argocd_repository_credentials/
│ ├── import.sh
│ └── resource.tf
├── go.mod
├── go.sum
├── internal/
│ ├── diagnostics/
│ │ └── diagnostics.go
│ ├── features/
│ │ └── features.go
│ ├── provider/
│ │ ├── data_source_application.go
│ │ ├── data_source_application_test.go
│ │ ├── model_application.go
│ │ ├── model_gpg_key.go
│ │ ├── model_metadata.go
│ │ ├── model_project.go
│ │ ├── model_project_token.go
│ │ ├── model_provider.go
│ │ ├── model_repository.go
│ │ ├── model_repository_certificate.go
│ │ ├── model_repository_credentials.go
│ │ ├── planmodifiers.go
│ │ ├── provider.go
│ │ ├── provider_test.go
│ │ ├── resource_gpg_key.go
│ │ ├── resource_gpg_key_test.go
│ │ ├── resource_project.go
│ │ ├── resource_project_test.go
│ │ ├── resource_project_token.go
│ │ ├── resource_project_token_test.go
│ │ ├── resource_repository.go
│ │ ├── resource_repository_certificate.go
│ │ ├── resource_repository_certificate_test.go
│ │ ├── resource_repository_credentials.go
│ │ ├── resource_repository_credentials_test.go
│ │ ├── resource_repository_test.go
│ │ ├── server_interface.go
│ │ └── server_interface_test.go
│ ├── sync/
│ │ └── mutex.go
│ ├── testhelpers/
│ │ ├── suite.go
│ │ └── testcontainers.go
│ ├── types/
│ │ └── pgp_public_key.go
│ ├── utils/
│ │ └── utils.go
│ └── validators/
│ ├── duration.go
│ ├── enable_oci.go
│ ├── is_dns_subdomain.go
│ ├── metadata_annotations.go
│ ├── metadata_annotations_test.go
│ ├── metadata_labels.go
│ ├── metadata_labels_test.go
│ ├── positive_integer.go
│ ├── project_validators.go
│ ├── repository_certificate.go
│ └── ssh_private_key.go
├── kind-config.yml
├── main.go
├── manifests/
│ ├── install/
│ │ ├── cluster-rbac.yml
│ │ ├── git-private-repository.yml
│ │ ├── kustomization.yml
│ │ ├── namespace.yml
│ │ ├── proxy-service.yml
│ │ └── ssh-identity.key
│ ├── local-dev/
│ │ ├── .gitignore
│ │ ├── account-token.tf
│ │ ├── application-set.tf
│ │ ├── application.tf
│ │ ├── cluster.tf
│ │ ├── data.tf
│ │ ├── gpg-key.tf
│ │ ├── outputs.tf
│ │ ├── project-token.tf
│ │ ├── project.tf
│ │ ├── repository-credentials.tf
│ │ ├── repository.tf
│ │ └── versions.tf
│ ├── overlays/
│ │ ├── v3.1.12/
│ │ │ └── kustomization.yml
│ │ ├── v3.2.6/
│ │ │ └── kustomization.yml
│ │ └── v3.3.0/
│ │ └── kustomization.yml
│ ├── patches/
│ │ ├── argocd-cm.yml
│ │ ├── argocd-cmd-params-cm.yml
│ │ ├── kustomization.yaml
│ │ └── secret.yml
│ └── testdata/
│ ├── custom_namespace.yml
│ └── token_resource.yml
├── scripts/
│ └── update-kubernetes-version.sh
├── templates/
│ └── index.md.tmpl
├── terraform-registry-manifest.json
└── tools/
├── go.mod
├── go.sum
└── tools.go
SYMBOL INDEX (954 symbols across 77 files)
FILE: argocd/model_provider.go
type ArgoCDProviderConfig (line 24) | type ArgoCDProviderConfig struct
method getApiClientOptions (line 56) | func (p ArgoCDProviderConfig) getApiClientOptions(ctx context.Context)...
method setCoreOpts (line 163) | func (p ArgoCDProviderConfig) setCoreOpts(opts *apiclient.ClientOption...
method setLocalConfigOpts (line 183) | func (p ArgoCDProviderConfig) setLocalConfigOpts(opts *apiclient.Clien...
method setPortForwardingOpts (line 227) | func (p ArgoCDProviderConfig) setPortForwardingOpts(ctx context.Contex...
type Kubernetes (line 322) | type Kubernetes struct
type KubernetesExec (line 337) | type KubernetesExec struct
FILE: argocd/provider.go
function Provider (line 26) | func Provider() *schema.Provider {
function kubernetesResource (line 159) | func kubernetesResource() *schema.Resource {
function argoCDProviderConfigFromResourceData (line 256) | func argoCDProviderConfigFromResourceData(ctx context.Context, d *schema...
function kubernetesConfigFromResourceData (line 289) | func kubernetesConfigFromResourceData(ctx context.Context, d *schema.Res...
function kubernetesExecConfigFromResourceData (line 315) | func kubernetesExecConfigFromResourceData(ctx context.Context, d *schema...
function getStringFromResourceData (line 336) | func getStringFromResourceData(d *schema.ResourceData, key string) types...
function getBoolFromResourceData (line 344) | func getBoolFromResourceData(d *schema.ResourceData, key string) types.B...
function getStringListFromResourceData (line 352) | func getStringListFromResourceData(ctx context.Context, d *schema.Resour...
function getStringMapFromResourceData (line 360) | func getStringMapFromResourceData(ctx context.Context, d *schema.Resourc...
function getStringSetFromResourceData (line 368) | func getStringSetFromResourceData(ctx context.Context, d *schema.Resourc...
FILE: argocd/provider_test.go
function init (line 25) | func init() {
function TestMain (line 61) | func TestMain(m *testing.M) {
function TestProvider (line 65) | func TestProvider(t *testing.T) {
function TestProvider_headers (line 73) | func TestProvider_headers(t *testing.T) {
function testAccPreCheck (line 93) | func testAccPreCheck(t *testing.T) {
function testAccPreCheckFeatureSupported (line 112) | func testAccPreCheckFeatureSupported(t *testing.T, feature features.Feat...
FILE: argocd/resource_argocd_account_token.go
function resourceArgoCDAccountToken (line 17) | func resourceArgoCDAccountToken() *schema.Resource {
function resourceArgoCDAccountTokenCreate (line 145) | func resourceArgoCDAccountTokenCreate(ctx context.Context, d *schema.Res...
function resourceArgoCDAccountTokenRead (line 243) | func resourceArgoCDAccountTokenRead(ctx context.Context, d *schema.Resou...
function resourceArgoCDAccountTokenUpdate (line 273) | func resourceArgoCDAccountTokenUpdate(ctx context.Context, d *schema.Res...
function resourceArgoCDAccountTokenDelete (line 313) | func resourceArgoCDAccountTokenDelete(ctx context.Context, d *schema.Res...
function getAccount (line 340) | func getAccount(ctx context.Context, si *ServerInterface, d *schema.Reso...
FILE: argocd/resource_argocd_account_token_test.go
function TestAccArgoCDAccountToken_DefaultAccount (line 15) | func TestAccArgoCDAccountToken_DefaultAccount(t *testing.T) {
function TestAccArgoCDAccountToken_ExplicitAccount (line 46) | func TestAccArgoCDAccountToken_ExplicitAccount(t *testing.T) {
function TestAccArgoCDAccountToken_Multiple (line 72) | func TestAccArgoCDAccountToken_Multiple(t *testing.T) {
function TestAccArgoCDAccountToken_RenewBefore (line 104) | func TestAccArgoCDAccountToken_RenewBefore(t *testing.T) {
function TestAccArgoCDAccountToken_RenewAfter (line 140) | func TestAccArgoCDAccountToken_RenewAfter(t *testing.T) {
function testAccArgoCDAccountToken_DefaultAccount (line 171) | func testAccArgoCDAccountToken_DefaultAccount() string {
function testAccArgoCDAccountToken_Expiry (line 177) | func testAccArgoCDAccountToken_Expiry(expiresIn int64) string {
function testAccArgoCDAccountToken_ExplicitAccount (line 185) | func testAccArgoCDAccountToken_ExplicitAccount() string {
function testAccArgoCDAccountToken_Multiple (line 193) | func testAccArgoCDAccountToken_Multiple(count int) string {
function testAccArgoCDAccountTokenRenewBeforeSuccess (line 216) | func testAccArgoCDAccountTokenRenewBeforeSuccess(expiresIn, renewBefore ...
function testAccArgoCDAccountTokenRenewBeforeFailure (line 225) | func testAccArgoCDAccountTokenRenewBeforeFailure(expiresInDuration time....
function testAccArgoCDAccountTokenRenewAfter (line 237) | func testAccArgoCDAccountTokenRenewAfter(renewAfter int) string {
function testCheckTokenIssuedAt (line 246) | func testCheckTokenIssuedAt(resourceName string) resource.TestCheckFunc {
function testCheckTokenExpiresAt (line 271) | func testCheckTokenExpiresAt(resourceName string, expiresIn int64) resou...
function testTokenIssuedAtSet (line 310) | func testTokenIssuedAtSet(name string, count int) resource.TestCheckFunc {
function testDelay (line 337) | func testDelay(seconds int) resource.TestCheckFunc {
FILE: argocd/resource_argocd_application.go
function resourceArgoCDApplication (line 20) | func resourceArgoCDApplication() *schema.Resource {
function resourceArgoCDApplicationCreate (line 89) | func resourceArgoCDApplicationCreate(ctx context.Context, d *schema.Reso...
function resourceArgoCDApplicationRead (line 218) | func resourceArgoCDApplicationRead(ctx context.Context, d *schema.Resour...
function resourceArgoCDApplicationUpdate (line 266) | func resourceArgoCDApplicationUpdate(ctx context.Context, d *schema.Reso...
function resourceArgoCDApplicationDelete (line 391) | func resourceArgoCDApplicationDelete(ctx context.Context, d *schema.Reso...
FILE: argocd/resource_argocd_application_set.go
function resourceArgoCDApplicationSet (line 16) | func resourceArgoCDApplicationSet() *schema.Resource {
function resourceArgoCDApplicationSetCreate (line 41) | func resourceArgoCDApplicationSetCreate(ctx context.Context, d *schema.R...
function resourceArgoCDApplicationSetRead (line 104) | func resourceArgoCDApplicationSetRead(ctx context.Context, d *schema.Res...
function resourceArgoCDApplicationSetUpdate (line 135) | func resourceArgoCDApplicationSetUpdate(ctx context.Context, d *schema.R...
function resourceArgoCDApplicationSetDelete (line 191) | func resourceArgoCDApplicationSetDelete(ctx context.Context, d *schema.R...
FILE: argocd/resource_argocd_application_set_test.go
function TestAccArgoCDApplicationSet_clusters (line 14) | func TestAccArgoCDApplicationSet_clusters(t *testing.T) {
function TestAccArgoCDApplicationSet_clustersSelector (line 36) | func TestAccArgoCDApplicationSet_clustersSelector(t *testing.T) {
function TestAccArgoCDApplicationSet_clusterDecisionResource (line 64) | func TestAccArgoCDApplicationSet_clusterDecisionResource(t *testing.T) {
function TestAccArgoCDApplicationSet_gitDirectories (line 100) | func TestAccArgoCDApplicationSet_gitDirectories(t *testing.T) {
function TestAccArgoCDApplicationSet_gitFiles (line 136) | func TestAccArgoCDApplicationSet_gitFiles(t *testing.T) {
function TestAccArgoCDApplicationSet_plugin (line 169) | func TestAccArgoCDApplicationSet_plugin(t *testing.T) {
function TestAccArgoCDApplicationSet_list (line 205) | func TestAccArgoCDApplicationSet_list(t *testing.T) {
function TestAccArgoCDApplicationSet_listElementsYaml (line 237) | func TestAccArgoCDApplicationSet_listElementsYaml(t *testing.T) {
function TestAccArgoCDApplicationSet_matrix (line 266) | func TestAccArgoCDApplicationSet_matrix(t *testing.T) {
function TestAccArgoCDApplicationSet_matrixPluginGenerator (line 298) | func TestAccArgoCDApplicationSet_matrixPluginGenerator(t *testing.T) {
function TestAccArgoCDApplicationSet_matrixGitPathParamPrefix (line 338) | func TestAccArgoCDApplicationSet_matrixGitPathParamPrefix(t *testing.T) {
function TestAccArgoCDApplicationSet_matrixNested (line 372) | func TestAccArgoCDApplicationSet_matrixNested(t *testing.T) {
function TestAccArgoCDApplicationSet_matrixInvalid (line 408) | func TestAccArgoCDApplicationSet_matrixInvalid(t *testing.T) {
function TestAccArgoCDApplicationSet_merge (line 433) | func TestAccArgoCDApplicationSet_merge(t *testing.T) {
function TestAccArgoCDApplicationSet_mergeNested (line 474) | func TestAccArgoCDApplicationSet_mergeNested(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderAzureDevOps (line 520) | func TestAccArgoCDApplicationSet_scmProviderAzureDevOps(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderBitbucketCloud (line 549) | func TestAccArgoCDApplicationSet_scmProviderBitbucketCloud(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderBitbucketServer (line 578) | func TestAccArgoCDApplicationSet_scmProviderBitbucketServer(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderGitea (line 607) | func TestAccArgoCDApplicationSet_scmProviderGitea(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderGithub (line 636) | func TestAccArgoCDApplicationSet_scmProviderGithub(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderGitlab (line 665) | func TestAccArgoCDApplicationSet_scmProviderGitlab(t *testing.T) {
function TestAccArgoCDApplicationSet_scmProviderWithFilters (line 694) | func TestAccArgoCDApplicationSet_scmProviderWithFilters(t *testing.T) {
function TestAccArgoCDApplicationSet_pullRequestBitbucketServer (line 738) | func TestAccArgoCDApplicationSet_pullRequestBitbucketServer(t *testing.T) {
function TestAccArgoCDApplicationSet_pullRequestGitea (line 767) | func TestAccArgoCDApplicationSet_pullRequestGitea(t *testing.T) {
function TestAccArgoCDApplicationSet_pullRequestGithub (line 796) | func TestAccArgoCDApplicationSet_pullRequestGithub(t *testing.T) {
function TestAccArgoCDApplicationSet_pullRequestGitlab (line 830) | func TestAccArgoCDApplicationSet_pullRequestGitlab(t *testing.T) {
function TestAccArgoCDApplicationSet_pullRequestGitlabInsecureAndCARef (line 864) | func TestAccArgoCDApplicationSet_pullRequestGitlabInsecureAndCARef(t *te...
function TestAccArgoCDApplicationSet_pullRequestAzureDevOps (line 908) | func TestAccArgoCDApplicationSet_pullRequestAzureDevOps(t *testing.T) {
function TestAccArgoCDApplicationSet_mergeInvalid (line 937) | func TestAccArgoCDApplicationSet_mergeInvalid(t *testing.T) {
function TestAccArgoCDApplicationSet_generatorTemplate (line 958) | func TestAccArgoCDApplicationSet_generatorTemplate(t *testing.T) {
function TestAccArgoCDApplicationSet_goTemplate (line 992) | func TestAccArgoCDApplicationSet_goTemplate(t *testing.T) {
function TestAccArgoCDApplicationSet_syncPolicy (line 1026) | func TestAccArgoCDApplicationSet_syncPolicy(t *testing.T) {
function TestAccArgoCDApplicationSet_syncPolicyWithApplicationsSyncPolicy (line 1055) | func TestAccArgoCDApplicationSet_syncPolicyWithApplicationsSyncPolicy(t ...
function TestAccArgoCDApplicationSet_progressiveSync (line 1092) | func TestAccArgoCDApplicationSet_progressiveSync(t *testing.T) {
function TestAccArgoCDApplicationSet_templatePatch (line 1121) | func TestAccArgoCDApplicationSet_templatePatch(t *testing.T) {
function TestAccArgoCDApplicationSet_CustomNamespace (line 1150) | func TestAccArgoCDApplicationSet_CustomNamespace(t *testing.T) {
function TestUpgradeSchemaApplicationSet_V0V1_Default_NoChange (line 1176) | func TestUpgradeSchemaApplicationSet_V0V1_Default_NoChange(t *testing.T) {
function testAccArgoCDApplicationSet_clusters (line 1222) | func testAccArgoCDApplicationSet_clusters() string {
function testAccArgoCDApplicationSet_clustersSelector (line 1256) | func testAccArgoCDApplicationSet_clustersSelector() string {
function testAccArgoCDApplicationSet_clusterDecisionResource (line 1296) | func testAccArgoCDApplicationSet_clusterDecisionResource() string {
function testAccArgoCDApplicationSet_scmProviderGitDirectories (line 1349) | func testAccArgoCDApplicationSet_scmProviderGitDirectories() string {
function testAccArgoCDApplicationSet_scmProviderGitFiles (line 1396) | func testAccArgoCDApplicationSet_scmProviderGitFiles() string {
function testAccArgoCDApplicationSet_plugin (line 1440) | func testAccArgoCDApplicationSet_plugin() string {
function testAccArgoCDApplicationSet_list (line 1486) | func testAccArgoCDApplicationSet_list() string {
function testAccArgoCDApplicationSet_listElementsYaml (line 1529) | func testAccArgoCDApplicationSet_listElementsYaml() string {
function testAccArgoCDApplicationSet_matrix (line 1576) | func testAccArgoCDApplicationSet_matrix() string {
function testAccArgoCDApplicationSet_matrixPluginGenerator (line 1634) | func testAccArgoCDApplicationSet_matrixPluginGenerator() string {
function testAccArgoCDApplicationSet_matrixGitPathParamPrefix (line 1693) | func testAccArgoCDApplicationSet_matrixGitPathParamPrefix() string {
function testAccArgoCDApplicationSet_matrixNested (line 1751) | func testAccArgoCDApplicationSet_matrixNested() string {
function testAccArgoCDApplicationSet_matrixInsufficientGenerators (line 1823) | func testAccArgoCDApplicationSet_matrixInsufficientGenerators() string {
function testAccArgoCDApplicationSet_matrixTooManyGenerators (line 1870) | func testAccArgoCDApplicationSet_matrixTooManyGenerators() string {
function testAccArgoCDApplicationSet_matrixNestedInsufficientGenerators (line 1939) | func testAccArgoCDApplicationSet_matrixNestedInsufficientGenerators() st...
function testAccArgoCDApplicationSet_matrixOnly1LevelOfNesting (line 2000) | func testAccArgoCDApplicationSet_matrixOnly1LevelOfNesting() string {
function testAccArgoCDApplicationSet_merge (line 2087) | func testAccArgoCDApplicationSet_merge() string {
function testAccArgoCDApplicationSet_mergeNested (line 2173) | func testAccArgoCDApplicationSet_mergeNested() string {
function testAccArgoCDApplicationSet_mergeInsufficientGenerators (line 2267) | func testAccArgoCDApplicationSet_mergeInsufficientGenerators() string {
function testAccArgoCDApplicationSet_mergeNestedInsufficientGenerators (line 2328) | func testAccArgoCDApplicationSet_mergeNestedInsufficientGenerators() str...
function testAccArgoCDApplicationSet_mergeOnly1LevelOfNesting (line 2408) | func testAccArgoCDApplicationSet_mergeOnly1LevelOfNesting() string {
function testAccArgoCDApplicationSet_scmProviderAzureDevOps (line 2519) | func testAccArgoCDApplicationSet_scmProviderAzureDevOps() string {
function testAccArgoCDApplicationSet_scmProviderBitbucketCloud (line 2567) | func testAccArgoCDApplicationSet_scmProviderBitbucketCloud() string {
function testAccArgoCDApplicationSet_scmProviderBitbucketServer (line 2614) | func testAccArgoCDApplicationSet_scmProviderBitbucketServer() string {
function testAccArgoCDApplicationSet_scmProviderGitea (line 2664) | func testAccArgoCDApplicationSet_scmProviderGitea() string {
function testAccArgoCDApplicationSet_scmProviderGithub (line 2711) | func testAccArgoCDApplicationSet_scmProviderGithub() string {
function testAccArgoCDApplicationSet_scmProviderGitlab (line 2759) | func testAccArgoCDApplicationSet_scmProviderGitlab() string {
function testAccArgoCDApplicationSet_scmProviderWithFilters (line 2807) | func testAccArgoCDApplicationSet_scmProviderWithFilters() string {
function testAccArgoCDApplicationSet_pullRequestBitbucketServer (line 2873) | func testAccArgoCDApplicationSet_pullRequestBitbucketServer() string {
function testAccArgoCDApplicationSet_pullRequestGitea (line 2930) | func testAccArgoCDApplicationSet_pullRequestGitea() string {
function testAccArgoCDApplicationSet_pullRequestGithub (line 2985) | func testAccArgoCDApplicationSet_pullRequestGithub() string {
function testAccArgoCDApplicationSet_pullRequestGitlab (line 3044) | func testAccArgoCDApplicationSet_pullRequestGitlab() string {
function testAccArgoCDApplicationSet_pullRequestGitlabInsecureAndCARef (line 3102) | func testAccArgoCDApplicationSet_pullRequestGitlabInsecureAndCARef() str...
function testAccArgoCDApplicationSet_pullRequestAzureDevOps (line 3166) | func testAccArgoCDApplicationSet_pullRequestAzureDevOps() string {
function testAccArgoCDApplicationSet_generatorTemplate (line 3222) | func testAccArgoCDApplicationSet_generatorTemplate() string {
function testAccArgoCDApplicationSet_goTemplate (line 3280) | func testAccArgoCDApplicationSet_goTemplate() string {
function testAccArgoCDApplicationSet_syncPolicy (line 3319) | func testAccArgoCDApplicationSet_syncPolicy() string {
function testAccArgoCDApplicationSet_syncPolicyWithApplicationsSync (line 3357) | func testAccArgoCDApplicationSet_syncPolicyWithApplicationsSync() string {
function testAccArgoCDApplicationSet_progressiveSync (line 3396) | func testAccArgoCDApplicationSet_progressiveSync() string {
function testAccArgoCDApplicationSet_templatePatch (line 3496) | func testAccArgoCDApplicationSet_templatePatch() string {
function testAccArgoCDApplicationSetCustomNamespace (line 3552) | func testAccArgoCDApplicationSetCustomNamespace(name string) string {
FILE: argocd/resource_argocd_application_test.go
function TestAccArgoCDApplication (line 14) | func TestAccArgoCDApplication(t *testing.T) {
function TestAccArgoCDApplication_Helm (line 96) | func TestAccArgoCDApplication_Helm(t *testing.T) {
function TestAccArgoCDApplication_Helm_FileParameters (line 163) | func TestAccArgoCDApplication_Helm_FileParameters(t *testing.T) {
function TestAccArgoCDApplication_Kustomize (line 177) | func TestAccArgoCDApplication_Kustomize(t *testing.T) {
function TestAccArgoCDApplication_KustomizePatches (line 215) | func TestAccArgoCDApplication_KustomizePatches(t *testing.T) {
function TestAccArgoCDApplication_IgnoreDifferences (line 278) | func TestAccArgoCDApplication_IgnoreDifferences(t *testing.T) {
function TestAccArgoCDApplication_RevisionHistoryLimit (line 365) | func TestAccArgoCDApplication_RevisionHistoryLimit(t *testing.T) {
function TestAccArgoCDApplication_OptionalDestinationNamespace (line 399) | func TestAccArgoCDApplication_OptionalDestinationNamespace(t *testing.T) {
function TestAccArgoCDApplication_DirectoryJsonnet (line 428) | func TestAccArgoCDApplication_DirectoryJsonnet(t *testing.T) {
function TestAccArgoCDApplication_Recurse (line 513) | func TestAccArgoCDApplication_Recurse(t *testing.T) {
function TestAccArgoCDApplication_EmptyDirectory (line 593) | func TestAccArgoCDApplication_EmptyDirectory(t *testing.T) {
function TestAccArgoCDApplication_DirectoryIncludeExclude (line 619) | func TestAccArgoCDApplication_DirectoryIncludeExclude(t *testing.T) {
function TestAccArgoCDApplication_SyncPolicy (line 651) | func TestAccArgoCDApplication_SyncPolicy(t *testing.T) {
function TestAccArgoCDApplication_NoSyncPolicyBlock (line 711) | func TestAccArgoCDApplication_NoSyncPolicyBlock(t *testing.T) {
function TestAccArgoCDApplication_EmptySyncPolicyBlock (line 737) | func TestAccArgoCDApplication_EmptySyncPolicyBlock(t *testing.T) {
function TestAccArgoCDApplication_NoAutomatedBlock (line 763) | func TestAccArgoCDApplication_NoAutomatedBlock(t *testing.T) {
function TestAccArgoCDApplication_EmptyAutomatedBlock (line 789) | func TestAccArgoCDApplication_EmptyAutomatedBlock(t *testing.T) {
function TestAccArgoCDApplication_OptionalPath (line 815) | func TestAccArgoCDApplication_OptionalPath(t *testing.T) {
function TestAccArgoCDApplication_Info (line 868) | func TestAccArgoCDApplication_Info(t *testing.T) {
function TestAccArgoCDApplication_SkipCrds (line 984) | func TestAccArgoCDApplication_SkipCrds(t *testing.T) {
function TestAccArgoCDApplication_SkipSchemaValidation (line 1037) | func TestAccArgoCDApplication_SkipSchemaValidation(t *testing.T) {
function TestAccArgoCDApplication_CustomNamespace (line 1090) | func TestAccArgoCDApplication_CustomNamespace(t *testing.T) {
function TestAccArgoCDApplication_MultipleSources (line 1116) | func TestAccArgoCDApplication_MultipleSources(t *testing.T) {
function TestAccArgoCDApplication_HelmValuesFromExternalGitRepo (line 1169) | func TestAccArgoCDApplication_HelmValuesFromExternalGitRepo(t *testing.T) {
function TestAccArgoCDApplication_ManagedNamespaceMetadata (line 1221) | func TestAccArgoCDApplication_ManagedNamespaceMetadata(t *testing.T) {
function TestAccArgoCDApplication_Wait (line 1244) | func TestAccArgoCDApplication_Wait(t *testing.T) {
function TestAccArgoCDApplication_Validate (line 1271) | func TestAccArgoCDApplication_Validate(t *testing.T) {
function TestAccArgoCDApplication_Sync (line 1307) | func TestAccArgoCDApplication_Sync(t *testing.T) {
function testAccArgoCDApplicationSync (line 1340) | func testAccArgoCDApplicationSync(name string, sync bool) string {
function testAccArgoCDApplicationSimple (line 1373) | func testAccArgoCDApplicationSimple(name, targetRevision string, wait bo...
function testAccArgoCDApplicationHelm (line 1420) | func testAccArgoCDApplicationHelm(name, helmValues string) string {
function testAccArgoCDApplicationHelm_FileParameters (line 1473) | func testAccArgoCDApplicationHelm_FileParameters(name string) string {
function testAccArgoCDApplicationKustomize (line 1508) | func testAccArgoCDApplicationKustomize(name string, path string, validat...
function testAccArgoCDApplicationKustomizePatches (line 1552) | func testAccArgoCDApplicationKustomizePatches(name string) string {
function testAccArgoCDApplicationDirectoryNoPath (line 1619) | func testAccArgoCDApplicationDirectoryNoPath(name string) string {
function testAccArgoCDApplicationDirectoryPath (line 1645) | func testAccArgoCDApplicationDirectoryPath(name string, path string) str...
function testAccArgoCDApplication_DirectoryJsonnet (line 1672) | func testAccArgoCDApplication_DirectoryJsonnet(name string) string {
function testAccArgoCDApplicationDirectoryImplicitNonRecurse (line 1723) | func testAccArgoCDApplicationDirectoryImplicitNonRecurse(name string) st...
function testAccArgoCDApplicationRecurseDirectory (line 1769) | func testAccArgoCDApplicationRecurseDirectory(name string, recurse bool)...
function testAccArgoCDApplication_EmptyDirectory (line 1799) | func testAccArgoCDApplication_EmptyDirectory(name string) string {
function testAccArgoCDApplication_DirectoryIncludeExclude (line 1827) | func testAccArgoCDApplication_DirectoryIncludeExclude(name string) string {
function testAccArgoCDApplicationSyncPolicy (line 1859) | func testAccArgoCDApplicationSyncPolicy(name string) string {
function testAccArgoCDApplicationIgnoreDifferences (line 1902) | func testAccArgoCDApplicationIgnoreDifferences(name string) string {
function testAccArgoCDApplicationIgnoreDiffJQPathExpressions (line 1945) | func testAccArgoCDApplicationIgnoreDiffJQPathExpressions(name string) st...
function testAccArgoCDApplicationIgnoreDiffManagedFieldsManagers (line 1988) | func testAccArgoCDApplicationIgnoreDiffManagedFieldsManagers(name string...
function testAccArgoCDApplication_OptionalDestinationNamespace (line 2033) | func testAccArgoCDApplication_OptionalDestinationNamespace(name string) ...
function testAccArgoCDApplicationNoSyncPolicy (line 2057) | func testAccArgoCDApplicationNoSyncPolicy(name string) string {
function testAccArgoCDApplicationEmptySyncPolicy (line 2082) | func testAccArgoCDApplicationEmptySyncPolicy(name string) string {
function testAccArgoCDApplicationNoAutomated (line 2109) | func testAccArgoCDApplicationNoAutomated(name string) string {
function testAccArgoCDApplicationEmptyAutomated (line 2144) | func testAccArgoCDApplicationEmptyAutomated(name string) string {
function testAccArgoCDApplicationRevisionHistory (line 2172) | func testAccArgoCDApplicationRevisionHistory(name string, revision_histo...
function testAccArgoCDApplicationInfo (line 2214) | func testAccArgoCDApplicationInfo(name, info, value string) string {
function testAccArgoCDApplicationInfoNoName (line 2245) | func testAccArgoCDApplicationInfoNoName(name, value string) string {
function testAccArgoCDApplicationInfoNoValue (line 2275) | func testAccArgoCDApplicationInfoNoValue(name, info string) string {
function testAccArgoCDApplicationInfoEmpty (line 2305) | func testAccArgoCDApplicationInfoEmpty(name string) string {
function testAccArgoCDApplicationNoInfo (line 2334) | func testAccArgoCDApplicationNoInfo(name string) string {
function testAccArgoCDApplicationSkipCrds (line 2361) | func testAccArgoCDApplicationSkipCrds(name string, SkipCrds bool) string {
function testAccArgoCDApplicationSkipCrds_NoSkip (line 2399) | func testAccArgoCDApplicationSkipCrds_NoSkip(name string) string {
function testAccArgoCDApplicationSkipSchemaValidation (line 2436) | func testAccArgoCDApplicationSkipSchemaValidation(name string, skipSchem...
function testAccArgoCDApplicationSkipSchemaValidation_NoSkip (line 2474) | func testAccArgoCDApplicationSkipSchemaValidation_NoSkip(name string) st...
function testAccArgoCDApplicationCustomNamespace (line 2511) | func testAccArgoCDApplicationCustomNamespace(name string) string {
function testAccArgoCDApplicationMultipleSources (line 2565) | func testAccArgoCDApplicationMultipleSources() string {
function testAccArgoCDApplication_ManagedNamespaceMetadata (line 2619) | func testAccArgoCDApplication_ManagedNamespaceMetadata() string {
function testAccArgoCDApplicationHelmValuesFromExternalGitRepo (line 2656) | func testAccArgoCDApplicationHelmValuesFromExternalGitRepo() string {
FILE: argocd/resource_argocd_cluster.go
function resourceArgoCDCluster (line 13) | func resourceArgoCDCluster() *schema.Resource {
function resourceArgoCDClusterCreate (line 27) | func resourceArgoCDClusterCreate(ctx context.Context, d *schema.Resource...
function resourceArgoCDClusterRead (line 93) | func resourceArgoCDClusterRead(ctx context.Context, d *schema.ResourceDa...
function resourceArgoCDClusterUpdate (line 169) | func resourceArgoCDClusterUpdate(ctx context.Context, d *schema.Resource...
function resourceArgoCDClusterDelete (line 191) | func resourceArgoCDClusterDelete(ctx context.Context, d *schema.Resource...
function getClusterQueryFromID (line 215) | func getClusterQueryFromID(d *schema.ResourceData) *clusterClient.Cluste...
FILE: argocd/resource_argocd_cluster_test.go
function TestAccArgoCDCluster (line 25) | func TestAccArgoCDCluster(t *testing.T) {
function TestAccArgoCDCluster_projectScope (line 88) | func TestAccArgoCDCluster_projectScope(t *testing.T) {
function TestAccArgoCDCluster_optionalName (line 123) | func TestAccArgoCDCluster_optionalName(t *testing.T) {
function TestAccArgoCDCluster_metadata (line 194) | func TestAccArgoCDCluster_metadata(t *testing.T) {
function TestAccArgoCDCluster_invalidSameServer (line 281) | func TestAccArgoCDCluster_invalidSameServer(t *testing.T) {
function TestAccArgoCDCluster_outsideDeletion (line 302) | func TestAccArgoCDCluster_outsideDeletion(t *testing.T) {
function TestAccArgoCDCluster_urlUpdate (line 370) | func TestAccArgoCDCluster_urlUpdate(t *testing.T) {
function TestAccArgoCDCluster_namespacesErrorWhenEmpty (line 422) | func TestAccArgoCDCluster_namespacesErrorWhenEmpty(t *testing.T) {
function testAccArgoCDClusterBearerToken (line 441) | func testAccArgoCDClusterBearerToken(clusterName string) string {
function testAccArgoCDClusterTLSCertificate (line 455) | func testAccArgoCDClusterTLSCertificate(t *testing.T, clusterName string...
function testAccArgoCDClusterProjectScope (line 490) | func testAccArgoCDClusterProjectScope(clusterName, projectName string) s...
function testAccArgoCDClusterMetadata (line 503) | func testAccArgoCDClusterMetadata(clusterName string) string {
function testAccArgoCDClusterMetadataNoName (line 515) | func testAccArgoCDClusterMetadataNoName() string {
function testAccArgoCDClusterTwiceWithSameServer (line 526) | func testAccArgoCDClusterTwiceWithSameServer() string {
function testAccArgoCDClusterTwiceWithSameServerNoNames (line 544) | func testAccArgoCDClusterTwiceWithSameServerNoNames() string {
function testAccArgoCDClusterTwiceWithSameLogicalServer (line 561) | func testAccArgoCDClusterTwiceWithSameLogicalServer() string {
function testAccArgoCDClusterBearerToken_urlChange (line 579) | func testAccArgoCDClusterBearerToken_urlChange(url string) string {
function testAccArgoCDClusterMetadata_addLabels (line 590) | func testAccArgoCDClusterMetadata_addLabels(clusterName string) string {
function testAccArgoCDClusterMetadata_addAnnotations (line 607) | func testAccArgoCDClusterMetadata_addAnnotations(clusterName string) str...
function testAccArgoCDClusterMetadata_removeLabels (line 627) | func testAccArgoCDClusterMetadata_removeLabels(clusterName string) string {
function testAccArgoCDClusterNamespacesContainsEmptyString (line 644) | func testAccArgoCDClusterNamespacesContainsEmptyString(clusterName strin...
function testAccArgoCDClusterNamespacesContainsEmptyString_MultipleItems (line 658) | func testAccArgoCDClusterNamespacesContainsEmptyString_MultipleItems(clu...
function getInternalRestConfig (line 673) | func getInternalRestConfig() (*rest.Config, error) {
function getServerInterface (line 711) | func getServerInterface() (*provider.ServerInterface, error) {
function getConfig (line 735) | func getConfig() string {
function isInsecure (line 760) | func isInsecure() bool {
FILE: argocd/schema_application.go
function applicationSpecSchemaV0 (line 10) | func applicationSpecSchemaV0() *schema.Schema {
function applicationSpecSchemaV1 (line 384) | func applicationSpecSchemaV1() *schema.Schema {
function applicationSpecSchemaV2 (line 794) | func applicationSpecSchemaV2() *schema.Schema {
function applicationSpecSchemaV3 (line 1224) | func applicationSpecSchemaV3() *schema.Schema {
function applicationSpecSchemaV4 (line 1234) | func applicationSpecSchemaV4(allOptional, isAppSet bool) *schema.Schema {
function resourceArgoCDApplicationV0 (line 1890) | func resourceArgoCDApplicationV0() *schema.Resource {
function resourceArgoCDApplicationV1 (line 1899) | func resourceArgoCDApplicationV1() *schema.Resource {
function resourceArgoCDApplicationV2 (line 1908) | func resourceArgoCDApplicationV2() *schema.Resource {
function resourceArgoCDApplicationV3 (line 1917) | func resourceArgoCDApplicationV3() *schema.Resource {
function applicationStatusSchema (line 1926) | func applicationStatusSchema() *schema.Schema {
function resourceApplicationHealthStatus (line 2113) | func resourceApplicationHealthStatus() *schema.Resource {
function resourceArgoCDApplicationStateUpgradeV0 (line 2130) | func resourceArgoCDApplicationStateUpgradeV0(_ context.Context, rawState...
function resourceArgoCDApplicationStateUpgradeV1 (line 2156) | func resourceArgoCDApplicationStateUpgradeV1(_ context.Context, rawState...
function resourceArgoCDApplicationStateUpgradeV2 (line 2179) | func resourceArgoCDApplicationStateUpgradeV2(_ context.Context, rawState...
function resourceArgoCDApplicationStateUpgradeV3 (line 2191) | func resourceArgoCDApplicationStateUpgradeV3(_ context.Context, rawState...
FILE: argocd/schema_application_set.go
constant generatorSchemaLevel (line 10) | generatorSchemaLevel = 3
function applicationSetSpecSchemaV0 (line 12) | func applicationSetSpecSchemaV0() *schema.Schema {
function applicationSetSpecSchemaV1 (line 142) | func applicationSetSpecSchemaV1() *schema.Schema {
function applicationSetGeneratorSchemaV0 (line 151) | func applicationSetGeneratorSchemaV0() *schema.Schema {
function resourceArgoCDApplicationSetStateUpgradeV0 (line 161) | func resourceArgoCDApplicationSetStateUpgradeV0(_ context.Context, rawSt...
function generatorResourceV0 (line 173) | func generatorResourceV0(level int) *schema.Resource {
function applicationSetClustersGeneratorSchemaV0 (line 221) | func applicationSetClustersGeneratorSchemaV0() *schema.Schema {
function applicationSetClusterDecisionResourceGeneratorSchemaV0 (line 261) | func applicationSetClusterDecisionResourceGeneratorSchemaV0() *schema.Sc...
function applicationSetPluginGeneratorSchemaV0 (line 310) | func applicationSetPluginGeneratorSchemaV0() *schema.Schema {
function applicationSetGitGeneratorSchemaV0 (line 361) | func applicationSetGitGeneratorSchemaV0() *schema.Schema {
function applicationSetListGeneratorSchemaV0 (line 440) | func applicationSetListGeneratorSchemaV0() *schema.Schema {
function applicationSetMatrixGeneratorSchemaV0 (line 473) | func applicationSetMatrixGeneratorSchemaV0(level int) *schema.Schema {
function applicationSetMergeGeneratorSchemaV0 (line 500) | func applicationSetMergeGeneratorSchemaV0(level int) *schema.Schema {
function applicationSetSCMProviderGeneratorSchemaV0 (line 532) | func applicationSetSCMProviderGeneratorSchemaV0() *schema.Schema {
function applicationSetPullRequestGeneratorSchemaV0 (line 824) | func applicationSetPullRequestGeneratorSchemaV0() *schema.Schema {
function applicationSetTemplateResource (line 1082) | func applicationSetTemplateResource(allOptional bool) *schema.Resource {
function secretRefResource (line 1130) | func secretRefResource() *schema.Resource {
function configMapRefResource (line 1147) | func configMapRefResource() *schema.Resource {
FILE: argocd/schema_application_test.go
function TestUpgradeSchemaApplication_V0V1_Default_SkipCrds (line 9) | func TestUpgradeSchemaApplication_V0V1_Default_SkipCrds(t *testing.T) {
function TestUpgradeSchemaApplication_V0V1_Default_SkipCrds_NoChange (line 60) | func TestUpgradeSchemaApplication_V0V1_Default_SkipCrds_NoChange(t *test...
function TestUpgradeSchemaApplication_V1V2_Default_NoChange (line 86) | func TestUpgradeSchemaApplication_V1V2_Default_NoChange(t *testing.T) {
function TestUpgradeSchemaApplication_V1V2_WithKsonnet (line 117) | func TestUpgradeSchemaApplication_V1V2_WithKsonnet(t *testing.T) {
function TestUpgradeSchemaApplication_V2V3_Default_NoChange (line 149) | func TestUpgradeSchemaApplication_V2V3_Default_NoChange(t *testing.T) {
function TestUpgradeSchemaApplication_V3V4 (line 185) | func TestUpgradeSchemaApplication_V3V4(t *testing.T) {
FILE: argocd/schema_cluster.go
function clusterSchema (line 9) | func clusterSchema() map[string]*schema.Schema {
FILE: argocd/schema_label_selector.go
function labelSelectorSchema (line 5) | func labelSelectorSchema() map[string]*schema.Schema {
function matchExpressionsSchema (line 16) | func matchExpressionsSchema() *schema.Schema {
FILE: argocd/schema_metadata.go
function metadataSchema (line 9) | func metadataSchema(name string) *schema.Schema {
function metadataFields (line 21) | func metadataFields(objectName string) map[string]*schema.Schema {
FILE: argocd/server_interface.go
type ServerInterface (line 35) | type ServerInterface struct
method InitClients (line 62) | func (si *ServerInterface) InitClients(ctx context.Context) diag.Diagn...
method IsFeatureSupported (line 164) | func (si *ServerInterface) IsFeatureSupported(feature features.Feature...
function NewServerInterface (line 56) | func NewServerInterface(c ArgoCDProviderConfig) *ServerInterface {
function getDefaultString (line 174) | func getDefaultString(s types.String, envKey string) string {
function getDefaultBool (line 182) | func getDefaultBool(ctx context.Context, b types.Bool, envKey string) bo...
FILE: argocd/server_interface_test.go
constant semverEquals (line 15) | semverEquals = iota
constant semverGreater (line 16) | semverGreater
constant semverLess (line 17) | semverLess
function serverInterfaceTestData (line 20) | func serverInterfaceTestData(t *testing.T, argocdVersion string, semverO...
function TestServerInterface_isFeatureSupported (line 54) | func TestServerInterface_isFeatureSupported(t *testing.T) {
FILE: argocd/structure_application.go
function expandApplication (line 15) | func expandApplication(d *schema.ResourceData, featureApplicationSourceN...
function expandApplicationSpec (line 22) | func expandApplicationSpec(s map[string]interface{}, featureApplicationS...
function expandApplicationSource (line 64) | func expandApplicationSource(_ass []interface{}, featureApplicationSourc...
function expandApplicationSourcePlugin (line 124) | func expandApplicationSourcePlugin(in []interface{}) *application.Applic...
function expandApplicationSourceDirectory (line 148) | func expandApplicationSourceDirectory(in interface{}) *application.Appli...
function expandApplicationSourceKustomize (line 210) | func expandApplicationSourceKustomize(in []interface{}) *application.App...
function expandApplicationSourceKustomizePatchTarget (line 277) | func expandApplicationSourceKustomizePatchTarget(in []interface{}) *appl...
function expandApplicationSourceHelm (line 321) | func expandApplicationSourceHelm(in []interface{}) *application.Applicat...
function expandApplicationSyncPolicy (line 407) | func expandApplicationSyncPolicy(sp interface{}) (*application.SyncPolic...
function expandApplicationIgnoreDifferences (line 509) | func expandApplicationIgnoreDifferences(ids []interface{}) (result []app...
function expandApplicationInfo (line 558) | func expandApplicationInfo(infos *schema.Set) (result []application.Info...
function expandApplicationDestination (line 584) | func expandApplicationDestination(dest interface{}) (result application....
function flattenApplication (line 599) | func flattenApplication(app *application.Application, d *schema.Resource...
function flattenApplicationSpec (line 621) | func flattenApplicationSpec(s application.ApplicationSpec) []map[string]...
function flattenApplicationSyncPolicy (line 643) | func flattenApplicationSyncPolicy(sp *application.SyncPolicy) []map[stri...
function flattenApplicationInfo (line 701) | func flattenApplicationInfo(infos []application.Info) (result []map[stri...
function flattenApplicationIgnoreDifferences (line 721) | func flattenApplicationIgnoreDifferences(ids []application.ResourceIgnor...
function flattenApplicationSource (line 737) | func flattenApplicationSource(source []application.ApplicationSource) (r...
function flattenApplicationSourcePlugin (line 756) | func flattenApplicationSourcePlugin(as []*application.ApplicationSourceP...
function flattenApplicationSourceDirectory (line 777) | func flattenApplicationSourceDirectory(as []*application.ApplicationSour...
function flattenApplicationSourceKustomize (line 818) | func flattenApplicationSourceKustomize(as []*application.ApplicationSour...
function flattenApplicationSourceHelm (line 870) | func flattenApplicationSourceHelm(as []*application.ApplicationSourceHel...
function flattenApplicationDestinations (line 908) | func flattenApplicationDestinations(ds []application.ApplicationDestinat...
function flattenApplicationStatus (line 920) | func flattenApplicationStatus(s application.ApplicationStatus) []map[str...
function flattenApplicationConditions (line 940) | func flattenApplicationConditions(aacs []application.ApplicationConditio...
function flattenHealthStatus (line 957) | func flattenHealthStatus(hs application.HealthStatus) []map[string]inter...
function flattenApplicationHealthStatus (line 966) | func flattenApplicationHealthStatus(hs application.AppHealthStatus) []ma...
function flattenApplicationSyncStatus (line 974) | func flattenApplicationSyncStatus(ss application.SyncStatus) []map[strin...
function flattenApplicationResourceStatuses (line 984) | func flattenApplicationResourceStatuses(arss []application.ResourceStatu...
function flattenApplicationSummary (line 1008) | func flattenApplicationSummary(as application.ApplicationSummary) []map[...
function flattenApplicationOperationState (line 1017) | func flattenApplicationOperationState(os application.OperationState) []m...
FILE: argocd/structure_application_set.go
function expandApplicationSet (line 16) | func expandApplicationSet(d *schema.ResourceData, featureMultipleApplica...
function expandApplicationSetSpec (line 23) | func expandApplicationSetSpec(d *schema.ResourceData, featureMultipleApp...
function expandApplicationSetGenerators (line 73) | func expandApplicationSetGenerators(g []interface{}, featureMultipleAppl...
function expandApplicationSetClustersGenerator (line 118) | func expandApplicationSetClustersGenerator(cg interface{}, featureMultip...
function expandApplicationSetClusterDecisionResourceGenerator (line 145) | func expandApplicationSetClusterDecisionResourceGenerator(cdrg interface...
function expandApplicationSetGitGenerator (line 184) | func expandApplicationSetGitGenerator(gg interface{}, featureMultipleApp...
function expandApplicationSetListGenerator (line 248) | func expandApplicationSetListGenerator(lg interface{}, featureMultipleAp...
function expandApplicationSetMatrixGenerator (line 286) | func expandApplicationSetMatrixGenerator(mg interface{}, featureMultiple...
function expandApplicationSetMergeGenerator (line 348) | func expandApplicationSetMergeGenerator(mg interface{}, featureMultipleA...
function expandApplicationSetPluginGenerator (line 416) | func expandApplicationSetPluginGenerator(mg interface{}, featureMultiple...
function expandApplicationSetInputParameters (line 461) | func expandApplicationSetInputParameters(m map[string]interface{}) (appl...
function expandApplicationSetPullRequestGeneratorGenerator (line 480) | func expandApplicationSetPullRequestGeneratorGenerator(mg interface{}, f...
function expandApplicationSetPullRequestGeneratorBitbucketServer (line 524) | func expandApplicationSetPullRequestGeneratorBitbucketServer(bs map[stri...
function expandApplicationSetPullRequestGeneratorGitea (line 546) | func expandApplicationSetPullRequestGeneratorGitea(g map[string]interfac...
function expandApplicationSetPullRequestGeneratorGithub (line 561) | func expandApplicationSetPullRequestGeneratorGithub(g map[string]interfa...
function expandApplicationSetPullRequestGeneratorAzureDevOps (line 582) | func expandApplicationSetPullRequestGeneratorAzureDevOps(ado map[string]...
function expandApplicationSetPullRequestGeneratorGitlab (line 603) | func expandApplicationSetPullRequestGeneratorGitlab(g map[string]interfa...
function expandApplicationSetPullRequestGeneratorFilters (line 631) | func expandApplicationSetPullRequestGeneratorFilters(fs []interface{}) [...
function expandApplicationSetSCMProviderGenerator (line 648) | func expandApplicationSetSCMProviderGenerator(mg interface{}, featureMul...
function expandApplicationSetSCMProviderAzureDevOps (line 696) | func expandApplicationSetSCMProviderAzureDevOps(ado map[string]interface...
function expandApplicationSetSCMProviderBitbucket (line 711) | func expandApplicationSetSCMProviderBitbucket(b map[string]interface{}) ...
function expandApplicationSetSCMProviderBitbucketServer (line 725) | func expandApplicationSetSCMProviderBitbucketServer(bs map[string]interf...
function expandApplicationSetSCMProviderGitea (line 747) | func expandApplicationSetSCMProviderGitea(g map[string]interface{}) *app...
function expandApplicationSetSCMProviderGithub (line 762) | func expandApplicationSetSCMProviderGithub(g map[string]interface{}) *ap...
function expandApplicationSetSCMProviderGitlab (line 777) | func expandApplicationSetSCMProviderGitlab(g map[string]interface{}) *ap...
function expandApplicationSetSCMProviderGeneratorFilters (line 792) | func expandApplicationSetSCMProviderGeneratorFilters(fs []interface{}) [...
function expandApplicationSetStrategy (line 829) | func expandApplicationSetStrategy(sp map[string]interface{}) (*applicati...
function expandApplicationSetRolloutStrategy (line 846) | func expandApplicationSetRolloutStrategy(rs map[string]interface{}) (*ap...
function expandApplicationSetRolloutSteps (line 861) | func expandApplicationSetRolloutSteps(rss []interface{}) ([]application....
function expandApplicationMatchExpressions (line 892) | func expandApplicationMatchExpressions(mes []interface{}) []application....
function expandApplicationSetSyncPolicyApplicationsSyncPolicy (line 907) | func expandApplicationSetSyncPolicyApplicationsSyncPolicy(p string) (asp...
function expandApplicationSetSyncPolicy (line 922) | func expandApplicationSetSyncPolicy(sp map[string]interface{}) (assp *ap...
function expandApplicationSetTemplate (line 937) | func expandApplicationSetTemplate(temp interface{}, featureMultipleAppli...
function expandApplicationSetTemplateMeta (line 973) | func expandApplicationSetTemplateMeta(meta interface{}) (metadata applic...
function expandApplicationSetIgnoreDifferences (line 1006) | func expandApplicationSetIgnoreDifferences(ids []interface{}, featureApp...
function flattenApplicationSet (line 1039) | func flattenApplicationSet(as *application.ApplicationSet, d *schema.Res...
function flattenApplicationSetSpec (line 1059) | func flattenApplicationSetSpec(s application.ApplicationSetSpec) ([]map[...
function flattenApplicationSetIgnoreDifferences (line 1094) | func flattenApplicationSetIgnoreDifferences(ids application.ApplicationS...
function flattenGenerator (line 1105) | func flattenGenerator(g application.ApplicationSetGenerator) (map[string...
function flattenApplicationSetClusterGenerator (line 1155) | func flattenApplicationSetClusterGenerator(c *application.ClusterGenerat...
function flattenApplicationSetClusterDecisionResourceGenerator (line 1166) | func flattenApplicationSetClusterDecisionResourceGenerator(c *applicatio...
function flattenApplicationSetGitGenerator (line 1182) | func flattenApplicationSetGitGenerator(gg *application.GitGenerator) []m...
function flattenApplicationSetListGenerator (line 1221) | func flattenApplicationSetListGenerator(lg *application.ListGenerator) (...
function flattenApplicationSetMatrixGenerator (line 1248) | func flattenApplicationSetMatrixGenerator(mg *application.MatrixGenerato...
function flattenApplicationSetMergeGenerator (line 1268) | func flattenApplicationSetMergeGenerator(mg *application.MergeGenerator)...
function flattenApplicationSetPluginGenerator (line 1289) | func flattenApplicationSetPluginGenerator(plg *application.PluginGenerat...
function flattenApplicationSetPullRequestGenerator (line 1327) | func flattenApplicationSetPullRequestGenerator(prg *application.PullRequ...
function flattenApplicationSetPullRequestGeneratorBitbucketServer (line 1355) | func flattenApplicationSetPullRequestGeneratorBitbucketServer(prgbs *app...
function flattenApplicationSetPullRequestGeneratorGitea (line 1377) | func flattenApplicationSetPullRequestGeneratorGitea(prgg *application.Pu...
function flattenApplicationSetPullRequestGeneratorGithub (line 1392) | func flattenApplicationSetPullRequestGeneratorGithub(prgg *application.P...
function flattenApplicationSetPullRequestGeneratorGitlab (line 1411) | func flattenApplicationSetPullRequestGeneratorGitlab(prgg *application.P...
function flattenApplicationSetPullRequestGeneratorAzureDevOps (line 1434) | func flattenApplicationSetPullRequestGeneratorAzureDevOps(prgado *applic...
function flattenApplicationSetPullRequestGeneratorFilter (line 1453) | func flattenApplicationSetPullRequestGeneratorFilter(spgfs []application...
function flattenApplicationSetSCMProviderGenerator (line 1467) | func flattenApplicationSetSCMProviderGenerator(spg *application.SCMProvi...
function flattenApplicationSetSCMProviderGeneratorAzureDevOps (line 1499) | func flattenApplicationSetSCMProviderGeneratorAzureDevOps(spgado *applic...
function flattenApplicationSetSCMProviderGeneratorBitbucket (line 1514) | func flattenApplicationSetSCMProviderGeneratorBitbucket(spgb *applicatio...
function flattenApplicationSetSCMProviderGeneratorBitbucketServer (line 1528) | func flattenApplicationSetSCMProviderGeneratorBitbucketServer(spgbs *app...
function flattenApplicationSetSCMProviderGeneratorGitea (line 1550) | func flattenApplicationSetSCMProviderGeneratorGitea(spgg *application.SC...
function flattenApplicationSetSCMProviderGeneratorGithub (line 1565) | func flattenApplicationSetSCMProviderGeneratorGithub(spgg *application.S...
function flattenApplicationSetSCMProviderGeneratorGitlab (line 1580) | func flattenApplicationSetSCMProviderGeneratorGitlab(spgg *application.S...
function flattenApplicationSetSCMProviderGeneratorFilter (line 1595) | func flattenApplicationSetSCMProviderGeneratorFilter(spgfs []application...
function flattenNestedGenerator (line 1625) | func flattenNestedGenerator(g application.ApplicationSetNestedGenerator)...
function flattenApplicationSetStrategy (line 1685) | func flattenApplicationSetStrategy(ass application.ApplicationSetStrateg...
function flattenApplicationSetRolloutStrategy (line 1697) | func flattenApplicationSetRolloutStrategy(asrs application.ApplicationSe...
function flattenApplicationSetRolloutSteps (line 1705) | func flattenApplicationSetRolloutSteps(asrss []application.ApplicationSe...
function flattenApplicationMatchExpression (line 1721) | func flattenApplicationMatchExpression(in []application.ApplicationMatch...
function flattenApplicationSetSyncPolicy (line 1735) | func flattenApplicationSetSyncPolicy(assp application.ApplicationSetSync...
function flattenApplicationSetTemplate (line 1744) | func flattenApplicationSetTemplate(ast application.ApplicationSetTemplat...
function flattenApplicationSetTemplateMetadata (line 1766) | func flattenApplicationSetTemplateMetadata(tm application.ApplicationSet...
FILE: argocd/structure_cluster.go
function expandCluster (line 10) | func expandCluster(d *schema.ResourceData) (*application.Cluster, error) {
function expandClusterConfig (line 55) | func expandClusterConfig(config interface{}) application.ClusterConfig {
function flattenCluster (line 133) | func flattenCluster(cluster *application.Cluster, d *schema.ResourceData...
function flattenClusterInfo (line 162) | func flattenClusterInfo(info application.ClusterInfo) []map[string]inter...
function flattenClusterConfig (line 177) | func flattenClusterConfig(config application.ClusterConfig, d *schema.Re...
function flattenClusterConfigTLSClientConfig (line 208) | func flattenClusterConfigTLSClientConfig(tcc application.TLSClientConfig...
function flattenClusterConfigExecProviderConfig (line 238) | func flattenClusterConfigExecProviderConfig(d *schema.ResourceData) []ma...
function flattenClusterMetadata (line 266) | func flattenClusterMetadata(annotations, labels map[string]string) []map...
FILE: argocd/structure_label_selector.go
function flattenLabelSelector (line 8) | func flattenLabelSelector(in *metav1.LabelSelector) []interface{} {
function flattenLabelSelectorRequirement (line 26) | func flattenLabelSelectorRequirement(in []metav1.LabelSelectorRequiremen...
function expandLabelSelector (line 40) | func expandLabelSelector(l []interface{}) metav1.LabelSelector {
function expandLabelSelectorRequirement (line 59) | func expandLabelSelectorRequirement(l []interface{}) []metav1.LabelSelec...
FILE: argocd/structure_metadata.go
function expandMetadata (line 12) | func expandMetadata(d *schema.ResourceData) (meta meta.ObjectMeta) {
function flattenMetadata (line 34) | func flattenMetadata(meta meta.ObjectMeta, d *schema.ResourceData) []int...
function metadataRemoveInternalKeys (line 52) | func metadataRemoveInternalKeys(m map[string]string, d map[string]interf...
function metadataIsInternalKey (line 62) | func metadataIsInternalKey(annotationKey string) bool {
FILE: argocd/structure_metadata_test.go
function TestMetadataIsInternalKey (line 8) | func TestMetadataIsInternalKey(t *testing.T) {
FILE: argocd/structures.go
function expandIntOrString (line 13) | func expandIntOrString(s string) (*intstr.IntOrString, error) {
function expandSecretRef (line 36) | func expandSecretRef(sr map[string]interface{}) *application.SecretRef {
function expandConfigMapKeyRef (line 43) | func expandConfigMapKeyRef(cmr map[string]interface{}) *application.Conf...
function flattenIntOrString (line 50) | func flattenIntOrString(ios *intstr.IntOrString) string {
function flattenSecretRef (line 63) | func flattenSecretRef(sr application.SecretRef) []map[string]interface{} {
function flattenConfigMapKeyRef (line 72) | func flattenConfigMapKeyRef(cmr application.ConfigMapKeyRef) []map[strin...
function newStringSet (line 81) | func newStringSet(f schema.SchemaSetFunc, in []string) *schema.Set {
FILE: argocd/utils.go
function convertStringToInt64 (line 18) | func convertStringToInt64(s string) (i int64, err error) {
function convertInt64ToString (line 23) | func convertInt64ToString(i int64) string {
function convertInt64PointerToString (line 27) | func convertInt64PointerToString(i *int64) string {
function convertStringToInt64Pointer (line 31) | func convertStringToInt64Pointer(s string) (*int64, error) {
function isKeyInMap (line 40) | func isKeyInMap(key string, d map[string]interface{}) bool {
function expandBoolMap (line 54) | func expandBoolMap(m map[string]interface{}) map[string]bool {
function expandStringMap (line 64) | func expandStringMap(m map[string]interface{}) map[string]string {
function expandStringList (line 74) | func expandStringList(l []interface{}) (result []string) {
function sliceOfString (line 82) | func sliceOfString(slice []interface{}) []string {
function isValidPolicyAction (line 92) | func isValidPolicyAction(action string) bool {
function validatePolicy (line 121) | func validatePolicy(project string, role string, policy string) error {
function persistToState (line 175) | func persistToState(key string, data interface{}, d *schema.ResourceData...
function argoCDAPIError (line 183) | func argoCDAPIError(action, resource, id string, err error) diag.Diagnos...
function errorToDiagnostics (line 193) | func errorToDiagnostics(summary string, err error) diag.Diagnostics {
function featureNotSupported (line 206) | func featureNotSupported(feature features.Feature) diag.Diagnostics {
function pluginSDKDiags (line 219) | func pluginSDKDiags(ds fwdiag.Diagnostics) diag.Diagnostics {
FILE: argocd/utils_test.go
function TestValidatePolicy (line 7) | func TestValidatePolicy(t *testing.T) {
FILE: argocd/validators.go
function validateMetadataLabels (line 14) | func validateMetadataLabels(isAppSet bool) func(value interface{}, key s...
function validateMetadataAnnotations (line 41) | func validateMetadataAnnotations(value interface{}, key string) (ws []st...
function validateMetadataName (line 55) | func validateMetadataName(value interface{}, key string) (ws []string, e...
function validateDuration (line 68) | func validateDuration(value interface{}, key string) (ws []string, es []...
function validateIntOrStringPercentage (line 78) | func validateIntOrStringPercentage(value interface{}, key string) (ws []...
FILE: argocd/validators_test.go
function Test_validateMetadataLabels (line 10) | func Test_validateMetadataLabels(t *testing.T) {
FILE: internal/diagnostics/diagnostics.go
function ArgoCDAPIError (line 10) | func ArgoCDAPIError(action, resource, id string, err error) diag.Diagnos...
function Error (line 18) | func Error(summary string, err error) diag.Diagnostics {
function FeatureNotSupported (line 32) | func FeatureNotSupported(f features.Feature) diag.Diagnostics {
FILE: internal/features/features.go
type Feature (line 7) | type Feature
constant ExecLogsPolicy (line 10) | ExecLogsPolicy Feature = iota
constant ProjectSourceNamespaces (line 11) | ProjectSourceNamespaces
constant MultipleApplicationSources (line 12) | MultipleApplicationSources
constant ApplicationSet (line 13) | ApplicationSet
constant ApplicationSetProgressiveSync (line 14) | ApplicationSetProgressiveSync
constant ManagedNamespaceMetadata (line 15) | ManagedNamespaceMetadata
constant ApplicationSetApplicationsSyncPolicy (line 16) | ApplicationSetApplicationsSyncPolicy
constant ApplicationSetIgnoreApplicationDifferences (line 17) | ApplicationSetIgnoreApplicationDifferences
constant ApplicationSetTemplatePatch (line 18) | ApplicationSetTemplatePatch
constant ApplicationKustomizePatches (line 19) | ApplicationKustomizePatches
constant ProjectDestinationServiceAccounts (line 20) | ProjectDestinationServiceAccounts
constant ProjectFineGrainedPolicy (line 21) | ProjectFineGrainedPolicy
constant ApplicationSourceName (line 22) | ApplicationSourceName
constant RepositoryDepth (line 23) | RepositoryDepth
type FeatureConstraint (line 26) | type FeatureConstraint struct
FILE: internal/provider/data_source_application.go
function NewArgoCDApplicationDataSource (line 20) | func NewArgoCDApplicationDataSource() datasource.DataSource {
type applicationDataSource (line 25) | type applicationDataSource struct
method Metadata (line 29) | func (d *applicationDataSource) Metadata(ctx context.Context, req data...
method Schema (line 33) | func (d *applicationDataSource) Schema(ctx context.Context, req dataso...
method Configure (line 49) | func (d *applicationDataSource) Configure(ctx context.Context, req dat...
method Read (line 68) | func (d *applicationDataSource) Read(ctx context.Context, req datasour...
function readApplication (line 94) | func readApplication(ctx context.Context, si *ServerInterface, data *app...
FILE: internal/provider/data_source_application_test.go
function TestAccArgoCDApplicationDataSource (line 11) | func TestAccArgoCDApplicationDataSource(t *testing.T) {
function TestAccArgoCDApplicationDataSource_Directory (line 215) | func TestAccArgoCDApplicationDataSource_Directory(t *testing.T) {
function TestAccArgoCDApplicationDataSource_Helm (line 307) | func TestAccArgoCDApplicationDataSource_Helm(t *testing.T) {
function TestAccArgoCDApplicationDataSource_Kustomize (line 433) | func TestAccArgoCDApplicationDataSource_Kustomize(t *testing.T) {
FILE: internal/provider/model_application.go
type applicationModel (line 15) | type applicationModel struct
type applicationSpec (line 22) | type applicationSpec struct
function applicationSpecSchemaAttribute (line 32) | func applicationSpecSchemaAttribute(allOptional, computed bool) schema.A...
function newApplicationSpec (line 58) | func newApplicationSpec(as v1alpha1.ApplicationSpec) *applicationSpec {
type applicationDestination (line 79) | type applicationDestination struct
function applicationDestinationSchemaAttribute (line 85) | func applicationDestinationSchemaAttribute(computed bool) schema.Attribu...
function newApplicationDestination (line 110) | func newApplicationDestination(ad v1alpha1.ApplicationDestination) appli...
type applicationResourceIgnoreDifferences (line 118) | type applicationResourceIgnoreDifferences struct
function applicationResourceIgnoreDifferencesSchemaAttribute (line 127) | func applicationResourceIgnoreDifferencesSchemaAttribute(computed bool) ...
function newApplicationResourceIgnoreDifferences (line 171) | func newApplicationResourceIgnoreDifferences(diffs []v1alpha1.ResourceIg...
type applicationInfo (line 191) | type applicationInfo struct
function applicationInfoSchemaAttribute (line 196) | func applicationInfoSchemaAttribute(computed bool) schema.Attribute {
function newApplicationInfos (line 218) | func newApplicationInfos(infos []v1alpha1.Info) []applicationInfo {
type applicationSource (line 234) | type applicationSource struct
function applicationSourcesSchemaAttribute (line 247) | func applicationSourcesSchemaAttribute(allOptional, computed bool) schem...
function newApplicationSource (line 295) | func newApplicationSource(as v1alpha1.ApplicationSource) applicationSour...
type applicationSourceDirectory (line 310) | type applicationSourceDirectory struct
function applicationSourceDirectorySchemaAttribute (line 317) | func applicationSourceDirectorySchemaAttribute(computed bool) schema.Att...
function newApplicationSourceDirectory (line 363) | func newApplicationSourceDirectory(ad *v1alpha1.ApplicationSourceDirecto...
type applicationSourceJsonnet (line 376) | type applicationSourceJsonnet struct
function applicationSourceJsonnetSchemaAttribute (line 382) | func applicationSourceJsonnetSchemaAttribute(computed bool) schema.Attri...
function newApplicationSourceJsonnet (line 410) | func newApplicationSourceJsonnet(asj v1alpha1.ApplicationSourceJsonnet) ...
type applicationJsonnetVar (line 418) | type applicationJsonnetVar struct
function applicationJsonnetVarSchemaNestedAttributeObject (line 424) | func applicationJsonnetVarSchemaNestedAttributeObject(computed bool) sch...
function newApplicationJsonnetVars (line 446) | func newApplicationJsonnetVars(jvs []v1alpha1.JsonnetVar) []applicationJ...
type applicationSourceHelm (line 463) | type applicationSourceHelm struct
function applicationSourceHelmSchemaAttribute (line 475) | func applicationSourceHelmSchemaAttribute(computed bool) schema.Attribute {
function newApplicationSourceHelm (line 523) | func newApplicationSourceHelm(ash *v1alpha1.ApplicationSourceHelm) *appl...
type applicationHelmFileParameter (line 541) | type applicationHelmFileParameter struct
function applicationHelmFileParameterSchemaAttribute (line 546) | func applicationHelmFileParameterSchemaAttribute(computed bool) schema.A...
function newApplicationSourceHelmFileParameters (line 568) | func newApplicationSourceHelmFileParameters(hfps []v1alpha1.HelmFilePara...
type applicationHelmParameter (line 584) | type applicationHelmParameter struct
function applicationHelmParameterSchemaAttribute (line 590) | func applicationHelmParameterSchemaAttribute(computed bool) schema.Attri...
function newApplicationSourceHelmParameters (line 617) | func newApplicationSourceHelmParameters(hps []v1alpha1.HelmParameter) []...
type applicationSourceKustomize (line 634) | type applicationSourceKustomize struct
function applicationSourceKustomizeSchemaAttribute (line 643) | func applicationSourceKustomizeSchemaAttribute(computed bool) schema.Att...
function newApplicationSourceKustomize (line 692) | func newApplicationSourceKustomize(ask *v1alpha1.ApplicationSourceKustom...
type applicationSourcePlugin (line 715) | type applicationSourcePlugin struct
function applicationSourcePluginSchemaAttribute (line 721) | func applicationSourcePluginSchemaAttribute(computed bool) schema.Attrib...
function newApplicationSourcePlugin (line 738) | func newApplicationSourcePlugin(asp *v1alpha1.ApplicationSourcePlugin) *...
type applicationEnvEntry (line 750) | type applicationEnvEntry struct
function applicationEnvEntriesSchemaAttribute (line 755) | func applicationEnvEntriesSchemaAttribute(computed bool) schema.Attribute {
function newApplicationEnvEntries (line 777) | func newApplicationEnvEntries(ees []*v1alpha1.EnvEntry) []applicationEnv...
type applicationSourcePluginParameter (line 798) | type applicationSourcePluginParameter struct
function applicationSourcePluginParametersSchemaAttribute (line 805) | func applicationSourcePluginParametersSchemaAttribute(computed bool) sch...
function newApplicationSourcePluginParameters (line 839) | func newApplicationSourcePluginParameters(aspps v1alpha1.ApplicationSour...
type applicationSyncPolicy (line 858) | type applicationSyncPolicy struct
function applicationSyncPolicySchemaAttribute (line 864) | func applicationSyncPolicySchemaAttribute(computed bool) schema.Attribute {
function newApplicationSyncPolicy (line 882) | func newApplicationSyncPolicy(sp *v1alpha1.SyncPolicy) *applicationSyncP...
type applicationSyncPolicyAutomated (line 894) | type applicationSyncPolicyAutomated struct
function applicationSyncPolicyAutomatedSchemaAttribute (line 900) | func applicationSyncPolicyAutomatedSchemaAttribute(computed bool) schema...
function newApplicationSyncPolicyAutomated (line 925) | func newApplicationSyncPolicyAutomated(spa *v1alpha1.SyncPolicyAutomated...
type applicationRetryStrategy (line 937) | type applicationRetryStrategy struct
function applicationRetryStrategySchemaAttribute (line 942) | func applicationRetryStrategySchemaAttribute(computed bool) schema.Attri...
function newApplicationRetryStrategy (line 958) | func newApplicationRetryStrategy(rs *v1alpha1.RetryStrategy) *applicatio...
type applicationBackoff (line 969) | type applicationBackoff struct
function applicationBackoffSchemaAttribute (line 975) | func applicationBackoffSchemaAttribute(computed bool) schema.Attribute {
function newApplicationBackoff (line 1000) | func newApplicationBackoff(b *v1alpha1.Backoff) *applicationBackoff {
type applicationStatus (line 1012) | type applicationStatus struct
function applicationStatusSchemaAttribute (line 1022) | func applicationStatusSchemaAttribute() schema.Attribute {
function newApplicationStatus (line 1041) | func newApplicationStatus(as v1alpha1.ApplicationStatus) *applicationSta...
type applicationCondition (line 1053) | type applicationCondition struct
function applicationConditionSchemaAttribute (line 1059) | func applicationConditionSchemaAttribute() schema.Attribute {
function newApplicationConditions (line 1082) | func newApplicationConditions(acs []v1alpha1.ApplicationCondition) []app...
type applicationHealthStatus (line 1100) | type applicationHealthStatus struct
function applicationHealthStatusSchemaAttribute (line 1105) | func applicationHealthStatusSchemaAttribute() schema.Attribute {
function applicationHealthStatusSchemaAttributes (line 1113) | func applicationHealthStatusSchemaAttributes() map[string]schema.Attribu...
function newHealthStatus (line 1126) | func newHealthStatus(hs *v1alpha1.HealthStatus) *applicationHealthStatus {
function newApplicationHealthStatus (line 1137) | func newApplicationHealthStatus(hs *v1alpha1.AppHealthStatus) *applicati...
type applicationOperationState (line 1147) | type applicationOperationState struct
function applicationOperationStateSchemaAttribute (line 1155) | func applicationOperationStateSchemaAttribute() schema.Attribute {
function newApplicationOperationState (line 1184) | func newApplicationOperationState(os *v1alpha1.OperationState) *applicat...
type applicationResourceStatus (line 1198) | type applicationResourceStatus struct
function applicationResourceStatusSchemaAttribute (line 1211) | func applicationResourceStatusSchemaAttribute() schema.Attribute {
function newApplicationResourceStatuses (line 1263) | func newApplicationResourceStatuses(rss []v1alpha1.ResourceStatus) []app...
type applicationSummary (line 1288) | type applicationSummary struct
function applicationSummarySchemaAttribute (line 1293) | func applicationSummarySchemaAttribute() schema.Attribute {
function newApplicationSummary (line 1312) | func newApplicationSummary(as v1alpha1.ApplicationSummary) applicationSu...
type applicationSyncStatus (line 1319) | type applicationSyncStatus struct
function applicationSyncStatusSchemaAttribute (line 1324) | func applicationSyncStatusSchemaAttribute() schema.Attribute {
function newApplicationSyncStatus (line 1342) | func newApplicationSyncStatus(ss v1alpha1.SyncStatus) applicationSyncSta...
FILE: internal/provider/model_gpg_key.go
type gpgKeyModel (line 12) | type gpgKeyModel struct
function gpgKeySchemaAttributes (line 21) | func gpgKeySchemaAttributes() map[string]schema.Attribute {
function newGPGKey (line 54) | func newGPGKey(k *v1alpha1.GnuPGPublicKey) *gpgKeyModel {
FILE: internal/provider/model_metadata.go
type objectMeta (line 18) | type objectMeta struct
function objectMetaSchemaAttribute (line 28) | func objectMetaSchemaAttribute(objectName string, computed bool) schema....
function objectMetaSchemaListBlock (line 97) | func objectMetaSchemaListBlock(objectName string) schema.Block {
function newObjectMeta (line 170) | func newObjectMeta(om metav1.ObjectMeta) objectMeta {
FILE: internal/provider/model_project.go
type projectModel (line 13) | type projectModel struct
type projectSpecModel (line 19) | type projectSpecModel struct
type groupKindModel (line 35) | type groupKindModel struct
type destinationModel (line 40) | type destinationModel struct
type destinationServiceAccountModel (line 46) | type destinationServiceAccountModel struct
type orphanedResourcesModel (line 52) | type orphanedResourcesModel struct
type orphanedResourcesIgnoreModel (line 57) | type orphanedResourcesIgnoreModel struct
type projectRoleModel (line 63) | type projectRoleModel struct
type jwtTokenModel (line 71) | type jwtTokenModel struct
type syncWindowModel (line 77) | type syncWindowModel struct
function projectSchemaBlocks (line 89) | func projectSchemaBlocks() map[string]schema.Block {
function projectSpecSchemaBlocks (line 107) | func projectSpecSchemaBlocks() map[string]schema.Block {
function projectSpecSchemaAttributesOnly (line 362) | func projectSpecSchemaAttributesOnly() map[string]schema.Attribute {
function newProject (line 386) | func newProject(project *v1alpha1.AppProject) *projectModel {
function newProjectSpec (line 395) | func newProjectSpec(spec *v1alpha1.AppProjectSpec) projectSpecModel {
FILE: internal/provider/model_project_token.go
type projectTokenModel (line 12) | type projectTokenModel struct
function projectTokenSchemaAttributes (line 25) | func projectTokenSchemaAttributes() map[string]schema.Attribute {
FILE: internal/provider/model_provider.go
type ArgoCDProviderConfig (line 24) | type ArgoCDProviderConfig struct
method getApiClientOptions (line 56) | func (p ArgoCDProviderConfig) getApiClientOptions(ctx context.Context)...
method setCoreOpts (line 163) | func (p ArgoCDProviderConfig) setCoreOpts(opts *apiclient.ClientOption...
method setLocalConfigOpts (line 183) | func (p ArgoCDProviderConfig) setLocalConfigOpts(opts *apiclient.Clien...
method setPortForwardingOpts (line 227) | func (p ArgoCDProviderConfig) setPortForwardingOpts(ctx context.Contex...
type Kubernetes (line 322) | type Kubernetes struct
type KubernetesExec (line 337) | type KubernetesExec struct
FILE: internal/provider/model_repository.go
type repositoryModel (line 19) | type repositoryModel struct
method toAPIModel (line 179) | func (m *repositoryModel) toAPIModel() (*v1alpha1.Repository, error) {
method updateFromAPI (line 226) | func (m *repositoryModel) updateFromAPI(repo *v1alpha1.Repository) *re...
function repositorySchemaAttributes (line 46) | func repositorySchemaAttributes() map[string]schema.Attribute {
FILE: internal/provider/model_repository_certificate.go
type repositoryCertificateModel (line 11) | type repositoryCertificateModel struct
method toAPIModel (line 106) | func (m *repositoryCertificateModel) toAPIModel() *v1alpha1.Repository...
method generateID (line 125) | func (m *repositoryCertificateModel) generateID() string {
type repositoryCertificateSSHModel (line 17) | type repositoryCertificateSSHModel struct
type repositoryCertificateHTTPSModel (line 24) | type repositoryCertificateHTTPSModel struct
function repositoryCertificateSchemaAttributes (line 31) | func repositoryCertificateSchemaAttributes() map[string]schema.Attribute {
function repositoryCertificateSchemaBlocks (line 40) | func repositoryCertificateSchemaBlocks() map[string]schema.Block {
FILE: internal/provider/model_repository_credentials.go
type repositoryCredentialsModel (line 18) | type repositoryCredentialsModel struct
method toAPIModel (line 127) | func (m *repositoryCredentialsModel) toAPIModel() (*v1alpha1.RepoCreds...
function repositoryCredentialsSchemaAttributes (line 35) | func repositoryCredentialsSchemaAttributes() map[string]schema.Attribute {
FILE: internal/provider/planmodifiers.go
function UseUnknownOnUpdateString (line 19) | func UseUnknownOnUpdateString() planmodifier.String {
type useUnknownOnUpdateStringModifier (line 23) | type useUnknownOnUpdateStringModifier struct
method Description (line 25) | func (m useUnknownOnUpdateStringModifier) Description(_ context.Contex...
method MarkdownDescription (line 29) | func (m useUnknownOnUpdateStringModifier) MarkdownDescription(_ contex...
method PlanModifyString (line 33) | func (m useUnknownOnUpdateStringModifier) PlanModifyString(_ context.C...
function UseUnknownOnUpdateInt64 (line 58) | func UseUnknownOnUpdateInt64() planmodifier.Int64 {
type useUnknownOnUpdateInt64Modifier (line 62) | type useUnknownOnUpdateInt64Modifier struct
method Description (line 64) | func (m useUnknownOnUpdateInt64Modifier) Description(_ context.Context...
method MarkdownDescription (line 68) | func (m useUnknownOnUpdateInt64Modifier) MarkdownDescription(_ context...
method PlanModifyInt64 (line 72) | func (m useUnknownOnUpdateInt64Modifier) PlanModifyInt64(_ context.Con...
FILE: internal/provider/provider.go
type ArgoCDProvider (line 20) | type ArgoCDProvider struct
method Metadata (line 33) | func (p *ArgoCDProvider) Metadata(_ context.Context, _ provider.Metada...
method Schema (line 37) | func (p *ArgoCDProvider) Schema(ctx context.Context, req provider.Sche...
method ConfigValidators (line 219) | func (p *ArgoCDProvider) ConfigValidators(ctx context.Context) []provi...
method Configure (line 239) | func (p *ArgoCDProvider) Configure(ctx context.Context, req provider.C...
method Resources (line 255) | func (p *ArgoCDProvider) Resources(context.Context) []func() resource....
method DataSources (line 266) | func (p *ArgoCDProvider) DataSources(context.Context) []func() datasou...
function New (line 27) | func New(version string) provider.Provider {
FILE: internal/provider/provider_test.go
function TestMain (line 51) | func TestMain(m *testing.M) {
function TestProvider_headers (line 55) | func TestProvider_headers(t *testing.T) {
function testAccPreCheck (line 74) | func testAccPreCheck(t *testing.T) {
function testAccPreCheckFeatureSupported (line 93) | func testAccPreCheckFeatureSupported(t *testing.T, feature features.Feat...
function testAccPreCheckFeatureNotSupported (line 115) | func testAccPreCheckFeatureNotSupported(t *testing.T, feature features.F...
FILE: internal/provider/resource_gpg_key.go
function NewGPGKeyResource (line 22) | func NewGPGKeyResource() resource.Resource {
type gpgKeyResource (line 27) | type gpgKeyResource struct
method Metadata (line 31) | func (r *gpgKeyResource) Metadata(ctx context.Context, req resource.Me...
method Schema (line 35) | func (r *gpgKeyResource) Schema(ctx context.Context, req resource.Sche...
method Configure (line 42) | func (r *gpgKeyResource) Configure(ctx context.Context, req resource.C...
method Create (line 61) | func (r *gpgKeyResource) Create(ctx context.Context, req resource.Crea...
method Read (line 100) | func (r *gpgKeyResource) Read(ctx context.Context, req resource.ReadRe...
method Update (line 122) | func (r *gpgKeyResource) Update(ctx context.Context, req resource.Upda...
method Delete (line 147) | func (r *gpgKeyResource) Delete(ctx context.Context, req resource.Dele...
method ImportState (line 177) | func (r *gpgKeyResource) ImportState(ctx context.Context, req resource...
function readGPGKey (line 181) | func readGPGKey(ctx context.Context, si *ServerInterface, id string) (*g...
FILE: internal/provider/resource_gpg_key_test.go
function TestAccArgoCDGPGKeyResource (line 10) | func TestAccArgoCDGPGKeyResource(t *testing.T) {
function TestAccArgoCDGPGKeyResource_Invalid_NotAGPGKey (line 117) | func TestAccArgoCDGPGKeyResource_Invalid_NotAGPGKey(t *testing.T) {
FILE: internal/provider/resource_project.go
function NewProjectResource (line 25) | func NewProjectResource() resource.Resource {
type projectResource (line 29) | type projectResource struct
method Metadata (line 33) | func (r *projectResource) Metadata(ctx context.Context, req resource.M...
method Schema (line 37) | func (r *projectResource) Schema(ctx context.Context, req resource.Sch...
method Configure (line 51) | func (r *projectResource) Configure(ctx context.Context, req resource....
method Create (line 70) | func (r *projectResource) Create(ctx context.Context, req resource.Cre...
method Read (line 234) | func (r *projectResource) Read(ctx context.Context, req resource.ReadR...
method readUnsafe (line 255) | func (r *projectResource) readUnsafe(ctx context.Context, data project...
method Update (line 305) | func (r *projectResource) Update(ctx context.Context, req resource.Upd...
method Delete (line 423) | func (r *projectResource) Delete(ctx context.Context, req resource.Del...
method ImportState (line 464) | func (r *projectResource) ImportState(ctx context.Context, req resourc...
function preserveEmptyLists (line 175) | func preserveEmptyLists(sourceModel, apiModel *projectSpecModel) {
function expandProject (line 498) | func expandProject(ctx context.Context, data *projectModel) (metav1.Obje...
function expandProjectRoles (line 721) | func expandProjectRoles(_ context.Context, roles []projectRoleModel) []v...
FILE: internal/provider/resource_project_test.go
function TestAccArgoCDProject (line 14) | func TestAccArgoCDProject(t *testing.T) {
function TestAccArgoCDProject_tokensCoexistence (line 104) | func TestAccArgoCDProject_tokensCoexistence(t *testing.T) {
function TestAccArgoCDProjectUpdateAddRole (line 149) | func TestAccArgoCDProjectUpdateAddRole(t *testing.T) {
function TestAccArgoCDProjectWithClustersRepositoriesRolePolicy (line 183) | func TestAccArgoCDProjectWithClustersRepositoriesRolePolicy(t *testing.T) {
function TestAccArgoCDProjectWithLogsExecRolePolicy (line 208) | func TestAccArgoCDProjectWithLogsExecRolePolicy(t *testing.T) {
function TestAccArgoCDProjectWithSourceNamespaces (line 233) | func TestAccArgoCDProjectWithSourceNamespaces(t *testing.T) {
function TestAccArgoCDProjectWithDestinationServiceAccounts (line 258) | func TestAccArgoCDProjectWithDestinationServiceAccounts(t *testing.T) {
function TestAccArgoCDProjectWithFineGrainedPolicy (line 296) | func TestAccArgoCDProjectWithFineGrainedPolicy(t *testing.T) {
function TestAccArgoCDProjectWithAppsInAnyNSPolicy (line 321) | func TestAccArgoCDProjectWithAppsInAnyNSPolicy(t *testing.T) {
function testAccArgoCDProjectSimple (line 346) | func testAccArgoCDProjectSimple(name string) string {
function testAccArgoCDProjectSimpleWithoutOrphaned (line 443) | func testAccArgoCDProjectSimpleWithoutOrphaned(name string) string {
function testAccArgoCDProjectSimpleWithEmptyOrphaned (line 470) | func testAccArgoCDProjectSimpleWithEmptyOrphaned(name string) string {
function testAccArgoCDProjectCoexistenceWithTokenResource (line 498) | func testAccArgoCDProjectCoexistenceWithTokenResource(name string, count...
function testAccArgoCDProjectPolicyError (line 535) | func testAccArgoCDProjectPolicyError(name string) string {
function testAccArgoCDProjectRoleNameError (line 561) | func testAccArgoCDProjectRoleNameError(name string) string {
function testAccArgoCDProjectSyncWindowScheduleError (line 587) | func testAccArgoCDProjectSyncWindowScheduleError(name string) string {
function testAccArgoCDProjectSyncWindowDurationError (line 622) | func testAccArgoCDProjectSyncWindowDurationError(name string) string {
function testAccArgoCDProjectSyncWindowKindError (line 657) | func testAccArgoCDProjectSyncWindowKindError(name string) string {
function testAccArgoCDProjectSimpleWithoutRole (line 692) | func testAccArgoCDProjectSimpleWithoutRole(name string) string {
function testAccArgoCDProjectSimpleWithRole (line 727) | func testAccArgoCDProjectSimpleWithRole(name string) string {
function testAccArgoCDProjectWithClustersRepositoriesRolePolicy (line 769) | func testAccArgoCDProjectWithClustersRepositoriesRolePolicy(name string)...
function testAccArgoCDProjectWithExecLogsRolePolicy (line 811) | func testAccArgoCDProjectWithExecLogsRolePolicy(name string) string {
function testAccArgoCDProjectWithSourceNamespaces (line 853) | func testAccArgoCDProjectWithSourceNamespaces(name string) string {
function testAccArgoCDProjectSyncWindowTimezoneError (line 893) | func testAccArgoCDProjectSyncWindowTimezoneError(name string) string {
function testAccArgoCDProjectWithDestinationServiceAccounts (line 929) | func testAccArgoCDProjectWithDestinationServiceAccounts(name string) str...
function TestAccArgoCDProject_MetadataFieldsConsistency (line 971) | func TestAccArgoCDProject_MetadataFieldsConsistency(t *testing.T) {
function TestAccArgoCDProject_RolesConsistency (line 1060) | func TestAccArgoCDProject_RolesConsistency(t *testing.T) {
function TestAccArgoCDProject_SyncWindowsConsistency (line 1157) | func TestAccArgoCDProject_SyncWindowsConsistency(t *testing.T) {
function TestAccArgoCDProject_OrphanedResourcesConsistency (line 1269) | func TestAccArgoCDProject_OrphanedResourcesConsistency(t *testing.T) {
function testAccArgoCDProjectWithFineGrainedPolicy (line 1353) | func testAccArgoCDProjectWithFineGrainedPolicy(name string) string {
function testAccArgoCDProjectWithAppsInAnyNSPolicy (line 1385) | func testAccArgoCDProjectWithAppsInAnyNSPolicy(name string) string {
function TestAccArgoCDProject_ProviderUpgradeStateMigration (line 1420) | func TestAccArgoCDProject_ProviderUpgradeStateMigration(t *testing.T) {
function testAccArgoCDProjectForStateMigration (line 1466) | func testAccArgoCDProjectForStateMigration(name string) string {
function TestAccArgoCDProject_ProviderUpgradeStateMigration_WithoutNamespace (line 1549) | func TestAccArgoCDProject_ProviderUpgradeStateMigration_WithoutNamespace...
function testAccArgoCDProjectForStateMigrationWithoutNamespace (line 1598) | func testAccArgoCDProjectForStateMigrationWithoutNamespace(name string) ...
function TestAccArgoCDProject_EmptySourceRepos (line 1626) | func TestAccArgoCDProject_EmptySourceRepos(t *testing.T) {
function testAccArgoCDProjectWithEmptySourceRepos (line 1654) | func testAccArgoCDProjectWithEmptySourceRepos(name string) string {
function TestAccArgoCDProject_EmptyRoleGroups (line 1677) | func TestAccArgoCDProject_EmptyRoleGroups(t *testing.T) {
function testAccArgoCDProjectWithEmptyRoleGroups (line 1705) | func testAccArgoCDProjectWithEmptyRoleGroups(name string) string {
function TestAccArgoCDProject_EmptyListsComprehensive (line 1734) | func TestAccArgoCDProject_EmptyListsComprehensive(t *testing.T) {
function testAccArgoCDProjectWithMultipleEmptyLists (line 1771) | func testAccArgoCDProjectWithMultipleEmptyLists(name string) string {
function TestAccArgoCDProject_MetadataComputedFieldsOnUpdate (line 1813) | func TestAccArgoCDProject_MetadataComputedFieldsOnUpdate(t *testing.T) {
function TestAccArgoCDProject_MultipleSpecUpdates (line 1940) | func TestAccArgoCDProject_MultipleSpecUpdates(t *testing.T) {
function TestAccArgoCDProject_UnknownAnnotationValues (line 2070) | func TestAccArgoCDProject_UnknownAnnotationValues(t *testing.T) {
function testAccArgoCDProjectWithUnknownAnnotation (line 2115) | func testAccArgoCDProjectWithUnknownAnnotation(name, value string) string {
FILE: internal/provider/resource_project_token.go
function NewProjectTokenResource (line 26) | func NewProjectTokenResource() resource.Resource {
type projectTokenResource (line 30) | type projectTokenResource struct
method Metadata (line 34) | func (r *projectTokenResource) Metadata(ctx context.Context, req resou...
method Schema (line 38) | func (r *projectTokenResource) Schema(ctx context.Context, req resourc...
method Configure (line 45) | func (r *projectTokenResource) Configure(ctx context.Context, req reso...
method ModifyPlan (line 64) | func (r *projectTokenResource) ModifyPlan(ctx context.Context, req res...
method Create (line 153) | func (r *projectTokenResource) Create(ctx context.Context, req resourc...
method Read (line 294) | func (r *projectTokenResource) Read(ctx context.Context, req resource....
method Update (line 351) | func (r *projectTokenResource) Update(ctx context.Context, req resourc...
method Delete (line 438) | func (r *projectTokenResource) Delete(ctx context.Context, req resourc...
method ImportState (line 473) | func (r *projectTokenResource) ImportState(ctx context.Context, req re...
FILE: internal/provider/resource_project_token_test.go
function TestAccArgoCDProjectToken (line 17) | func TestAccArgoCDProjectToken(t *testing.T) {
function TestAccArgoCDProjectToken_RenewBefore (line 76) | func TestAccArgoCDProjectToken_RenewBefore(t *testing.T) {
function TestAccArgoCDProjectToken_RenewAfter (line 112) | func TestAccArgoCDProjectToken_RenewAfter(t *testing.T) {
function testAccArgoCDProjectTokenSimple (line 144) | func testAccArgoCDProjectTokenSimple() string {
function testAccArgoCDProjectTokenExpiry (line 153) | func testAccArgoCDProjectTokenExpiry(expiresIn int64) string {
function testAccArgoCDProjectTokenMultiple (line 163) | func testAccArgoCDProjectTokenMultiple(count int) string {
function testAccArgoCDProjectTokenRenewBeforeSuccess (line 192) | func testAccArgoCDProjectTokenRenewBeforeSuccess(expiresIn, renewBefore ...
function testAccArgoCDProjectTokenRenewBeforeFailure (line 203) | func testAccArgoCDProjectTokenRenewBeforeFailure(expiresInDuration time....
function testAccArgoCDProjectTokenRenewAfter (line 217) | func testAccArgoCDProjectTokenRenewAfter(renewAfter int) string {
function testCheckTokenIssuedAt (line 228) | func testCheckTokenIssuedAt(resourceName string) resource.TestCheckFunc {
function testCheckTokenExpiresAt (line 253) | func testCheckTokenExpiresAt(resourceName string, expiresIn int64) resou...
function testTokenIssuedAtSet (line 292) | func testTokenIssuedAtSet(name string, count int) resource.TestCheckFunc {
function testDelay (line 319) | func testDelay(seconds int) resource.TestCheckFunc {
function TestAccArgoCDProjectToken_BasicFieldsConsistency (line 327) | func TestAccArgoCDProjectToken_BasicFieldsConsistency(t *testing.T) {
function TestAccArgoCDProjectToken_ExpiryFieldsConsistency (line 394) | func TestAccArgoCDProjectToken_ExpiryFieldsConsistency(t *testing.T) {
function TestAccArgoCDProjectToken_RenewFieldsConsistency (line 449) | func TestAccArgoCDProjectToken_RenewFieldsConsistency(t *testing.T) {
function TestAccArgoCDProjectToken_RenewAfterConsistency (line 507) | func TestAccArgoCDProjectToken_RenewAfterConsistency(t *testing.T) {
function convertStringToInt64 (line 576) | func convertStringToInt64(s string) (i int64, err error) {
function TestAccArgoCDProjectToken_ProviderUpgradeStateMigration (line 584) | func TestAccArgoCDProjectToken_ProviderUpgradeStateMigration(t *testing....
function testAccArgoCDProjectTokenForStateMigration (line 633) | func testAccArgoCDProjectTokenForStateMigration() string {
FILE: internal/provider/resource_repository.go
function NewRepositoryResource (line 27) | func NewRepositoryResource() resource.Resource {
type repositoryResource (line 32) | type repositoryResource struct
method Metadata (line 36) | func (r *repositoryResource) Metadata(ctx context.Context, req resourc...
method Schema (line 40) | func (r *repositoryResource) Schema(ctx context.Context, req resource....
method Configure (line 47) | func (r *repositoryResource) Configure(ctx context.Context, req resour...
method Create (line 66) | func (r *repositoryResource) Create(ctx context.Context, req resource....
method Read (line 150) | func (r *repositoryResource) Read(ctx context.Context, req resource.Re...
method Update (line 182) | func (r *repositoryResource) Update(ctx context.Context, req resource....
method Delete (line 254) | func (r *repositoryResource) Delete(ctx context.Context, req resource....
method ImportState (line 290) | func (r *repositoryResource) ImportState(ctx context.Context, req reso...
method readRepository (line 307) | func (r *repositoryResource) readRepository(ctx context.Context, repoU...
FILE: internal/provider/resource_repository_certificate.go
constant sshCertType (line 21) | sshCertType = "ssh"
function NewRepositoryCertificateResource (line 28) | func NewRepositoryCertificateResource() resource.Resource {
type repositoryCertificateResource (line 33) | type repositoryCertificateResource struct
method Metadata (line 37) | func (r *repositoryCertificateResource) Metadata(ctx context.Context, ...
method Schema (line 41) | func (r *repositoryCertificateResource) Schema(ctx context.Context, re...
method ConfigValidators (line 49) | func (r *repositoryCertificateResource) ConfigValidators(ctx context.C...
method Configure (line 55) | func (r *repositoryCertificateResource) Configure(ctx context.Context,...
method Create (line 74) | func (r *repositoryCertificateResource) Create(ctx context.Context, re...
method Read (line 178) | func (r *repositoryCertificateResource) Read(ctx context.Context, req ...
method Update (line 231) | func (r *repositoryCertificateResource) Update(ctx context.Context, re...
method Delete (line 239) | func (r *repositoryCertificateResource) Delete(ctx context.Context, re...
method ImportState (line 281) | func (r *repositoryCertificateResource) ImportState(ctx context.Contex...
method readCertificate (line 285) | func (r *repositoryCertificateResource) readCertificate(ctx context.Co...
method parseID (line 321) | func (r *repositoryCertificateResource) parseID(id string) (certType, ...
method generateID (line 346) | func (r *repositoryCertificateResource) generateID(certType, certSubTy...
method generateIDFromCert (line 354) | func (r *repositoryCertificateResource) generateIDFromCert(cert *v1alp...
FILE: internal/provider/resource_repository_certificate_test.go
function TestAccArgoCDRepositoryCertificatesSSH (line 17) | func TestAccArgoCDRepositoryCertificatesSSH(t *testing.T) {
function TestAccArgoCDRepositoryCertificatesHttps (line 76) | func TestAccArgoCDRepositoryCertificatesHttps(t *testing.T) {
function TestAccArgoCDRepositoryCertificatesHttps_Crash (line 111) | func TestAccArgoCDRepositoryCertificatesHttps_Crash(t *testing.T) {
function TestAccArgoCDRepositoryCertificatesSSH_Invalid (line 146) | func TestAccArgoCDRepositoryCertificatesSSH_Invalid(t *testing.T) {
function TestAccArgoCDRepositoryCertificates_Empty (line 174) | func TestAccArgoCDRepositoryCertificates_Empty(t *testing.T) {
function TestAccArgoCDRepositoryCertificatesSSH_Allow_Random_Subtype (line 187) | func TestAccArgoCDRepositoryCertificatesSSH_Allow_Random_Subtype(t *test...
function TestAccArgoCDRepositoryCertificatesSSH_WithApplication (line 205) | func TestAccArgoCDRepositoryCertificatesSSH_WithApplication(t *testing.T) {
function TestAccArgoCDRepositoryCertificatesSSH_CannotUpdateExisting (line 238) | func TestAccArgoCDRepositoryCertificatesSSH_CannotUpdateExisting(t *test...
function TestAccArgoCDRepositoryCertificatesSSH_CannotUpdateExisting_MultipleAtOnce (line 256) | func TestAccArgoCDRepositoryCertificatesSSH_CannotUpdateExisting_Multipl...
function TestAccArgoCDRepositoryCertificatesHttps_CannotUpdateExisting_MultipleAtOnce (line 274) | func TestAccArgoCDRepositoryCertificatesHttps_CannotUpdateExisting_Multi...
function testAccArgoCDRepositoryCertificates_Empty (line 293) | func testAccArgoCDRepositoryCertificates_Empty() string {
function testAccArgoCDRepositoryCertificatesSSH (line 300) | func testAccArgoCDRepositoryCertificatesSSH(serverName, cert_subtype, ce...
function testAccArgoCDRepositoryCertificateSSH_Duplicated (line 314) | func testAccArgoCDRepositoryCertificateSSH_Duplicated(serverName, cert_s...
function testAccArgoCDRepositoryCertificateHttps (line 338) | func testAccArgoCDRepositoryCertificateHttps(serverName, cert_data strin...
function testAccArgoCDRepositoryCertificateHttps_Duplicated (line 351) | func testAccArgoCDRepositoryCertificateHttps_Duplicated(serverName, cert...
function testAccArgoCDRepositoryCertificateCredentialsApplicationWithSSH (line 373) | func testAccArgoCDRepositoryCertificateCredentialsApplicationWithSSH(ran...
function getSshKeysForHost (line 450) | func getSshKeysForHost(ctx context.Context, host string) ([]string, erro...
function TestAccArgoCDRepositoryCertificate_SSHConsistency (line 496) | func TestAccArgoCDRepositoryCertificate_SSHConsistency(t *testing.T) {
function TestAccArgoCDRepositoryCertificate_HTTPSConsistency (line 553) | func TestAccArgoCDRepositoryCertificate_HTTPSConsistency(t *testing.T) {
FILE: internal/provider/resource_repository_credentials.go
function NewRepositoryCredentialsResource (line 25) | func NewRepositoryCredentialsResource() resource.Resource {
type repositoryCredentialsResource (line 30) | type repositoryCredentialsResource struct
method Metadata (line 34) | func (r *repositoryCredentialsResource) Metadata(ctx context.Context, ...
method Schema (line 38) | func (r *repositoryCredentialsResource) Schema(ctx context.Context, re...
method Configure (line 48) | func (r *repositoryCredentialsResource) Configure(ctx context.Context,...
method Create (line 67) | func (r *repositoryCredentialsResource) Create(ctx context.Context, re...
method Read (line 161) | func (r *repositoryCredentialsResource) Read(ctx context.Context, req ...
method Update (line 247) | func (r *repositoryCredentialsResource) Update(ctx context.Context, re...
method Delete (line 338) | func (r *repositoryCredentialsResource) Delete(ctx context.Context, re...
method ImportState (line 370) | func (r *repositoryCredentialsResource) ImportState(ctx context.Contex...
method readRepositoryCredentials (line 374) | func (r *repositoryCredentialsResource) readRepositoryCredentials(ctx ...
FILE: internal/provider/resource_repository_credentials_test.go
function TestAccArgoCDRepositoryCredentials (line 17) | func TestAccArgoCDRepositoryCredentials(t *testing.T) {
function TestAccArgoCDRepositoryCredentials_UseAzureWorkloadIdentity (line 69) | func TestAccArgoCDRepositoryCredentials_UseAzureWorkloadIdentity(t *test...
function testAccArgoCDRepositoryCredentialsUseAzureWorkloadIdentity (line 90) | func testAccArgoCDRepositoryCredentialsUseAzureWorkloadIdentity(repoUrl ...
function TestAccArgoCDRepositoryCredentials_GitHubApp (line 99) | func TestAccArgoCDRepositoryCredentials_GitHubApp(t *testing.T) {
function testAccArgoCDRepositoryCredentialsSimple (line 137) | func testAccArgoCDRepositoryCredentialsSimple(repoUrl string) string {
function testAccArgoCDRepositoryCredentialsSSH (line 145) | func testAccArgoCDRepositoryCredentialsSSH(repoUrl, username, sshPrivate...
function testAccArgoCDRepositoryCredentialsRepositoryCoexistence (line 157) | func testAccArgoCDRepositoryCredentialsRepositoryCoexistence() string {
function testAccArgoCDRepositoryCredentialsGitHubApp (line 174) | func testAccArgoCDRepositoryCredentialsGitHubApp(repoUrl, id, installID,...
function generateSSHPrivateKey (line 188) | func generateSSHPrivateKey() (privateKey string, err error) {
function TestAccArgoCDRepositoryCredentials_UsernamePasswordConsistency (line 209) | func TestAccArgoCDRepositoryCredentials_UsernamePasswordConsistency(t *t...
function TestAccArgoCDRepositoryCredentials_SSHConsistency (line 235) | func TestAccArgoCDRepositoryCredentials_SSHConsistency(t *testing.T) {
function TestAccArgoCDRepositoryCredentials_GitHubAppConsistency (line 270) | func TestAccArgoCDRepositoryCredentials_GitHubAppConsistency(t *testing....
function TestAccArgoCDRepositoryCredentials_GitHubAppWithRepositoryInheritance (line 309) | func TestAccArgoCDRepositoryCredentials_GitHubAppWithRepositoryInheritan...
function testAccArgoCDRepositoryCredentialsGitHubAppWithRepository (line 370) | func testAccArgoCDRepositoryCredentialsGitHubAppWithRepository(credsUrl,...
function TestAccArgoCDRepositoryCredentials_TypeWithEnableOCI (line 389) | func TestAccArgoCDRepositoryCredentials_TypeWithEnableOCI(t *testing.T) {
function TestAccArgoCDRepositoryCredentials_EnableOCIValidation (line 430) | func TestAccArgoCDRepositoryCredentials_EnableOCIValidation(t *testing.T) {
function testAccArgoCDRepositoryCredentialsWithOCI (line 452) | func testAccArgoCDRepositoryCredentialsWithOCI(repoUrl, username, passwo...
function testCheckMultipleResourceAttr (line 464) | func testCheckMultipleResourceAttr(name, key, value string, count int) r...
FILE: internal/provider/resource_repository_test.go
function TestAccArgoCDRepository_Simple (line 15) | func TestAccArgoCDRepository_Simple(t *testing.T) {
function TestAccArgoCDRepository_UseAzureWorkloadIdentity (line 44) | func TestAccArgoCDRepository_UseAzureWorkloadIdentity(t *testing.T) {
function testAccArgoCDRepositoryUseAzureWorkloadIdentity (line 57) | func testAccArgoCDRepositoryUseAzureWorkloadIdentity() string {
function TestAccArgoCDRepository_Helm (line 66) | func TestAccArgoCDRepository_Helm(t *testing.T) {
function TestAccArgoCDRepository_PrivateSSH (line 105) | func TestAccArgoCDRepository_PrivateSSH(t *testing.T) {
function TestAccArgoCDRepository_GitHubApp (line 144) | func TestAccArgoCDRepository_GitHubApp(t *testing.T) {
function TestAccArgoCDRepository_GitHubAppConsistency (line 185) | func TestAccArgoCDRepository_GitHubAppConsistency(t *testing.T) {
function TestAccArgoCDRepository_BearerTokenConsistency (line 254) | func TestAccArgoCDRepository_BearerTokenConsistency(t *testing.T) {
function TestAccArgoCDRepository_UsernamePasswordConsistency (line 304) | func TestAccArgoCDRepository_UsernamePasswordConsistency(t *testing.T) {
function TestAccArgoCDRepository_TLSCertificateConsistency (line 364) | func TestAccArgoCDRepository_TLSCertificateConsistency(t *testing.T) {
function TestAccArgoCDRepository_OptionalFieldsConsistency (line 423) | func TestAccArgoCDRepository_OptionalFieldsConsistency(t *testing.T) {
function TestAccArgoCDRepository_BooleanFieldsConsistency (line 500) | func TestAccArgoCDRepository_BooleanFieldsConsistency(t *testing.T) {
function TestAccArgoCDRepository_ProviderUpgradeStateMigration (line 559) | func TestAccArgoCDRepository_ProviderUpgradeStateMigration(t *testing.T) {
function TestAccArgoCDRepository_DepthConsistency (line 597) | func TestAccArgoCDRepository_DepthConsistency(t *testing.T) {
function TestAccArgoCDRepository_DepthDefault (line 687) | func TestAccArgoCDRepository_DepthDefault(t *testing.T) {
function TestAccArgoCDRepository_DepthUnsupportedVersion (line 723) | func TestAccArgoCDRepository_DepthUnsupportedVersion(t *testing.T) {
function TestAccArgoCDRepository_DepthNegativeValidation (line 747) | func TestAccArgoCDRepository_DepthNegativeValidation(t *testing.T) {
function TestAccArgoCDRepository_EmptyStringFieldsConsistency (line 768) | func TestAccArgoCDRepository_EmptyStringFieldsConsistency(t *testing.T) {
function testAccArgoCDRepositorySimple (line 816) | func testAccArgoCDRepositorySimple() string {
function testAccArgoCDRepositoryHelm (line 824) | func testAccArgoCDRepositoryHelm() string {
function testAccArgoCDRepositoryHelmProjectScoped (line 834) | func testAccArgoCDRepositoryHelmProjectScoped(project string) string {
function testAccArgoCDRepositoryPublicUsageInApplication (line 862) | func testAccArgoCDRepositoryPublicUsageInApplication(name string) string {
function testAccArgoCDRepositoryPrivateGitSSH (line 884) | func testAccArgoCDRepositoryPrivateGitSSH(repoUrl string) string {
function testAccArgoCDRepositoryMultiplePrivateGitSSH (line 895) | func testAccArgoCDRepositoryMultiplePrivateGitSSH(repoCount int) string {
function testAccArgoCDRepositoryGitHubApp (line 907) | func testAccArgoCDRepositoryGitHubApp(repoUrl, id, installID, baseURL, a...
function TestAccArgoCDRepository_MultiProject (line 925) | func TestAccArgoCDRepository_MultiProject(t *testing.T) {
function testAccArgoCDRepositoryMultiProjectStepOne (line 993) | func testAccArgoCDRepositoryMultiProjectStepOne(projectA, repoURL string...
function testAccArgoCDRepositoryMultiProjectStepTwo (line 1019) | func testAccArgoCDRepositoryMultiProjectStepTwo(projectA, projectB, repo...
function TestAccArgoCDRepository_ProjectChange (line 1068) | func TestAccArgoCDRepository_ProjectChange(t *testing.T) {
function TestAccArgoCDRepository_ProjectToGlobal (line 1114) | func TestAccArgoCDRepository_ProjectToGlobal(t *testing.T) {
function TestAccArgoCDRepository_GlobalToProject (line 1158) | func TestAccArgoCDRepository_GlobalToProject(t *testing.T) {
function testAccArgoCDRepositoryProjectChange (line 1201) | func testAccArgoCDRepositoryProjectChange(projectA, projectB, repoURL, c...
function testAccArgoCDRepositoryProjectToGlobalStep1 (line 1242) | func testAccArgoCDRepositoryProjectToGlobalStep1(projectName, repoURL st...
function testAccArgoCDRepositoryProjectToGlobalStep2 (line 1268) | func testAccArgoCDRepositoryProjectToGlobalStep2(repoURL string) string {
function testAccArgoCDRepositoryGlobalToProjectStep1 (line 1278) | func testAccArgoCDRepositoryGlobalToProjectStep1(repoURL string) string {
function testAccArgoCDRepositoryGlobalToProjectStep2 (line 1288) | func testAccArgoCDRepositoryGlobalToProjectStep2(projectName, repoURL st...
function TestAccArgoCDRepository_ProxyConnectivityError (line 1316) | func TestAccArgoCDRepository_ProxyConnectivityError(t *testing.T) {
function TestAccArgoCDRepository_OCI (line 1339) | func TestAccArgoCDRepository_OCI(t *testing.T) {
FILE: internal/provider/server_interface.go
type ServerInterface (line 35) | type ServerInterface struct
method InitClients (line 62) | func (si *ServerInterface) InitClients(ctx context.Context) diag.Diagn...
method IsFeatureSupported (line 164) | func (si *ServerInterface) IsFeatureSupported(feature features.Feature...
function NewServerInterface (line 56) | func NewServerInterface(c ArgoCDProviderConfig) *ServerInterface {
function getDefaultString (line 174) | func getDefaultString(s types.String, envKey string) string {
function getDefaultBool (line 182) | func getDefaultBool(ctx context.Context, b types.Bool, envKey string) bo...
FILE: internal/provider/server_interface_test.go
constant semverEquals (line 15) | semverEquals = iota
constant semverGreater (line 16) | semverGreater
constant semverLess (line 17) | semverLess
function serverInterfaceTestData (line 20) | func serverInterfaceTestData(t *testing.T, argocdVersion string, semverO...
function TestServerInterface_isFeatureSupported (line 54) | func TestServerInterface_isFeatureSupported(t *testing.T) {
FILE: internal/sync/mutex.go
function GetProjectMutex (line 25) | func GetProjectMutex(projectName string) *sync.RWMutex {
FILE: internal/testhelpers/suite.go
function TestMain (line 18) | func TestMain(m *testing.M) {
function envDefaultValue (line 34) | func envDefaultValue(envvar, defaultValue string) {
constant DefaultTestTimeout (line 43) | DefaultTestTimeout = 15 * time.Minute
function runTestSuite (line 46) | func runTestSuite(m *testing.M) int {
FILE: internal/testhelpers/testcontainers.go
constant DefaultFileMode (line 23) | DefaultFileMode = 0o644
type K3sTestEnvironment (line 27) | type K3sTestEnvironment struct
method installArgoCD (line 96) | func (env *K3sTestEnvironment) installArgoCD(ctx context.Context, vers...
method applyManifestsToContainer (line 132) | func (env *K3sTestEnvironment) applyManifestsToContainer(ctx context.C...
method projectRoot (line 147) | func (env *K3sTestEnvironment) projectRoot() (string, error) {
method runKustomizeBuild (line 159) | func (env *K3sTestEnvironment) runKustomizeBuild(dir string) ([]byte, ...
method ExecInK3s (line 175) | func (env *K3sTestEnvironment) ExecInK3s(ctx context.Context, args ......
method waitForArgoCD (line 195) | func (env *K3sTestEnvironment) waitForArgoCD(ctx context.Context) error {
method GetEnvironmentVariables (line 230) | func (env *K3sTestEnvironment) GetEnvironmentVariables() map[string]st...
method Cleanup (line 235) | func (env *K3sTestEnvironment) Cleanup(ctx context.Context) {
function SetupK3sWithArgoCD (line 34) | func SetupK3sWithArgoCD(ctx context.Context, argoCDVersion, k3sVersion s...
FILE: internal/types/pgp_public_key.go
type pgpPublicKeyType (line 18) | type pgpPublicKeyType
method TerraformType (line 34) | func (t pgpPublicKeyType) TerraformType(_ context.Context) tftypes.Type {
method ValueFromString (line 39) | func (t pgpPublicKeyType) ValueFromString(_ context.Context, in types....
method ValueFromTerraform (line 57) | func (t pgpPublicKeyType) ValueFromTerraform(_ context.Context, in tft...
method ValueType (line 80) | func (t pgpPublicKeyType) ValueType(context.Context) attr.Value {
method Equal (line 85) | func (t pgpPublicKeyType) Equal(o attr.Type) bool {
method ApplyTerraform5AttributePathStep (line 92) | func (t pgpPublicKeyType) ApplyTerraform5AttributePathStep(step tftype...
method String (line 97) | func (t pgpPublicKeyType) String() string {
method Validate (line 102) | func (t pgpPublicKeyType) Validate(ctx context.Context, in tftypes.Val...
method Description (line 147) | func (t pgpPublicKeyType) Description() string {
constant PGPPublicKeyType (line 21) | PGPPublicKeyType pgpPublicKeyType = iota
function PGPPublicKeyNull (line 151) | func PGPPublicKeyNull() PGPPublicKey {
function PGPPublicKeyUnknown (line 157) | func PGPPublicKeyUnknown() PGPPublicKey {
function PGPPublicKeyValue (line 163) | func PGPPublicKeyValue(value string) PGPPublicKey {
type PGPPublicKey (line 170) | type PGPPublicKey struct
method Type (line 180) | func (k PGPPublicKey) Type(_ context.Context) attr.Type {
method ToStringValue (line 185) | func (k PGPPublicKey) ToStringValue(ctx context.Context) (types.String...
method ToTerraformValue (line 203) | func (k PGPPublicKey) ToTerraformValue(ctx context.Context) (tftypes.V...
method Equal (line 223) | func (k PGPPublicKey) Equal(other attr.Value) bool {
method IsNull (line 242) | func (k PGPPublicKey) IsNull() bool {
method IsUnknown (line 247) | func (k PGPPublicKey) IsUnknown() bool {
method String (line 258) | func (k PGPPublicKey) String() string {
method ValuePGPPublicKey (line 271) | func (k PGPPublicKey) ValuePGPPublicKey() string {
method StringSemanticEquals (line 283) | func (k PGPPublicKey) StringSemanticEquals(ctx context.Context, other ...
FILE: internal/utils/utils.go
function OptionalInt64 (line 10) | func OptionalInt64(value *int64) basetypes.Int64Value {
function OptionalString (line 18) | func OptionalString(value *string) basetypes.StringValue {
function OptionalTimeString (line 26) | func OptionalTimeString(value *metav1.Time) basetypes.StringValue {
function MapMap (line 42) | func MapMap[T comparable, U any, V any](ss map[T]U, fn func(U) V) map[T]V {
FILE: internal/validators/duration.go
function DurationValidator (line 13) | func DurationValidator() validator.String {
type durationValidator (line 17) | type durationValidator struct
method Description (line 19) | func (v durationValidator) Description(ctx context.Context) string {
method MarkdownDescription (line 23) | func (v durationValidator) MarkdownDescription(ctx context.Context) st...
method ValidateString (line 27) | func (v durationValidator) ValidateString(ctx context.Context, req val...
FILE: internal/validators/enable_oci.go
type enableOCIValidator (line 13) | type enableOCIValidator struct
method Description (line 15) | func (v enableOCIValidator) Description(_ context.Context) string {
method MarkdownDescription (line 19) | func (v enableOCIValidator) MarkdownDescription(ctx context.Context) s...
method ValidateBool (line 23) | func (v enableOCIValidator) ValidateBool(ctx context.Context, req vali...
function EnableOCIRequiresHelmType (line 79) | func EnableOCIRequiresHelmType() validator.Bool {
FILE: internal/validators/is_dns_subdomain.go
type isDNSSubdomainValidator (line 12) | type isDNSSubdomainValidator struct
method Description (line 19) | func (v isDNSSubdomainValidator) Description(ctx context.Context) stri...
method MarkdownDescription (line 24) | func (v isDNSSubdomainValidator) MarkdownDescription(ctx context.Conte...
method ValidateString (line 29) | func (v isDNSSubdomainValidator) ValidateString(ctx context.Context, r...
function IsDNSSubdomain (line 14) | func IsDNSSubdomain() isDNSSubdomainValidator {
FILE: internal/validators/metadata_annotations.go
type metadataAnnotationsValidator (line 12) | type metadataAnnotationsValidator struct
method Description (line 19) | func (v metadataAnnotationsValidator) Description(ctx context.Context)...
method MarkdownDescription (line 24) | func (v metadataAnnotationsValidator) MarkdownDescription(ctx context....
method ValidateMap (line 29) | func (v metadataAnnotationsValidator) ValidateMap(ctx context.Context,...
function MetadataAnnotations (line 14) | func MetadataAnnotations() metadataAnnotationsValidator {
FILE: internal/validators/metadata_annotations_test.go
function TestMetadataAnnotationsValidator (line 14) | func TestMetadataAnnotationsValidator(t *testing.T) {
FILE: internal/validators/metadata_labels.go
type metadataLabelsValidator (line 13) | type metadataLabelsValidator struct
method Description (line 20) | func (v metadataLabelsValidator) Description(ctx context.Context) stri...
method MarkdownDescription (line 25) | func (v metadataLabelsValidator) MarkdownDescription(ctx context.Conte...
method ValidateMap (line 30) | func (v metadataLabelsValidator) ValidateMap(ctx context.Context, req ...
function MetadataLabels (line 15) | func MetadataLabels() metadataLabelsValidator {
FILE: internal/validators/metadata_labels_test.go
function TestMetadataLabelsValidator (line 14) | func TestMetadataLabelsValidator(t *testing.T) {
FILE: internal/validators/positive_integer.go
type positiveIntegerValidator (line 12) | type positiveIntegerValidator struct
method Description (line 14) | func (v positiveIntegerValidator) Description(_ context.Context) string {
method MarkdownDescription (line 18) | func (v positiveIntegerValidator) MarkdownDescription(ctx context.Cont...
method ValidateString (line 22) | func (v positiveIntegerValidator) ValidateString(ctx context.Context, ...
function PositiveInteger (line 54) | func PositiveInteger() validator.String {
FILE: internal/validators/project_validators.go
function GroupNameValidator (line 16) | func GroupNameValidator() validator.String {
type groupNameValidator (line 20) | type groupNameValidator struct
method Description (line 22) | func (v groupNameValidator) Description(ctx context.Context) string {
method MarkdownDescription (line 26) | func (v groupNameValidator) MarkdownDescription(ctx context.Context) s...
method ValidateString (line 30) | func (v groupNameValidator) ValidateString(ctx context.Context, req va...
function RoleNameValidator (line 49) | func RoleNameValidator() validator.String {
type roleNameValidator (line 53) | type roleNameValidator struct
method Description (line 55) | func (v roleNameValidator) Description(ctx context.Context) string {
method MarkdownDescription (line 59) | func (v roleNameValidator) MarkdownDescription(ctx context.Context) st...
method ValidateString (line 63) | func (v roleNameValidator) ValidateString(ctx context.Context, req val...
function SyncWindowKindValidator (line 82) | func SyncWindowKindValidator() validator.String {
type syncWindowKindValidator (line 86) | type syncWindowKindValidator struct
method Description (line 88) | func (v syncWindowKindValidator) Description(ctx context.Context) stri...
method MarkdownDescription (line 92) | func (v syncWindowKindValidator) MarkdownDescription(ctx context.Conte...
method ValidateString (line 96) | func (v syncWindowKindValidator) ValidateString(ctx context.Context, r...
function SyncWindowScheduleValidator (line 113) | func SyncWindowScheduleValidator() validator.String {
type syncWindowScheduleValidator (line 117) | type syncWindowScheduleValidator struct
method Description (line 119) | func (v syncWindowScheduleValidator) Description(ctx context.Context) ...
method MarkdownDescription (line 123) | func (v syncWindowScheduleValidator) MarkdownDescription(ctx context.C...
method ValidateString (line 127) | func (v syncWindowScheduleValidator) ValidateString(ctx context.Contex...
function SyncWindowDurationValidator (line 146) | func SyncWindowDurationValidator() validator.String {
type syncWindowDurationValidator (line 150) | type syncWindowDurationValidator struct
method Description (line 152) | func (v syncWindowDurationValidator) Description(ctx context.Context) ...
method MarkdownDescription (line 156) | func (v syncWindowDurationValidator) MarkdownDescription(ctx context.C...
method ValidateString (line 160) | func (v syncWindowDurationValidator) ValidateString(ctx context.Contex...
function SyncWindowTimezoneValidator (line 177) | func SyncWindowTimezoneValidator() validator.String {
type syncWindowTimezoneValidator (line 181) | type syncWindowTimezoneValidator struct
method Description (line 183) | func (v syncWindowTimezoneValidator) Description(ctx context.Context) ...
method MarkdownDescription (line 187) | func (v syncWindowTimezoneValidator) MarkdownDescription(ctx context.C...
method ValidateString (line 191) | func (v syncWindowTimezoneValidator) ValidateString(ctx context.Contex...
FILE: internal/validators/repository_certificate.go
type repositoryCertificateValidator (line 13) | type repositoryCertificateValidator struct
method Description (line 15) | func (v repositoryCertificateValidator) Description(_ context.Context)...
method MarkdownDescription (line 19) | func (v repositoryCertificateValidator) MarkdownDescription(ctx contex...
method ValidateResource (line 23) | func (v repositoryCertificateValidator) ValidateResource(ctx context.C...
function RepositoryCertificate (line 76) | func RepositoryCertificate() resource.ConfigValidator {
FILE: internal/validators/ssh_private_key.go
type sshPrivateKeyValidator (line 14) | type sshPrivateKeyValidator struct
method Description (line 16) | func (v sshPrivateKeyValidator) Description(_ context.Context) string {
method MarkdownDescription (line 20) | func (v sshPrivateKeyValidator) MarkdownDescription(ctx context.Contex...
method ValidateString (line 24) | func (v sshPrivateKeyValidator) ValidateString(ctx context.Context, re...
function SSHPrivateKey (line 102) | func SSHPrivateKey() validator.String {
FILE: main.go
function main (line 37) | func main() {
Condensed preview — 168 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,888K chars).
[
{
"path": ".devcontainer.json",
"chars": 1092,
"preview": "{\n \"name\": \"terraform-provider-argocd\",\n // officiall MS template from https://github.com/devcontainers/templates/tree"
},
{
"path": ".github/CODEOWNERS",
"chars": 68,
"preview": "* @oboukili @onematchfox @blakepettersson @the-technat @mkilchhofer\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report.md",
"chars": 2624,
"preview": "---\nname: \"\\U0001F41B Bug Report\"\nabout: \"If something isn't working as expected \\U0001F914.\"\ntitle: ''\nlabels: bug\ntype"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 195,
"preview": "blank_issues_enabled: false\ncontact_links:\n - name: Provider Slack Channel\n url: https://cloud-native.slack.com/arch"
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request.md",
"chars": 1389,
"preview": "---\nname: \"\\U0001F680 Feature Request\"\nabout: \"I have a suggestion (and might want to implement myself \\U0001F642)!\"\ntit"
},
{
"path": ".github/ISSUE_TEMPLATE/question.md",
"chars": 873,
"preview": "---\nname: \"\\U0001F914 Question\"\nabout: \"If you need help figuring something out\"\ntitle: ''\nlabels: question\n\n---\n\n<!---\n"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.MD",
"chars": 648,
"preview": "**What type of PR is this?**\n\n[//]: # (Uncomment only one <!-- /kind ... --> line, and delete the rest.)\n[//]: # (For ex"
},
{
"path": ".github/renovate.json",
"chars": 1975,
"preview": "{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\n \"config:recommended\",\n \"schedu"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 1519,
"preview": "name: \"CodeQL\"\n\non:\n push:\n branches: [\"main\"]\n pull_request:\n branches: [\"main\"]\n schedule:\n - cron: \"15 0 "
},
{
"path": ".github/workflows/release.yml",
"chars": 2039,
"preview": "---\nname: Release\n\non:\n push:\n tags: ['v*']\n\n# Releases need permissions to read and write the repository contents.\n"
},
{
"path": ".github/workflows/stale.yml",
"chars": 1219,
"preview": "## Reference: https://github.com/actions/stale\nname: 'Close stale Issues/PRs'\non:\n schedule:\n - cron: '30 12 * * *'\n"
},
{
"path": ".github/workflows/tests.yml",
"chars": 4081,
"preview": "---\nname: Tests\n\non:\n push:\n branches: [main]\n paths-ignore:\n - 'README.md'\n pull_request:\n branches: [m"
},
{
"path": ".gitignore",
"chars": 208,
"preview": "terraform-provider-argocd\n/manifests/install/argocd.yml\n/bin\n.idea\n\n# Env variables settings\n/scripts/testacc\n/scripts/t"
},
{
"path": ".golangci.yml",
"chars": 3351,
"preview": "version: \"2\"\nlinters:\n default: none\n enable:\n - asasalint\n - asciicheck\n - containedctx\n - contextcheck\n "
},
{
"path": ".goreleaser.yml",
"chars": 1031,
"preview": "---\nversion: 2\nbuilds:\n - env:\n - CGO_ENABLED=0\n mod_timestamp: \"{{ .CommitTimestamp }}\"\n flags:\n - -tr"
},
{
"path": ".run/Template Go Test.run.xml",
"chars": 1042,
"preview": "<component name=\"ProjectRunConfigurationManager\">\n <configuration default=\"true\" type=\"GoTestRunConfiguration\" factoryN"
},
{
"path": ".vscode/launch.json",
"chars": 862,
"preview": "{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"Debug Terraform Provider\",\n \"type\": \"go\",\n "
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 708,
"preview": "# Code of conduct\n\nWhile this provider is not a [Cloud Native Computing Foundation](https://www.cncf.io/) (CNCF) project"
},
{
"path": "CONTRIBUTING.md",
"chars": 8166,
"preview": "# Contributing\n\nContributions are welcome! \n\n[ for automatically buildin"
},
{
"path": "SECURITY.md",
"chars": 570,
"preview": "# Security Policy\n\n## Reporting a Vulnerability \n\nWe have enabled the ability to privately report security issues throug"
},
{
"path": "argocd/model_provider.go",
"chars": 12357,
"preview": "package argocd\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/int"
},
{
"path": "argocd/provider.go",
"chars": 14909,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\tfwdiag \"github.com/hashicorp/terraform-plugin-framework/diag\"\n\t\"github.com"
},
{
"path": "argocd/provider_test.go",
"chars": 4391,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/argoproj-l"
},
{
"path": "argocd/resource_argocd_account_token.go",
"chars": 11228,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/argoproj/argo-cd/v3/pkg/api"
},
{
"path": "argocd/resource_argocd_account_token_test.go",
"chars": 9078,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"regexp\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/hashicorp/terraform-plugin-testi"
},
{
"path": "argocd/resource_argocd_application.go",
"chars": 14597,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\n\t\"github."
},
{
"path": "argocd/resource_argocd_application_set.go",
"chars": 6952,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/fea"
},
{
"path": "argocd/resource_argocd_application_set_test.go",
"chars": 82587,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/in"
},
{
"path": "argocd/resource_argocd_application_test.go",
"chars": 68296,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/in"
},
{
"path": "argocd/resource_argocd_cluster.go",
"chars": 7277,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\tclusterClient \"github.com/argoproj/argo-cd/v3/pkg/apiclient/clus"
},
{
"path": "argocd/resource_argocd_cluster_test.go",
"chars": 20502,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/argopr"
},
{
"path": "argocd/schema_application.go",
"chars": 74080,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n)\n\nfunc applic"
},
{
"path": "argocd/schema_application_set.go",
"chars": 41785,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n)\n\nconst gener"
},
{
"path": "argocd/schema_application_test.go",
"chars": 15472,
"preview": "package argocd\n\nimport (\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestUpgradeSchemaApplication_V0V1_Default_SkipCrds(t *"
},
{
"path": "argocd/schema_cluster.go",
"chars": 8636,
"preview": "package argocd\n\nimport (\n\t\"strings\"\n\n\t\"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n)\n\nfunc clusterSchema"
},
{
"path": "argocd/schema_label_selector.go",
"chars": 1656,
"preview": "package argocd\n\nimport \"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n\nfunc labelSelectorSchema() map[stri"
},
{
"path": "argocd/schema_metadata.go",
"chars": 2967,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n)\n\nfunc metadataSchema(na"
},
{
"path": "argocd/server_interface.go",
"chars": 5932,
"preview": "package argocd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/ar"
},
{
"path": "argocd/server_interface_test.go",
"chars": 2088,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/argoproj-labs/terraform-pro"
},
{
"path": "argocd/structure_application.go",
"chars": 26157,
"preview": "package argocd\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/features"
},
{
"path": "argocd/structure_application_set.go",
"chars": 54316,
"preview": "package argocd\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/intern"
},
{
"path": "argocd/structure_cluster.go",
"chars": 7926,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\n\tapplication \"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1\"\n\t\"github.co"
},
{
"path": "argocd/structure_label_selector.go",
"chars": 1865,
"preview": "package argocd\n\nimport (\n\t\"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n\tmetav1 \"k8s.io/apimachinery/pkg/"
},
{
"path": "argocd/structure_metadata.go",
"chars": 1820,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema\"\n\tme"
},
{
"path": "argocd/structure_metadata_test.go",
"chars": 760,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestMetadataIsInternalKey(t *testing.T) {\n\tt.Parallel()\n\n\ttestCases :"
},
{
"path": "argocd/structures.go",
"chars": 1844,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\tapplication \"github.com/argoproj/argo-cd/v3/pkg/apis/application"
},
{
"path": "argocd/utils.go",
"chars": 5695,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/in"
},
{
"path": "argocd/utils_test.go",
"chars": 2403,
"preview": "package argocd\n\nimport (\n\t\"testing\"\n)\n\nfunc TestValidatePolicy(t *testing.T) {\n\tt.Parallel()\n\n\tproject := \"myproject\"\n\tr"
},
{
"path": "argocd/validators.go",
"chars": 2243,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\t_ \"time/tzdata\"\n\n\tapiValidation \"k8s.io/apimachinery/pkg/a"
},
{
"path": "argocd/validators_test.go",
"chars": 3581,
"preview": "package argocd\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc Test_validateMetadataLabels(t"
},
{
"path": "docs/data-sources/application.md",
"chars": 18254,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_application Data Source - terr"
},
{
"path": "docs/index.md",
"chars": 9143,
"preview": "---\npage_title: \"Provider: ArgoCD\"\ndescription: |-\n The ArgoCD provider provides lifecycle management of ArgoCD resourc"
},
{
"path": "docs/resources/account_token.md",
"chars": 2689,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_account_token Resource - terra"
},
{
"path": "docs/resources/application.md",
"chars": 23509,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_application Resource - terrafo"
},
{
"path": "docs/resources/application_set.md",
"chars": 1302797,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_application_set Resource - ter"
},
{
"path": "docs/resources/cluster.md",
"chars": 8116,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_cluster Resource - terraform-p"
},
{
"path": "docs/resources/gpg_key.md",
"chars": 2967,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_gpg_key Resource - terraform-p"
},
{
"path": "docs/resources/project.md",
"chars": 11784,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_project Resource - terraform-p"
},
{
"path": "docs/resources/project_token.md",
"chars": 2677,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_project_token Resource - terra"
},
{
"path": "docs/resources/repository.md",
"chars": 4771,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_repository Resource - terrafor"
},
{
"path": "docs/resources/repository_certificate.md",
"chars": 2473,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_repository_certificate Resourc"
},
{
"path": "docs/resources/repository_credentials.md",
"chars": 3455,
"preview": "---\n# generated by https://github.com/hashicorp/terraform-plugin-docs\npage_title: \"argocd_repository_credentials Resourc"
},
{
"path": "examples/data-sources/argocd_application/data-source.tf",
"chars": 102,
"preview": "data \"argocd_application\" \"foo\" {\n metadata = {\n name = \"foo\"\n namespace = \"argocd\"\n }\n}\n"
},
{
"path": "examples/provider/provider.tf",
"chars": 1286,
"preview": "# Exposed ArgoCD API - authenticated using authentication token.\nprovider \"argocd\" {\n server_addr = \"argocd.local:443\"\n"
},
{
"path": "examples/resources/argocd_account_token/resource.tf",
"chars": 348,
"preview": "# Token for account configured on the `provider`\nresource \"argocd_account_token\" \"this\" {\n renew_after = \"168h\" # renew"
},
{
"path": "examples/resources/argocd_application/import.sh",
"chars": 141,
"preview": "# ArgoCD applications can be imported using an id consisting of `{name}:{namespace}`.\n\nterraform import argocd_applicati"
},
{
"path": "examples/resources/argocd_application/resource.tf",
"chars": 3321,
"preview": "# Kustomize application\nresource \"argocd_application\" \"kustomize\" {\n metadata {\n name = \"kustomize-app\"\n nam"
},
{
"path": "examples/resources/argocd_application_set/resource.tf",
"chars": 12841,
"preview": "# Clusters Generator\nresource \"argocd_application_set\" \"clusters_selector\" {\n metadata {\n name = \"clusters-selector\""
},
{
"path": "examples/resources/argocd_cluster/import.sh",
"chars": 127,
"preview": "# Cluster credentials can be imported using the server URL.\n\nterraform import argocd_cluster.mycluster https://mycluster"
},
{
"path": "examples/resources/argocd_cluster/resource.tf",
"chars": 2510,
"preview": "## Bearer token Authentication\nresource \"argocd_cluster\" \"kubernetes\" {\n server = \"https://1.2.3.4:12345\"\n\n config {\n "
},
{
"path": "examples/resources/argocd_gpg_key/import.sh",
"chars": 99,
"preview": "# GPG Keys can be imported using the key ID.\n\nterraform import argocd_gpg_key.this 9AD92955401D388D"
},
{
"path": "examples/resources/argocd_gpg_key/resource.tf",
"chars": 1746,
"preview": "resource \"argocd_gpg_key\" \"this\" {\n public_key = <<EOF\n-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBGSJdlcBEACnza+KvWLyKW"
},
{
"path": "examples/resources/argocd_project/import.sh",
"chars": 104,
"preview": "# Projects can be imported using the project name.\n\nterraform import argocd_project.myproject myproject\n"
},
{
"path": "examples/resources/argocd_project/resource.tf",
"chars": 2945,
"preview": "resource \"argocd_project\" \"myproject\" {\n metadata {\n name = \"myproject\"\n namespace = \"argocd\"\n labels = {"
},
{
"path": "examples/resources/argocd_project_token/resource.tf",
"chars": 184,
"preview": "resource \"argocd_project_token\" \"secret\" {\n project = \"someproject\"\n role = \"foobar\"\n description = \"sh"
},
{
"path": "examples/resources/argocd_repository/import.sh",
"chars": 410,
"preview": "# Repositories can be imported using the repository URL.\n\n# Note: as the ArgoCD API does not return any sensitive inform"
},
{
"path": "examples/resources/argocd_repository/resource.tf",
"chars": 1104,
"preview": "# Public Helm repository\nresource \"argocd_repository\" \"public_nginx_helm\" {\n repo = \"https://helm.nginx.com/stable\"\n n"
},
{
"path": "examples/resources/argocd_repository_certificate/resource.tf",
"chars": 577,
"preview": "# HTTPS certificate\nresource \"argocd_repository_certificate\" \"private-git-repository\" {\n https {\n server_name = \"pri"
},
{
"path": "examples/resources/argocd_repository_credentials/import.sh",
"chars": 436,
"preview": "# Repository credentials can be imported using the repository URL.\n\n# Note: as the ArgoCD API does not return any sensit"
},
{
"path": "examples/resources/argocd_repository_credentials/resource.tf",
"chars": 239,
"preview": "resource \"argocd_repository_credentials\" \"private\" {\n url = \"git@private-git-repository.local\"\n username "
},
{
"path": "go.mod",
"chars": 20048,
"preview": "module github.com/argoproj-labs/terraform-provider-argocd\n\ngo 1.25.8\n\nrequire (\n\tgithub.com/Masterminds/semver/v3 v3.4.0"
},
{
"path": "go.sum",
"chars": 159375,
"preview": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ncloud.google.com/go v0.34.0/go.mod h1"
},
{
"path": "internal/diagnostics/diagnostics.go",
"chars": 840,
"preview": "package diagnostics\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/features\"\n\t\"github.c"
},
{
"path": "internal/features/features.go",
"chars": 2470,
"preview": "package features\n\nimport (\n\t\"github.com/Masterminds/semver/v3\"\n)\n\ntype Feature int64\n\nconst (\n\tExecLogsPolicy Feature = "
},
{
"path": "internal/provider/data_source_application.go",
"chars": 3921,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/d"
},
{
"path": "internal/provider/data_source_application_test.go",
"chars": 24072,
"preview": "package provider\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/features\"\n\t\""
},
{
"path": "internal/provider/model_application.go",
"chars": 49214,
"preview": "package provider\n\nimport (\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/utils\"\n\t\"github.com/argoproj-la"
},
{
"path": "internal/provider/model_gpg_key.go",
"chars": 2301,
"preview": "package provider\n\nimport (\n\tcustomtypes \"github.com/argoproj-labs/terraform-provider-argocd/internal/types\"\n\t\"github.com"
},
{
"path": "internal/provider/model_metadata.go",
"chars": 8834,
"preview": "package provider\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/utils\"\n\t\"github.com/arg"
},
{
"path": "internal/provider/model_project.go",
"chars": 20650,
"preview": "package provider\n\nimport (\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/validators\"\n\t\"github.com/argopr"
},
{
"path": "internal/provider/model_project_token.go",
"chars": 3703,
"preview": "package provider\n\nimport (\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/validators\"\n\t\"github.com/hashic"
},
{
"path": "internal/provider/model_provider.go",
"chars": 12359,
"preview": "package provider\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/i"
},
{
"path": "internal/provider/model_repository.go",
"chars": 12162,
"preview": "package provider\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1\"\n\t\"github.com/hash"
},
{
"path": "internal/provider/model_repository_certificate.go",
"chars": 4597,
"preview": "package provider\n\nimport (\n\t\"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1\"\n\t\"github.com/hashicorp/terraf"
},
{
"path": "internal/provider/model_repository_credentials.go",
"chars": 6528,
"preview": "package provider\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/validators\"\n\t\"githu"
},
{
"path": "internal/provider/planmodifiers.go",
"chars": 3349,
"preview": "package provider\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier\"\n\t"
},
{
"path": "internal/provider/provider.go",
"chars": 11510,
"preview": "package provider\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator\"\n\t\"git"
},
{
"path": "internal/provider/provider_test.go",
"chars": 3730,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/argoproj-labs/t"
},
{
"path": "internal/provider/resource_gpg_key.go",
"chars": 6039,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/d"
},
{
"path": "internal/provider/resource_gpg_key_test.go",
"chars": 5672,
"preview": "package provider\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/hashicorp/terraform-plugin-testing/helper/resource\"\n)\n\nfun"
},
{
"path": "internal/provider/resource_project.go",
"chars": 22708,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/in"
},
{
"path": "internal/provider/resource_project_test.go",
"chars": 55417,
"preview": "package provider\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/fe"
},
{
"path": "internal/provider/resource_project_token.go",
"chars": 15048,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/argoproj-labs/"
},
{
"path": "internal/provider/resource_project_token_test.go",
"chars": 18543,
"preview": "package provider\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/hashicorp/terraform"
},
{
"path": "internal/provider/resource_repository.go",
"chars": 10485,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/argoproj-labs/terraform-provider"
},
{
"path": "internal/provider/resource_repository_certificate.go",
"chars": 11548,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/d"
},
{
"path": "internal/provider/resource_repository_certificate_test.go",
"chars": 32166,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/argoproj-labs/terraform"
},
{
"path": "internal/provider/resource_repository_credentials.go",
"chars": 14149,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd"
},
{
"path": "internal/provider/resource_repository_credentials_test.go",
"chars": 18664,
"preview": "package provider\n\nimport (\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"gi"
},
{
"path": "internal/provider/resource_repository_test.go",
"chars": 36866,
"preview": "package provider\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/argoproj-labs/terraform-provider-argocd/internal/fe"
},
{
"path": "internal/provider/server_interface.go",
"chars": 5934,
"preview": "package provider\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/"
},
{
"path": "internal/provider/server_interface_test.go",
"chars": 2090,
"preview": "package provider\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/argoproj-labs/terraform-p"
},
{
"path": "internal/sync/mutex.go",
"chars": 1258,
"preview": "package sync\n\nimport \"sync\"\n\n// GPGKeysMutex is used to handle concurrent access to ArgoCD GPG keys which are\n// stored "
},
{
"path": "internal/testhelpers/suite.go",
"chars": 1997,
"preview": "package testhelpers\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar (\n\tGlobalTestEnv *K3sTestEnviron"
},
{
"path": "internal/testhelpers/testcontainers.go",
"chars": 7570,
"preview": "package testhelpers\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"g"
},
{
"path": "internal/types/pgp_public_key.go",
"chars": 8012,
"preview": "package types\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/ProtonMail/gopenpgp/v3/crypto\"\n\t\"github.com/hashicorp"
},
{
"path": "internal/utils/utils.go",
"chars": 1350,
"preview": "package utils\n\nimport (\n\t\"github.com/hashicorp/terraform-plugin-framework/types\"\n\t\"github.com/hashicorp/terraform-plugin"
},
{
"path": "internal/validators/duration.go",
"chars": 1053,
"preview": "package validators\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/schema/validat"
},
{
"path": "internal/validators/enable_oci.go",
"chars": 2223,
"preview": "package validators\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/attr\"\n\t\"github.com/hashicorp/"
},
{
"path": "internal/validators/is_dns_subdomain.go",
"chars": 1477,
"preview": "package validators\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/schema/validator\"\n\t\"k8s.io/ap"
},
{
"path": "internal/validators/metadata_annotations.go",
"chars": 1717,
"preview": "package validators\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/schema/validator\"\n\t\"k8s.io/ap"
},
{
"path": "internal/validators/metadata_annotations_test.go",
"chars": 2154,
"preview": "package validators\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/attr\"\n\t\"github.com"
},
{
"path": "internal/validators/metadata_labels.go",
"chars": 2069,
"preview": "package validators\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/schema/validator\"\n\t\"github.co"
},
{
"path": "internal/validators/metadata_labels_test.go",
"chars": 2651,
"preview": "package validators\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/attr\"\n\t\"github.com"
},
{
"path": "internal/validators/positive_integer.go",
"chars": 1205,
"preview": "package validators\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/schema/validator\"\n"
},
{
"path": "internal/validators/project_validators.go",
"chars": 6353,
"preview": "package validators\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"time\"\n\n\targocdtime \"github.com/argoproj/pkg/v2/time\"\n\t\"github"
},
{
"path": "internal/validators/repository_certificate.go",
"chars": 1967,
"preview": "package validators\n\nimport (\n\t\"context\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/path\"\n\t\"github.com/hashicorp/"
},
{
"path": "internal/validators/ssh_private_key.go",
"chars": 2314,
"preview": "package validators\n\nimport (\n\t\"context\"\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/terraform-plug"
},
{
"path": "kind-config.yml",
"chars": 261,
"preview": "---\napiVersion: kind.x-k8s.io/v1alpha4\nkind: Cluster\nname: argocd\nnodes:\n - role: control-plane\n image: kindest/node"
},
{
"path": "main.go",
"chars": 2169,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"log\"\n\n\t\"github.com/hashicorp/terraform-plugin-framework/providerserver\"\n\t\"gi"
},
{
"path": "manifests/install/cluster-rbac.yml",
"chars": 728,
"preview": "# The below RBAC will allow the argocd-server to deploy Application resources to any namespace, not just to argocd\napiVe"
},
{
"path": "manifests/install/git-private-repository.yml",
"chars": 3212,
"preview": "---\napiVersion: v1\nkind: Secret\nmetadata:\n name: git-authorized-ssh-keys\n namespace: argocd\ntype: Opaque\nstringData:\n "
},
{
"path": "manifests/install/kustomization.yml",
"chars": 171,
"preview": "---\napiVersion: kustomize.config.k8s.io/v1beta1\nkind: Kustomization\nresources:\n - namespace.yml\n - git-private-reposit"
},
{
"path": "manifests/install/namespace.yml",
"chars": 59,
"preview": "---\napiVersion: v1\nkind: Namespace\nmetadata:\n name: argocd"
},
{
"path": "manifests/install/proxy-service.yml",
"chars": 433,
"preview": "---\n# Access to argocd service port without the need to proxy through kubectl proxy\napiVersion: v1\nkind: Service\nmetadat"
},
{
"path": "manifests/install/ssh-identity.key",
"chars": 399,
"preview": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACC"
},
{
"path": "manifests/local-dev/.gitignore",
"chars": 49,
"preview": ".terraform*\nterraform.tfstate*\ncrash.log\n*-config"
},
{
"path": "manifests/local-dev/account-token.tf",
"chars": 179,
"preview": "resource \"argocd_account_token\" \"admin\" {\n renew_after = \"30s\"\n}\n\nresource \"argocd_account_token\" \"test\" {\n account "
},
{
"path": "manifests/local-dev/application-set.tf",
"chars": 14494,
"preview": "resource \"argocd_application_set\" \"clusters\" {\n metadata {\n name = \"clusters\"\n }\n\n spec {\n generator {\n cl"
},
{
"path": "manifests/local-dev/application.tf",
"chars": 1223,
"preview": "resource \"argocd_application\" \"foo\" {\n metadata {\n name = \"foo\"\n namespace = \"argocd\"\n labels = {\n a"
},
{
"path": "manifests/local-dev/cluster.tf",
"chars": 357,
"preview": "resource \"kind_cluster\" \"secondary\" {\n name = \"secondary\"\n node_image = \"kindest/node:v1.24.7\"\n}\n\nresource \"argo"
},
{
"path": "manifests/local-dev/data.tf",
"chars": 261,
"preview": "# Uncomment below to see full data source for application `foo` (needs to have\n# been applied first).\n#\n# data \"argocd_a"
},
{
"path": "manifests/local-dev/gpg-key.tf",
"chars": 1746,
"preview": "resource \"argocd_gpg_key\" \"this\" {\n public_key = <<EOF\n-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBGSJdlcBEACnza+KvWLyKW"
},
{
"path": "manifests/local-dev/outputs.tf",
"chars": 735,
"preview": "# Uncomment output below to see `status` for application `foo`.\n#\n# Note: making use of `status` within Terraform code w"
},
{
"path": "manifests/local-dev/project-token.tf",
"chars": 569,
"preview": "resource \"argocd_project_token\" \"long\" {\n project = argocd_project.foo.metadata.0.name\n role = \"foo\"\n desc"
},
{
"path": "manifests/local-dev/project.tf",
"chars": 1761,
"preview": "resource \"argocd_project\" \"foo\" {\n metadata {\n name = \"foo\"\n namespace = \"argocd\"\n labels = {\n accep"
},
{
"path": "manifests/local-dev/repository-credentials.tf",
"chars": 128,
"preview": "resource \"argocd_repository_credentials\" \"this\" {\n url = \"https://github.com/foo\"\n username = \"foo\"\n password = "
},
{
"path": "manifests/local-dev/repository.tf",
"chars": 110,
"preview": "resource \"argocd_repository\" \"this\" {\n repo = \"https://github.com/argoproj-labs/terraform-provider-argocd\"\n}\n"
},
{
"path": "manifests/local-dev/versions.tf",
"chars": 840,
"preview": "terraform {\n required_providers {\n argocd = {\n source = \"argoproj-labs/argocd\"\n version = \">= 6.2.0\"\n "
},
{
"path": "manifests/overlays/v3.1.12/kustomization.yml",
"chars": 223,
"preview": "apiVersion: kustomize.config.k8s.io/v1beta1\nkind: Kustomization\nnamespace: argocd\nresources:\n- https://raw.githubusercon"
},
{
"path": "manifests/overlays/v3.2.6/kustomization.yml",
"chars": 222,
"preview": "apiVersion: kustomize.config.k8s.io/v1beta1\nkind: Kustomization\nnamespace: argocd\nresources:\n- https://raw.githubusercon"
},
{
"path": "manifests/overlays/v3.3.0/kustomization.yml",
"chars": 222,
"preview": "apiVersion: kustomize.config.k8s.io/v1beta1\nkind: Kustomization\nnamespace: argocd\nresources:\n- https://raw.githubusercon"
},
{
"path": "manifests/patches/argocd-cm.yml",
"chars": 114,
"preview": "apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: argocd-cm\ndata:\n accounts.admin: apiKey\n accounts.test: apiKey\n"
},
{
"path": "manifests/patches/argocd-cmd-params-cm.yml",
"chars": 370,
"preview": "apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: argocd-cmd-params-cm\ndata:\n application.namespaces: mynamespace-*\n ap"
},
{
"path": "manifests/patches/kustomization.yaml",
"chars": 330,
"preview": "apiVersion: kustomize.config.k8s.io/v1alpha1\nkind: Component\npatches:\n - target:\n kind: ConfigMap\n name: argo"
},
{
"path": "manifests/patches/secret.yml",
"chars": 158,
"preview": "---\napiVersion: v1\nkind: Secret\nmetadata:\n name: argocd-secret\nstringData:\n \"admin.password\": \"$2a$10$O7VHb/85434QLWAe"
},
{
"path": "manifests/testdata/custom_namespace.yml",
"chars": 147,
"preview": "\n# Used to test deploying Applications to this namespace instead of to 'argocd'\n---\napiVersion: v1\nkind: Namespace\nmetad"
},
{
"path": "manifests/testdata/token_resource.yml",
"chars": 2546,
"preview": "---\napiVersion: argoproj.io/v1alpha1\nkind: AppProject\nmetadata:\n name: myproject1\n namespace: argocd\nspec:\n descripti"
},
{
"path": "scripts/update-kubernetes-version.sh",
"chars": 780,
"preview": "#!/usr/bin/env bash\n# Source: \n# https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-521493597\n# https://"
},
{
"path": "templates/index.md.tmpl",
"chars": 2561,
"preview": "---\npage_title: \"Provider: ArgoCD\"\ndescription: |-\n The ArgoCD provider provides lifecycle management of ArgoCD resourc"
},
{
"path": "terraform-registry-manifest.json",
"chars": 82,
"preview": "{\n \"version\": 1,\n \"metadata\": {\n \"protocol_versions\": [\"6.0\"]\n }\n}"
},
{
"path": "tools/go.mod",
"chars": 2424,
"preview": "module tools\n\ngo 1.24.0\n\nrequire github.com/hashicorp/terraform-plugin-docs v0.24.0\n\nrequire (\n\tgithub.com/BurntSushi/to"
},
{
"path": "tools/go.sum",
"chars": 17932,
"preview": "dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=\ndario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobSt"
},
{
"path": "tools/tools.go",
"chars": 549,
"preview": "//go:build generate\n\npackage tools\n\nimport (\n\t_ \"github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs\"\n)\n\n// Form"
}
]
About this extraction
This page contains the full source code of the oboukili/terraform-provider-argocd GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 168 files (2.6 MB), approximately 683.8k tokens, and a symbol index with 954 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.