Skip to content

feat: Allow users to template and render Application's resources fully locally#14365

Closed
Sergey-Kizimov wants to merge 5 commits intoargoproj:masterfrom
Sergey-Kizimov:i-11129
Closed

feat: Allow users to template and render Application's resources fully locally#14365
Sergey-Kizimov wants to merge 5 commits intoargoproj:masterfrom
Sergey-Kizimov:i-11129

Conversation

@Sergey-Kizimov
Copy link

This PR is an attempt to make the argocd app manifests command run completely local, a pre-rendered file with app objects is required for correct operation.
I hope, this PR should close #11129

example command run:
argocd app manifests my-app-name --local-app-manifest /repo/my-app/application/my-app.yaml --local /repo/my-app/manifests --local-repo-root /repo/my-app

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

Please see Contribution FAQs if you have questions about your pull-request.

@Sergey-Kizimov Sergey-Kizimov changed the title Allow users to template and render Application's resources fully locally feat: Allow users to template and render Application's resources fully locally Jul 6, 2023
@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

❌ Patch coverage is 0.95238% with 104 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.83%. Comparing base (15254af) to head (2dfff9a).
⚠️ Report is 3141 commits behind head on master.

Files with missing lines Patch % Lines
cmd/argocd/commands/app.go 0.00% 68 Missing ⚠️
cmd/util/app.go 2.77% 35 Missing ⚠️
cmd/argocd/commands/admin/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14365      +/-   ##
==========================================
- Coverage   49.90%   49.83%   -0.07%     
==========================================
  Files         262      262              
  Lines       45129    45192      +63     
==========================================
  Hits        22523    22523              
- Misses      20391    20454      +63     
  Partials     2215     2215              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sergey-Kizimov Sergey-Kizimov marked this pull request as ready for review July 6, 2023 22:32
@Sergey-Kizimov Sergey-Kizimov force-pushed the i-11129 branch 2 times, most recently from 3e7c83d to b401302 Compare July 7, 2023 17:37
}
if appName != "" && appName != app.Name {
app.Name = appName
filteredApps := make([]*argoappv1.Application, 0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can filter by application name from 1 file with multiple applications

Signed-off-by: Sergey-Kizimov <sergey.kizimov@hiya.com>
Signed-off-by: Sergey-Kizimov <sergey.kizimov@hiya.com>
Signed-off-by: Sergey-Kizimov <sergey.kizimov@hiya.com>
Signed-off-by: Sergey-Kizimov <sergey.kizimov@hiya.com>
Signed-off-by: Sergey-Kizimov <sergey.kizimov@hiya.com>
@savar
Copy link

savar commented Jan 10, 2024

Is there any plan to merge this?

@pkalemba
Copy link

Can we merge this?

appName = args[0]
}

if appName == app.Name {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a separate filterByAppName?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in case the file given as --local-app-manifest contains multiple YAML documents.

@nerdware-timmmi
Copy link

Again the question is: Is there any plan to merge this?

I would be very happy about the addition of this feature.

@reggie-k reggie-k added this to the v3.1 milestone Mar 23, 2025
@crenshaw-dev crenshaw-dev requested review from a team as code owners May 7, 2025 21:51
@agaudreault
Copy link
Member

agaudreault commented Jun 12, 2025

Since this is a command that should run 100% locally, it is a very good candidate to use with the new cli-plugin feature
https://argo-cd.readthedocs.io/en/latest/user-guide/plugins/. It will avoid the current command from being cluttered with arguments that are or may be necessary for local generation in the future.

Many parameters in the config map can affect the application generation. The constraint to not have access to these config will need to be resolved by either providing them as arguments, or as a configFile.

I will close this PR, but let the issue open.

@pkalemba
Copy link

@agaudreault Correct me if I'm wrong, but my understanding was that we intended to use ArgoCD's internal flow for rendering manifests. If we use a plugin, we would need to replicate that flow, which essentially means re-implementing core ArgoCD functionality. Is that correct?

@agaudreault
Copy link
Member

agaudreault commented Jun 13, 2025

@pkalemba you can write a go application that will reuse the argo libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to template and render Application's resources offline

9 participants