Skip to content

Commit

Permalink
Now init message has double slash
Browse files Browse the repository at this point in the history
  • Loading branch information
hmacias-avaya committed Jul 17, 2019
1 parent e6d13b3 commit c9bd6f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/helms3/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type proxyCmd struct {
uri string
}

const indexYaml = "index.yaml"

func (act proxyCmd) Run(ctx context.Context) error {
sess, err := awsutil.Session(awsutil.AssumeRoleTokenProvider(awsutil.StderrTokenProvider))
if err != nil {
Expand All @@ -25,8 +27,8 @@ func (act proxyCmd) Run(ctx context.Context) error {

b, err := storage.FetchRaw(ctx, act.uri)
if err != nil {
if strings.HasSuffix(act.uri, "index.yaml") && err == awss3.ErrObjectNotFound {
return fmt.Errorf("The index file does not exist by the path %s. If you haven't initialized the repository yet, try running \"helm s3 init %s\"", act.uri, path.Dir(act.uri))
if strings.HasSuffix(act.uri, indexYaml) && err == awss3.ErrObjectNotFound {
return fmt.Errorf("The index file does not exist by the path %s. If you haven't initialized the repository yet, try running \"helm s3 init %s\"", act.uri, act.uri[0:len(indexYaml)])
}
return errors.WithMessage(err, "fetch from s3")
}
Expand Down

0 comments on commit c9bd6f3

Please sign in to comment.