File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ func (in *S3Spec) String() string {
135135 if in .Endpoint != "" {
136136 endpoint = in .Endpoint
137137 }
138+ endpoint = strings .TrimRight (endpoint , "/" )
138139
139140 bucket := cfg .Config .GlobalS3Bucket
140141 if in .Bucket != "" {
Original file line number Diff line number Diff line change @@ -96,6 +96,21 @@ var tests = map[string]struct {
9696 },
9797 expectedRepositoryString : "s3:https://endpoint/bucket" ,
9898 },
99+ "GivenS3BackendWithTrailingSlash_ThenExpectCleanEndpointURL" : {
100+ givenBackend : & Backend {
101+ S3 : & S3Spec {
102+ Bucket : "bucket" ,
103+ Endpoint : "https://endpoint/" ,
104+ SecretAccessKeySecretRef : newSecretRef ("secret" ),
105+ AccessKeyIDSecretRef : newSecretRef ("id" ),
106+ },
107+ },
108+ expectedVars : map [string ]* corev1.EnvVarSource {
109+ cfg .AwsAccessKeyIDEnvName : {SecretKeyRef : newSecretRef ("id" )},
110+ cfg .AwsSecretAccessKeyEnvName : {SecretKeyRef : newSecretRef ("secret" )},
111+ },
112+ expectedRepositoryString : "s3:https://endpoint/bucket" ,
113+ },
99114 "GivenSwiftBackend_ThenExpectSwiftBucket" : {
100115 givenBackend : & Backend {
101116 Swift : & SwiftSpec {
You can’t perform that action at this time.
0 commit comments