-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support for preserving dependencies charts archives (#16725) #16750
base: master
Are you sure you want to change the base?
Conversation
996ea6b
to
df5a876
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #16750 +/- ##
==========================================
- Coverage 49.50% 49.32% -0.18%
==========================================
Files 271 274 +3
Lines 47793 48204 +411
==========================================
+ Hits 23658 23779 +121
- Misses 21796 22075 +279
- Partials 2339 2350 +11 ☔ View full report in Codecov by Sentry. |
df5a876
to
a25ecc6
Compare
d369544
to
54ec46b
Compare
54ec46b
to
5246b40
Compare
5246b40
to
69156f4
Compare
Signed-off-by: Raz Amir <[email protected]>
69156f4
to
2c4c9de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick glance, just one small change.
@@ -1364,6 +1402,12 @@ func WithCMPTarExcludedGlobs(excludedGlobs []string) GenerateManifestOpt { | |||
} | |||
} | |||
|
|||
func WithPreserveDependenciesChartsArchives(val bool) GenerateManifestOpt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a docstring here describing the flag?
Signed-off-by: Raz Amir <[email protected]>
33d5b01
to
2596276
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ramir-savvy !! Overall PR looks good. Just one comment.
@@ -209,6 +211,7 @@ func NewCommand() *cobra.Command { | |||
command.Flags().StringVar(&streamedManifestMaxExtractedSize, "streamed-manifest-max-extracted-size", env.StringFromEnv("ARGOCD_REPO_SERVER_STREAMED_MANIFEST_MAX_EXTRACTED_SIZE", "1G"), "Maximum size of streamed manifest archives when extracted") | |||
command.Flags().StringVar(&helmManifestMaxExtractedSize, "helm-manifest-max-extracted-size", env.StringFromEnv("ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE", "1G"), "Maximum size of helm manifest archives when extracted") | |||
command.Flags().BoolVar(&disableManifestMaxExtractedSize, "disable-helm-manifest-max-extracted-size", env.ParseBoolFromEnv("ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE", false), "Disable maximum size of helm manifest archives when extracted") | |||
command.Flags().BoolVar(&preserveDependenciesChartsArchives, "preserve-dependencies-charts-archives", env.ParseBoolFromEnv("ARGOCD_REPO_PRESERVE_DEPENDENCIES_CHARTS_ARCHIVES", false), "Preserve dependencies charts archives during refresh") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a new environment variable is added, can you add the variable to repo-server deployment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ishitasequeira!
I added the requested change and also added to additional manifest files that have similar functionality - let me know if I should keep or remove them and stay only with the file requested by you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed that question as I just learned that the other files are auto generated
Signed-off-by: Raz Amir <[email protected]>
b6c8407
to
6b94473
Compare
Signed-off-by: Raz Amir <[email protected]>
@ramir-savvy something I thought about: is this change going to allow an effective bypass of repo access restrictions? For example, if App A (via Project A) has access to Parent chart and Child chart, App A will be able to pull the private Child chart. And the App B (via Project B) which has access to only the Parent chart will automatically get access to the private Child chart, because the chart is saved and cached. Is my understanding correct? |
This looks like a desirable change to me, but I just wanted to confirm that is there a way to opt into pulling the latest dependency on a particular run. Say I have chart A that depends on chart B at "~> 1.0.0" I have 1.0.0 in cache, so dependency is satisfied. But a bugfix is published in 1.0.1 that I would like to make sure is included going forward. How would I accomplish that? Is that already covered under a force refresh or similar? |
@crenshaw-dev , I believe you are right, I overlooked the project separation. |
@jcogilvie , good point. I think that this one is also a limitation of this feature. Today, as far as I know, there is no way to force the repo refresh. The only way to do this is to restart the repo server. @crenshaw-dev , will be great to get your input on this one |
@crenshaw-dev, did you get the chance to think over the above concerns? |
This PR adds a feature to allow keeping the dependency charts
tgz
files. These files are deleted by default as part of thegit clean
operation that takes place during thecheckout
flow in the repo server.WIth this feature enabled, and with the default exclude pattern,
git clean
will be executed with the exclude flagHowever, keeping the
tgz
files isn't enough, if the dependency version has advanced, sincehelm template
doesn't check that and it succeeds anyway, and before this feature, for performance reasons,helm dependency build
is executed only ifhelm template
fails. Therefore, before runninghelm template
we need to verify that the dependency charts versions are satisfied, so a new call tohelm dependency list
is added, and if no,helm dependency rebuild
will be executed beforehelm template
- just if this exclude feature is enabled.--preserve-dependencies-charts-archives
flag added toargocd-repo-server
CLI.Closes: #16725
Checklist: