Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error messages and handling #499

Merged
merged 3 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.19
- run: make ci-unit-test

integration-test:
Expand All @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.19
- name: Install conntrack
run: sudo apt-get install -y conntrack
- uses: medyagh/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS build
FROM --platform=$BUILDPLATFORM golang:1.19-alpine AS build
RUN apk --no-cache add \
bash

Expand Down
2 changes: 1 addition & 1 deletion docker/development/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine
FROM golang:1.19-alpine

ENV CODEGEN_VERSION="1.11.9"

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/spotahome/redis-operator

go 1.17
go 1.19

require (
github.com/go-redis/redis/v8 v8.11.5
Expand Down
74 changes: 0 additions & 74 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion service/k8s/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ func (s *ServiceService) UpdateService(namespace string, service *corev1.Service
}
func (s *ServiceService) CreateOrUpdateService(namespace string, service *corev1.Service) error {
storedService, err := s.GetService(namespace, service.Name)
log.Errorf("Error while getting service %v in %v namespace : %v", service.GetName(), namespace, err)
if err != nil {
// If no resource we need to create.
if errors.IsNotFound(err) {
return s.CreateService(namespace, service)
}
log.Errorf("Error while updating service %v in %v namespace : %v", service.GetName(), namespace, err)
return err
}

Expand Down
4 changes: 2 additions & 2 deletions service/redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ func (c *client) GetSlaveOf(ip, port, password string) (string, error) {
info, err := rClient.Info(context.TODO(), "replication").Result()
if err != nil {
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.FAIL, getRedisError(err))
log.Errorf("error while getting masterIP : Failed to get info replication while querying redis instance %v", ip)
return "", err
}
match := redisMasterHostRE.FindStringSubmatch(info)
if len(match) == 0 {
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.FAIL, metrics.REGEX_NOT_FOUND)
log.Errorf("error while getting masterIP : No match for for %v while querying redis instance %v for replication info", redisMasterHostREString, ip)
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.SUCCESS, metrics.NOT_APPLICABLE)
return "", nil
}
c.metricsRecorder.RecordRedisOperation(metrics.KIND_REDIS, ip, metrics.GET_SLAVE_OF, metrics.SUCCESS, metrics.NOT_APPLICABLE)
Expand Down