Update openssl package to version openssl-1.1.1j-r0, because current version
has an SSL related security vulnerability. DBAAS doesn't use SSL so we
shouldn't face the issue but anyhow better to fix it. More information about
the issue can be found from here:
libcrypto1.1 (fixed in: 1.1.1i-r0)(CVE-2020-1971)
libssl1.1 (fixed in: 1.1.1i-r0)(CVE-2020-1971)
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1971)
Fixed also DBAAS testing application compile issue due to redis-client
dependency issue with the latest version of the go.opentelemetry.io/otel
package.
Issue-ID: RIC-755
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Icc1206c6c435a88217aea407b574fc5865e59ae8
# This file is expected to be in the docker build directory;
# can be moved with suitable JJB configuration.
---
# This file is expected to be in the docker build directory;
# can be moved with suitable JJB configuration.
---
FROM redis:5.0.9-alpine3.11 as build
FROM redis:5.0.9-alpine3.11 as build
+RUN apk add --upgrade openssl
RUN apk add curl
COPY --from=build-env /usr/local/libexec/redismodule/libredismodule.so /usr/local/libexec/redismodule/libredismodule.so
WORKDIR /data
RUN apk add curl
COPY --from=build-env /usr/local/libexec/redismodule/libredismodule.so /usr/local/libexec/redismodule/libredismodule.so
WORKDIR /data
apt install -y redis-tools && \
apt install -y git && \
apt install -y wget && \
apt install -y redis-tools && \
apt install -y git && \
apt install -y wget && \
- wget https://dl.google.com/go/go1.15.6.linux-amd64.tar.gz && \
- tar -xvf go1.15.6.linux-amd64.tar.gz && \
+ wget https://golang.org/dl/go1.12.17.linux-amd64.tar.gz && \
+ tar -xvf go1.12.17.linux-amd64.tar.gz && \
mv go /usr/local && \
apt-get clean
mv go /usr/local && \
apt-get clean
# Install go testapplication
RUN export GOROOT=/usr/local/go && \
# Install go testapplication
RUN export GOROOT=/usr/local/go && \
- export GOPATH=$HOME/Projects/Proj1 && \
- export PATH=$GOPATH/bin:$GOROOT/bin:$PATH && \
+ export PATH=$GOROOT/bin:$PATH && \
+ export GO111MODULE=on && \
go get github.com/go-redis/redis && \
go get github.com/go-redis/redis && \
- go build /testapplication/go/testapp.go
+ cd /testapplication/go/ && \
+ go build ./...
# Keep the container alive
ENTRYPOINT ["tail", "-f", "/dev/null"]
# Keep the container alive
ENTRYPOINT ["tail", "-f", "/dev/null"]
Version history
---------------
Version history
---------------
+[0.5.1] - 2021-02-25
+
+* Upgrade SSL version to 1.1.1j-r0 to fix possible SSL security vulnerability.
+* Fix DBAAS testing application compile issue.
+
[0.5.0] - 2020-12-11
* Upgrade DBAAS container's base Redis image to redis:5.0.9-alpine3.11.
[0.5.0] - 2020-12-11
* Upgrade DBAAS container's base Redis image to redis:5.0.9-alpine3.11.
--- /dev/null
+module testapp
+
+go 1.12
+
+require github.com/go-redis/redis v6.15.9+incompatible
+
+replace go.opentelemetry.io/otel => go.opentelemetry.io/otel v0.16.0
func (s *SdlInstance) CheckRedisModuleExtensionCommands() {
var moduleError bool
func (s *SdlInstance) CheckRedisModuleExtensionCommands() {
var moduleError bool
- commands, err := s.client.Command(s.client.Context()).Result()
+ commands, err := s.client.Command().Result()
if err == nil {
redisModuleCommands := []string{
if err == nil {
redisModuleCommands := []string{
- "setie", "delie", "setiepub", "setnxpub",
- "msetmpub", "delmpub",
+ "setie", "delie", "setiepub", "deliepub",
+ "setnxpub", "msetmpub", "delmpub",
}
for _, v := range redisModuleCommands {
_, ok := commands[v]
}
for _, v := range redisModuleCommands {
_, ok := commands[v]
+func checkResultAndError(result interface{}, err error) (bool, error) {
+ if err != nil {
+ if err == redis.Nil {
+ return false, nil
+ }
+ return false, err
+ }
+ if result == "OK" {
+ return true, nil
+ }
+ return false, nil
+}
+
func (s *SdlInstance) Set(pairs ...interface{}) error {
keyAndData := s.setNamespaceToKeys(pairs...)
func (s *SdlInstance) Set(pairs ...interface{}) error {
keyAndData := s.setNamespaceToKeys(pairs...)
- err := s.client.MSet(s.client.Context(), keyAndData...).Err()
+ err := s.client.MSet(keyAndData...).Err()
for _, v := range keys {
keysWithNs = append(keysWithNs, s.nsPrefix+v)
}
for _, v := range keys {
keysWithNs = append(keysWithNs, s.nsPrefix+v)
}
- val, err := s.client.MGet(s.client.Context(), keysWithNs...).Result()
+ val, err := s.client.MGet(keysWithNs...).Result()
m := make(map[string]interface{})
if err != nil {
return m, err
m := make(map[string]interface{})
if err != nil {
return m, err
-func (s *SdlInstance) SetIf(key string, oldData, newData interface{}) {
- panic("SetIf not implemented\n")
+func (s *SdlInstance) SetIf(key string, oldData, newData interface{}) (bool, error) {
+ return checkResultAndError(s.client.Do("SETIE", key, newData, oldData).Result())
}
func (s *SdlInstance) SetIfiNotExists(key string, data interface{}) {
}
func (s *SdlInstance) SetIfiNotExists(key string, data interface{}) {
fmt.Printf("unable to write to DB\n")
}
fmt.Printf("unable to write to DB\n")
}
+ _, err = sdl1.SetIf("key1", "data1", "data2")
+ if err != nil {
+ fmt.Printf("unable to write to DB\n")
+ }
+
retDataMap, err := sdl1.Get([]string{"key1", "key3", "key2"})
if err != nil {
fmt.Printf("Unable to read from DB\n")
retDataMap, err := sdl1.Get([]string{"key1", "key3", "key2"})
if err != nil {
fmt.Printf("Unable to read from DB\n")