Skip to content

Commit

Permalink
drySource is not an array
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
  • Loading branch information
crenshaw-dev committed Apr 3, 2024
1 parent c7df497 commit a1ccdc1
Showing 1 changed file with 59 additions and 31 deletions.
90 changes: 59 additions & 31 deletions docs/proposals/manifest-hydrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,11 @@ spec:
# The sourceHydrator field is mutually-exclusive with `source` and with `sources`. If this field is configured, we
# should either throw an error or ignore the other two.
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
# This assumes the Application's environments are modeled as directories.
path: environments/e2e
#chart: my-chart # if it’s a Helm chart, but the first source is only allowed to be a git repo
# Hydrator-specific fields like “helm,” “kustomize,” “directory,” and
# “plugin” are not available here. Those source details must be in git,
# in a .argocd-source.yaml file.
# This is because every change to the manifests must have a
# corresponding dry commit.
writeTo:
targetBranch: environments/e2e-next
path: .
Expand Down Expand Up @@ -127,8 +121,8 @@ metadata:
name: dev-west
spec:
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/dev/west
writeTo:
Expand All @@ -141,10 +135,10 @@ metadata:
name: dev-east
spec:
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/dev/east
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/dev/east
writeTo:
targetBranch: environments/dev
path: east
Expand All @@ -156,10 +150,10 @@ metadata:
name: test-west
spec:
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/test/west
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/test/west
writeTo:
targetBranch: environments/test
path: west
Expand All @@ -170,10 +164,10 @@ metadata:
name: test-east
spec:
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/test/east
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/test/east
writeTo:
targetBranch: environments/prod
path: east
Expand All @@ -185,10 +179,10 @@ metadata:
name: prod-west
spec:
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/prod/west
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/prod/west
writeTo:
targetBranch: environments/prod
path: west
Expand All @@ -199,10 +193,10 @@ metadata:
name: prod-east
spec:
sourceHydrator:
drySources:
- repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/prod/east
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/prod/east
writeTo:
targetBranch: environments/prod
path: east
Expand All @@ -211,6 +205,40 @@ spec:

Each commit to the dry branch will result in a commit to up to three branches. Each commit to an environment branch will contain changes for west, east, or both (depending on which is affected). Changes originating from a single dry commit are always grouped into a single hydrated commit.

### Handling External Values Files

Argo CD's support for multiple sources and especially external values files is very popular, so this proposal must provide satisfactory support for that feature.

Suppose a user has an application defined like this:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
sources:
- repoURL: 'https://prometheus-community.github.io/helm-charts'
chart: prometheus
targetRevision: 15.7.1
helm:
valueFiles:
- $values/charts/prometheus/values.yaml
- repoURL: 'https://git.example.com/org/value-files.git'
targetRevision: dev
ref: values
```
The equivalent hydrated-source manifest would look like this:
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
sourceHydrator:
drySource:

This comment has been minimized.

Copy link
@OpenGuidou

OpenGuidou Apr 3, 2024

Contributor

How is this linked to the chart ?

This comment has been minimized.

Copy link
@crenshaw-dev

crenshaw-dev Apr 3, 2024

Author Member

Oops, I should have pushed so soon. 😆 After talking with @zachaller I think we should make umbrella-chart the official way to use internal values with external Helm charts. I think the simplification is well worth the somewhat-degraded UX.

This comment has been minimized.

Copy link
@OpenGuidou

OpenGuidou Apr 3, 2024

Contributor

Wouldn't that kill the multisource itself ?
If I have to group all my helm sources in an umbrella with a single value file, I don't need the multisource to start with

This comment has been minimized.

Copy link
@crenshaw-dev

crenshaw-dev Apr 3, 2024

Author Member

Wouldn't kill it, it just wouldn't be part of the hydrator's feature set. I could definitely imagine adding support back later, but I don't think that would be crucial for v1.

repoURL: 'https://git.example.com/org/value-files.git'
targetRevision: dev
```
### Commit Metadata
Each output directory should contain two files: manifest.yaml and README.md. manifest.yaml should contain the plain hydrated manifests. The resources should be sorted by namespace, name, group, and kind (in that order).
Expand Down Expand Up @@ -397,7 +425,7 @@ metadata:
name: dev-west
spec:
sourceHydrator:
drySources:
drySource:
- repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: main
path: environments/dev/west
Expand Down

0 comments on commit a1ccdc1

Please sign in to comment.