Skip to content

Commit

Permalink
Fix failure in identifying app source type when path was '.' (argopro…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen authored Aug 1, 2018
1 parent 1fe870c commit b0d6a70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/argo/argo.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,13 @@ func queryAppSourceType(ctx context.Context, spec *argoappv1.ApplicationSpec, re
return "", err
}
for _, gitPath := range getRes.Items {
// gitPath may look like: app.yaml, or some/subpath/app.yaml
trimmedPath := strings.TrimPrefix(gitPath, spec.Source.Path)
if trimmedPath == "/app.yaml" {
trimmedPath = strings.TrimPrefix(trimmedPath, "/")
if trimmedPath == "app.yaml" {
return repository.AppSourceKsonnet, nil
}
if trimmedPath == "/Chart.yaml" {
if trimmedPath == "Chart.yaml" {
return repository.AppSourceHelm, nil
}
}
Expand Down

0 comments on commit b0d6a70

Please sign in to comment.