Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Fix error not returning from resolving chart data #198

Merged
merged 1 commit into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pkg/ship/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (s *Ship) Kustomize(ctx context.Context) error {
helmChartPath := s.Viper.GetString("chart")
helmChartMetadata, err := s.Resolver.ResolveChartMetadata(context.Background(), helmChartPath)
if err != nil {
errors.Wrapf(err, "resolve helm metadata for %s", helmChartPath)
return errors.Wrapf(err, "resolve helm metadata for %s", helmChartPath)
}

release := &api.Release{
Expand Down
6 changes: 3 additions & 3 deletions pkg/specs/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (g *GithubClient) GetChartAndReadmeContents(ctx context.Context, chartURLSt
}
}

return g.getAllFiles(ctx, owner, repo, path, "")
return g.getAllFiles(ctx, owner, repo, path, "/")
}

func (g *GithubClient) getAllFiles(ctx context.Context, owner string, repo string, basePath string, filePath string) error {
Expand All @@ -77,7 +77,7 @@ func (g *GithubClient) getAllFiles(ctx context.Context, owner string, repo strin
debug.Log("event", "getContents", "path", basePath)
_, dirContent, _, err := g.client.Repositories.GetContents(ctx, owner, repo, basePath, &github.RepositoryContentGetOptions{})
if err != nil {
return err
return errors.Wrapf(err, "initial get contents of owner - %s repo - %s", owner, repo)
}

for _, gitContent := range dirContent {
Expand Down Expand Up @@ -143,7 +143,7 @@ func (r *Resolver) ResolveChartMetadata(ctx context.Context, path string) (api.H
var md api.HelmChartMetadata
err := r.GithubClient.GetChartAndReadmeContents(ctx, path)
if err != nil {
return api.HelmChartMetadata{}, err
return api.HelmChartMetadata{}, errors.Wrapf(err, "get chart and read me at %s", path)
}

localChartPath := filepath.Join(constants.KustomizeHelmPath, "Chart.yaml")
Expand Down