Skip to content

Commit

Permalink
Merge pull request #127 from hellofresh/patch/new-secure-env
Browse files Browse the repository at this point in the history
Add AWS secure env
  • Loading branch information
diegomarangoni authored May 3, 2021
2 parents 37a89a3 + deda7bf commit 1945105
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/kangal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- performance tests
- tests runner
name: kangal
version: 2.0.1
version: 2.0.2
home: https://github.com/hellofresh/kangal
icon: https://raw.githubusercontent.com/hellofresh/kangal/master/logo.svg
maintainers:
Expand Down
2 changes: 2 additions & 0 deletions charts/kangal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ The following table lists the common configurable parameters for `Kangal` chart:
| `configmap.AWS_BUCKET_NAME` | The name of the bucket for saving reports | `my-bucket` |
| `configmap.AWS_ENDPOINT_URL` | Storage connection parameter | `s3.us-east-1.amazonaws.com` |
| `configmap.AWS_DEFAULT_REGION` | Storage connection parameter | `us-east-1` |
| `configmap.AWS_USE_HTTPS` | Set to "true" to use HTTPS | `false` |
| `configmap.AWS_PRESIGNED_EXPIRES` | Expiration time for Presigned URLs | `30m` |
| `configmap.JMETER_MASTER_IMAGE_NAME` | Default JMeter master image name/repository if none is provided when creating a new loadtest | `hellofresh/kangal-jmeter-master` |
| `configmap.JMETER_MASTER_IMAGE_TAG` | Tag of the JMeter master image above | `latest` |
| `configmap.JMETER_WORKER_IMAGE_NAME` | Default JMeter worker image name/repository if none is provided when creating a new loadtest | `hellofresh/kangal-jmeter-worker` |
Expand Down
1 change: 1 addition & 0 deletions pkg/report/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ type Config struct {
AWSRegion string `envconfig:"AWS_DEFAULT_REGION" default:""`
AWSEndpointURL string `envconfig:"AWS_ENDPOINT_URL" default:""`
AWSBucketName string `envconfig:"AWS_BUCKET_NAME" default:""`
AWSUseHTTPS bool `envconfig:"AWS_USE_HTTPS" default:"false"`
AWSPresignedExpires string `envconfig:"AWS_PRESIGNED_EXPIRES" default:""`
}
8 changes: 4 additions & 4 deletions pkg/report/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ func PersistHandler(kubeClient *kk8s.Client, logger *zap.Logger) func(w http.Res
}
defer proxyResp.Body.Close()

body := "Report persisted"

if http.StatusOK != proxyResp.StatusCode {
b, _ := ioutil.ReadAll(proxyResp.Body)
body = string(b)
logger.Error("Failed to persist report", zap.ByteString("error", b), zap.String("loadtest", loadTestName))
render.Render(w, r, khttp.ErrResponse(proxyResp.StatusCode, string(b)))
return
}

render.Status(r, proxyResp.StatusCode)
render.JSON(w, r, body)
render.JSON(w, r, "Report persisted")
}
}
2 changes: 1 addition & 1 deletion pkg/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func InitObjectStorageClient(cfg Config) error {
creds := credentials.NewChainCredentials(awsCredProviders)

// Init object storage (S3 compatible) client
minioClient, err = minio.NewWithCredentials(endpoint, creds, false, cfg.AWSRegion)
minioClient, err = minio.NewWithCredentials(endpoint, creds, cfg.AWSUseHTTPS, cfg.AWSRegion)
if err != nil {
return err
}
Expand Down

0 comments on commit 1945105

Please sign in to comment.