Skip to content

Commit

Permalink
Merge pull request #516 from kube-tarian/repo-name-tools
Browse files Browse the repository at this point in the history
hard coded repo name to tools
  • Loading branch information
vramk23 authored Jun 15, 2024
2 parents 488250a + 0b210cb commit daa3d23
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion capten/agent/internal/api/app_values_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func deriveTemplateValues(overrideValues, templateValues []byte) ([]byte, error)
func prepareAppDeployRequestFromSyncApp(data *agentpb.SyncAppData, values []byte) *model.ApplicationInstallRequest {
return &model.ApplicationInstallRequest{
PluginName: "helm",
RepoName: data.Config.RepoName,
RepoName: prepareRepoName(data),
RepoURL: data.Config.RepoURL,
ChartName: data.Config.ChartName,
Namespace: data.Config.Namespace,
Expand All @@ -268,3 +268,13 @@ func prepareAppDeployRequestFromSyncApp(data *agentpb.SyncAppData, values []byte
Timeout: 10,
}
}

func prepareRepoName(appConfig *agentpb.SyncAppData) string {
repoInfo := strings.Split(appConfig.Config.ChartName, "/")

if len(repoInfo) != 2 {
// AppName don't have repo name, so using chartName as repoName
repoInfo = []string{appConfig.Config.ChartName, appConfig.Config.ChartName}
}
return repoInfo[0]
}

0 comments on commit daa3d23

Please sign in to comment.