Skip to content

Commit

Permalink
save maintainer, sources and keywords to etcd
Browse files Browse the repository at this point in the history
  • Loading branch information
LiHui committed Sep 22, 2021
1 parent f35f2c6 commit 49ab1fb
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions cmd/import-app/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,14 @@ func (wf *ImportWorkFlow) CreateAppVer(ctx context.Context, app *v1alpha1.HelmAp
},
Spec: v1alpha1.HelmApplicationVersionSpec{
Metadata: &v1alpha1.Metadata{
Name: chrt.Name(),
Version: chrt.Metadata.Version,
AppVersion: chrt.Metadata.AppVersion,
Name: chrt.Name(),
Version: chrt.Metadata.Version,
AppVersion: chrt.Metadata.AppVersion,
Icon: chrt.Metadata.Icon,
Home: chrt.Metadata.Home,
Sources: chrt.Metadata.Sources,
Maintainers: translateMaintainers(chrt.Metadata.Maintainers),
Keywords: chrt.Metadata.Keywords,
},
DataKey: appVerId,
},
Expand All @@ -331,6 +336,19 @@ func (wf *ImportWorkFlow) CreateAppVer(ctx context.Context, app *v1alpha1.HelmAp
return wf.UpdateAppVersionStatus(ctx, existsAppVer)
}

func translateMaintainers(mt []*chart.Maintainer) []*v1alpha1.Maintainer {
ret := make([]*v1alpha1.Maintainer, 0, len(mt))
for _, value := range mt {
ret = append(ret, &v1alpha1.Maintainer{
Name: value.Name,
Email: value.Email,
URL: value.URL,
})
}

return ret
}

func (wf *ImportWorkFlow) UpdateAppNameInStore(ctx context.Context, app *v1alpha1.HelmApplication, name string) (err error) {
appId := fmt.Sprintf("%s-%s", app.Name, "store")

Expand Down

0 comments on commit 49ab1fb

Please sign in to comment.