Skip to content

Commit c3b4e4b

Browse files
author
Aaron Schlesinger
committed
ref(build.go,slug_builder_info.go): pass string s3 endpoint to NewSlugBuilderInfo
also add some GoDocs
1 parent 928ba5e commit c3b4e4b

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

pkg/gitreceive/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
6060
}
6161
tmpDir := os.TempDir()
6262

63-
slugBuilderInfo := storage.NewSlugBuilderInfo(s3Client, appName, slugName, gitSha)
63+
slugBuilderInfo := storage.NewSlugBuilderInfo(s3Client.Endpoint, appName, slugName, gitSha)
6464

6565
// Get the application config from the controller, so we can check for a custom buildpack URL
6666
appConf, err := getAppConfig(conf, builderKey, conf.Username, appName)

pkg/gitreceive/storage/slug_builder_info.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@ package storage
33
import (
44
"fmt"
55

6-
"github.com/aws/aws-sdk-go/service/s3"
76
"github.com/deis/builder/pkg/gitreceive/git"
87
)
98

9+
// SlugBuilderInfo contains all of the object storage related information needed to pass to a slug builder
1010
type SlugBuilderInfo struct {
1111
PushKey string
1212
PushURL string
1313
TarKey string
1414
TarURL string
1515
}
1616

17-
func NewSlugBuilderInfo(s3Client *s3.S3, appName, slugName string, gitSha *git.SHA) *SlugBuilderInfo {
17+
// NewSlugBuilderInfo creates and populates a new SlugBuilderInfo based on the given data
18+
func NewSlugBuilderInfo(s3Endpoint, appName, slugName string, gitSha *git.SHA) *SlugBuilderInfo {
1819
tarKey := fmt.Sprintf("home/%s/tar", slugName)
1920
// this is where workflow tells slugrunner to download the slug from, so we have to tell slugbuilder to upload it to here
2021
pushKey := fmt.Sprintf("home/%s/push", fmt.Sprintf("%s:git-%s", appName, gitSha.Short))
2122

2223
return &SlugBuilderInfo{
2324
PushKey: pushKey,
24-
PushURL: fmt.Sprintf("%s/%s", s3Client.Endpoint, pushKey),
25+
PushURL: fmt.Sprintf("%s/%s", s3Endpoint, pushKey),
2526
TarKey: tarKey,
26-
TarURL: fmt.Sprintf("%s/git/%s", s3Client.Endpoint, tarKey),
27+
TarURL: fmt.Sprintf("%s/git/%s", s3Endpoint, tarKey),
2728
}
2829
}

0 commit comments

Comments
 (0)