Skip to content
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

hard coded repo name to tools #516

Merged
merged 7 commits into from
Jun 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
}
Loading