Skip to content

Commit

Permalink
Merge pull request #58 from vshn/connection-details
Browse files Browse the repository at this point in the history
Upper-case Redis connection details
  • Loading branch information
mweibel authored Nov 10, 2022
2 parents 6f53494 + bc96e19 commit 92d913a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions operator/rediscontroller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ func (ts *RedisControllerTestSuite) TestCreate() {
ts.FetchResource(types.NamespacedName{Name: mg.Spec.WriteConnectionSecretToReference.Name, Namespace: mg.Spec.WriteConnectionSecretToReference.Namespace}, secret)

ts.Assert().Equal("https://foo:bar@baz:5321", string(secret.Data["REDIS_URL"]))
ts.Assert().Equal("foo", string(secret.Data["username"]))
ts.Assert().Equal("bar", string(secret.Data["password"]))
ts.Assert().Equal("baz", string(secret.Data["host"]))
ts.Assert().Equal("5321", string(secret.Data["port"]))
ts.Assert().Equal("foo", string(secret.Data["REDIS_USERNAME"]))
ts.Assert().Equal("bar", string(secret.Data["REDIS_PASSWORD"]))
ts.Assert().Equal("baz", string(secret.Data["REDIS_HOST"]))
ts.Assert().Equal("5321", string(secret.Data["REDIS_PORT"]))
ts.Assert().Equal("certifyingliketheresnotomorrow", string(secret.Data["ca.crt"]))

instance := &exoscalev1.Redis{}
Expand Down
12 changes: 6 additions & 6 deletions operator/rediscontroller/observe.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ func connectionDetails(in oapi.DbaasServiceRedis, ca string) (map[string][]byte,
}
password, _ := parsed.User.Password()
return map[string][]byte{
"host": []byte(parsed.Hostname()),
"port": []byte(parsed.Port()),
"username": []byte(parsed.User.Username()),
"password": []byte(password),
"ca.crt": []byte(ca),
"REDIS_URL": []byte(uri),
"REDIS_HOST": []byte(parsed.Hostname()),
"REDIS_PORT": []byte(parsed.Port()),
"REDIS_USERNAME": []byte(parsed.User.Username()),
"REDIS_PASSWORD": []byte(password),
"REDIS_URL": []byte(uri),
"ca.crt": []byte(ca),
}, nil
}

Expand Down

0 comments on commit 92d913a

Please sign in to comment.