Skip to content

Commit

Permalink
Changed minio as per the new interface definition
Browse files Browse the repository at this point in the history
Signed-off-by: Swarvanu Sengupta <[email protected]>
  • Loading branch information
s8sg committed Nov 21, 2018
1 parent 05aa1df commit ced2820
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@ func Init(endpoint, region, secretKeySecretPath, accessKeySecretPath string, tls
return minioDataStore, nil
}

func (minioStore *MinioDataStore) Init(flowName string, requestId string) error {
func (minioStore *MinioDataStore) Configure(flowName string, requestId string) {
bucketName := fmt.Sprintf("faasflow-%s-%s", flowName, requestId)

minioStore.bucketName = bucketName
}

func (minioStore *MinioDataStore) Init() error {
if minioStore.minioClient == nil {
return fmt.Errorf("minio client not initialized, use GetMinioDataStore()")
}

bucketName := fmt.Sprintf("faasflow-%s-%s", flowName, requestId)

minioStore.bucketName = bucketName
err := minioStore.minioClient.MakeBucket(bucketName, minioStore.region)
err := minioStore.minioClient.MakeBucket(minioStore.bucketName, minioStore.region)
if err != nil {
return fmt.Errorf("error creating: %s, error: %s", minioStore.bucketName, err.Error())
}
Expand Down

0 comments on commit ced2820

Please sign in to comment.