Skip to content

Commit

Permalink
feat: add standard variables and variable to add labels to Argo CD app
Browse files Browse the repository at this point in the history
  • Loading branch information
lentidas committed Oct 19, 2023
1 parent 74d6627 commit 8ec1b98
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ resource "argocd_application" "this" {
metadata {
name = var.destination_cluster != "in-cluster" ? "longhorn-${var.destination_cluster}" : "longhorn"
namespace = var.argocd_namespace
labels = merge({
"application" = "longhorn"
"cluster" = var.destination_cluster
}, var.argocd_labels)
}

timeouts {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ variable "argocd_project" {
default = null
}

variable "argocd_labels" {
description = "Labels to attach to the Argo CD Application resource."
type = map(string)
default = {}
}

variable "destination_cluster" {
description = "Destination cluster where the application should be deployed."
type = string
Expand Down

0 comments on commit 8ec1b98

Please sign in to comment.