-
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
Issue #2261 - Refactor Helm first class support #2364
Conversation
bf1193f
to
45d097c
Compare
Codecov Report
@@ Coverage Diff @@
## master #2364 +/- ##
==========================================
- Coverage 38.8% 37.25% -1.55%
==========================================
Files 109 103 -6
Lines 14197 14146 -51
==========================================
- Hits 5509 5270 -239
- Misses 7970 8203 +233
+ Partials 718 673 -45
Continue to review full report at Codecov.
|
45d097c
to
db915a2
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.
I've only some minor comments really. A couple of areas to watch out for:
- I found that there was not much in the way of tests around caching, so be wary of changes in those areas.
- I feel more confident about performance with these changes as we can optimize where we need to.
@@ -110,6 +110,12 @@ type ApplicationSource struct { | |||
Directory *ApplicationSourceDirectory `json:"directory,omitempty" protobuf:"bytes,10,opt,name=directory"` | |||
// ConfigManagementPlugin holds config management plugin specific options | |||
Plugin *ApplicationSourcePlugin `json:"plugin,omitempty" protobuf:"bytes,11,opt,name=plugin"` | |||
// Chart is a Helm chart name | |||
Chart string `json:"chart,omitempty" protobuf:"bytes,12,opt,name=chart"` |
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.
one thought, what about
spec:
source:
helm:
chart: my-chart
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 like it in general, but spec still looks unclean if we introduce helm
and keep path
and targetRevision
.
I would deprecate and migration chart
, targetRevision
and path
, targetRevision
to
# one of
source:
helm:
chart: my-chart
version: my-version
git:
path: my-path
revision: my-revision
Is it ok to create ticket and migrate both when we are ready?
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.
sure, I still think we need more user feedback on this feature as a priority over perfection
s.repoLock.Lock(repoPath) | ||
defer s.repoLock.Unlock(repoPath) | ||
|
||
err := os.Mkdir(repoPath, 0700) |
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 seem to recall someone concerned about permissions, is 0700
correct?
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 think that was this comment: #1865 (comment) . The suggestion was to change 0777
to 0700
|
||
message HelmChart { | ||
string name = 1; | ||
repeated string versions = 2; |
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.
nice
@@ -158,26 +156,38 @@ func (s *Server) GetAppDetails(ctx context.Context, q *repositorypkg.RepoAppDeta | |||
return nil, err | |||
} | |||
return repoClient.GetAppDetails(ctx, &apiclient.RepoServerAppDetailsQuery{ | |||
Repo: repo, |
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've found a few places in the code where you have to pass values around for it to work correctly, and where unit tests won't go red. This could be one of the places.
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 for pointing to this method. Noticed that we don't set Plugins
field here and discovered at field is not required at all. Removed it.
cmd/argocd/commands/app.go
Outdated
@@ -593,7 +596,8 @@ type appOptions struct { | |||
|
|||
func addAppFlags(command *cobra.Command, opts *appOptions) { | |||
command.Flags().StringVar(&opts.repoURL, "repo", "", "Repository URL, ignored if a file is set") | |||
command.Flags().StringVar(&opts.appPath, "path", "", "Path in repository to the ksonnet app directory, ignored if a file is set") | |||
command.Flags().StringVar(&opts.appPath, "path", "", "Path in repository to the app directory, ignored if a file is set") | |||
command.Flags().StringVar(&opts.chart, "chart", "", "Chart is a Helm Chart name") |
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.
maybe --helm-chart
?
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.
agree. This is more in line with other helm related flags. Changed
message KsonnetAppDetailsQuery { | ||
string environment = 1; | ||
github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ApplicationSource source = 2; | ||
repeated github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository repos = 3; |
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.
nice
@@ -1,24 +0,0 @@ | |||
package repo |
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.
don't you want these tests, but move them?
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.
oh, nice catch. thank you!
db915a2
to
3cd57dd
Compare
e132474
to
2d2d85c
Compare
9c3afed
to
a9872aa
Compare
@alexec , do you want to make any other changes in this PR? Can I get approval please? |
@@ -1 +1 @@ | |||
1.1.2 |
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.
what's this?
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.
This file is used to override the value of a version
constant in https://github.com/argoproj/argo-cd/blob/master/common/version.go#L11
PR refactors Helm first-class support.
Following major changes are implemented:
chart
field to the application source definition. If chart field is specified the argo cd assumes the application uses Helm repo. This improves user experience and replaces repo type autodetection.ListApps
support only git repo.ListApps
is used only in UI and UI is different in case of Helm.GetRevisionMetadata
support only git repo. Git commit metadata is different from helm chart metadata. There is no author, tags, message message in helm chart metadata.GetHelmCharts
which is used to power app creation UIFollowing issues are solved: