Skip to content

Commit e93a030

Browse files
authored
Merge pull request #499 from spotahome/error-messages
Fix error messages and handling
2 parents 5d1cd3e + 0e7d6e3 commit e93a030

File tree

7 files changed

+8
-82
lines changed

7 files changed

+8
-82
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v3
2424
- uses: actions/setup-go@v3
2525
with:
26-
go-version: 1.17
26+
go-version: 1.19
2727
- run: make ci-unit-test
2828

2929
integration-test:
@@ -37,7 +37,7 @@ jobs:
3737
- uses: actions/checkout@v3
3838
- uses: actions/setup-go@v3
3939
with:
40-
go-version: 1.17
40+
go-version: 1.19
4141
- name: Install conntrack
4242
run: sudo apt-get install -y conntrack
4343
- uses: medyagh/[email protected]

docker/app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS build
1+
FROM --platform=$BUILDPLATFORM golang:1.19-alpine AS build
22
RUN apk --no-cache add \
33
bash
44

docker/development/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17-alpine
1+
FROM golang:1.19-alpine
22

33
ENV CODEGEN_VERSION="1.11.9"
44

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/spotahome/redis-operator
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/go-redis/redis/v8 v8.11.5

go.sum

Lines changed: 0 additions & 74 deletions
Large diffs are not rendered by default.

service/k8s/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ func (s *ServiceService) UpdateService(namespace string, service *corev1.Service
8282
}
8383
func (s *ServiceService) CreateOrUpdateService(namespace string, service *corev1.Service) error {
8484
storedService, err := s.GetService(namespace, service.Name)
85-
log.Errorf("Error while getting service %v in %v namespace : %v", service.GetName(), namespace, err)
8685
if err != nil {
8786
// If no resource we need to create.
8887
if errors.IsNotFound(err) {
8988
return s.CreateService(namespace, service)
9089
}
90+
log.Errorf("Error while updating service %v in %v namespace : %v", service.GetName(), namespace, err)
9191
return err
9292
}
9393

service/redis/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ func (c *client) GetSlaveOf(ip, port, password string) (string, error) {
173173
info, err := rClient.Info(context.TODO(), "replication").Result()
174174
if err != nil {
175175
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.FAIL, getRedisError(err))
176+
log.Errorf("error while getting masterIP : Failed to get info replication while querying redis instance %v", ip)
176177
return "", err
177178
}
178179
match := redisMasterHostRE.FindStringSubmatch(info)
179180
if len(match) == 0 {
180-
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.FAIL, metrics.REGEX_NOT_FOUND)
181-
log.Errorf("error while getting masterIP : No match for for %v while querying redis instance %v for replication info", redisMasterHostREString, ip)
181+
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.SUCCESS, metrics.NOT_APPLICABLE)
182182
return "", nil
183183
}
184184
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.SUCCESS, metrics.NOT_APPLICABLE)

0 commit comments

Comments
 (0)