The following assumes the service broker is configured to use a custom S3 bucket. If the aws.key field during helm install is set to an empty string, i.e.
bl := AwsBroker{
...
s3key: addTrailingSlash(o.S3Key), // This sets s3key: "/" if o.S3Key = ""
...
}
I think the fix in addTrailingSlash should check if the string is empty before adding a trailing slash.
func addTrailingSlash(s string) string {
if s != "" && strings.HasSuffix(s, "/") == false { // add check to make sure `s` is not empty
s = s + "/"
}
return s
}
It's probably a good idea to trim whitespace here as well, although not sure if it's necessary (just thinking defensively).
To Reproduce
Install helm chart with --set aws.key=""
Expected behavior
Should provision resources normally.
Screenshots
None
Environment (please complete the following information):
Describe the bug
The following assumes the service broker is configured to use a custom S3 bucket. If the
aws.key
field during helm install is set to an empty string, i.e.Provisioning will fail with the following message (in the logs):
I believe I have narrowed to this specific line:
I think the fix in
addTrailingSlash
should check if the string is empty before adding a trailing slash.It's probably a good idea to trim whitespace here as well, although not sure if it's necessary (just thinking defensively).
To Reproduce
Install helm chart with
--set aws.key=""
Expected behavior
Should provision resources normally.
Screenshots
None
Environment (please complete the following information):
Additional context
Nope