Skip to content

Commit

Permalink
feat: fine-grained ArgoCD project destination
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebradil committed Sep 5, 2023
1 parent 4b3ed11 commit 04d3b78
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions internal/myks/assets/data-schema.ytt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ argocd:
name: ""
#! Prefix of the ArgoCD project name.
prefix: ""
#! spec.destination[0] of the ArgoCD project.
#! Add more destinations via overlays, if needed.
destination:
#! spec.destination.name of the ArgoCD project.
#! If not set, defaults to the name of the current environment.
name: ""
#! spec.destination.server of the ArgoCD project.
#! If set, used instead of spec.destination.name.
server: ""
#! spec.destination.namespace of the ArgoCD project.
#! By default, all namespaces are allowed.
namespace: "*"
environment:
#! Unique identifier of the environment, required by myks.
#@schema/validation min_len=1
Expand Down
8 changes: 6 additions & 2 deletions internal/myks/templates/argocd/environment.ytt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ spec:
- group: "*"
kind: "*"
destinations:
- name: #@ env_name
namespace: "*"
- namespace: #@ a.project.destination.namespace
#@ if a.project.destination.server:
server: #@ a.project.destination.server
#@ else:
name: #@ a.project.destination.name or env_name
#@ end
namespaceResourceWhitelist:
- group: "*"
kind: "*"
Expand Down

0 comments on commit 04d3b78

Please sign in to comment.