Skip to content

Commit

Permalink
fix: fix unit test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
chideat committed Aug 23, 2024
1 parent 8e18e39 commit e96ce1e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ bin/

.DS_Store
.vscode/*
default.etcd/
coverage.txt
bundle/*
bundle.Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ OPERATOR_SDK_VERSION ?= v1.32.0
# Image URL to use all building/pushing image targets
IMG ?= $(REGISTRY)/$(GROUP)/redis-operator:v$(VERSION)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.0
ENVTEST_K8S_VERSION = 1.28.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -188,7 +188,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
CONTROLLER_TOOLS_VERSION ?= v0.16.0
CONTROLLER_TOOLS_VERSION ?= latest

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
controller-gen.kubebuilder.io/version: v0.16.1
name: redisfailovers.databases.spotahome.com
spec:
group: databases.spotahome.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
controller-gen.kubebuilder.io/version: v0.16.1
name: redissentinels.databases.spotahome.com
spec:
group: databases.spotahome.com
Expand Down
6 changes: 2 additions & 4 deletions config/crd/bases/middleware.alauda.io_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
controller-gen.kubebuilder.io/version: v0.16.1
name: redis.middleware.alauda.io
spec:
group: middleware.alauda.io
Expand Down Expand Up @@ -1326,9 +1326,7 @@ spec:
format: int32
type: integer
protocol:
allOf:
- default: TCP
- default: TCP
default: TCP
description: |-
The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
Default is TCP.
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/redis.kun_distributedredisclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
controller-gen.kubebuilder.io/version: v0.16.1
name: distributedredisclusters.redis.kun
spec:
group: redis.kun
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.0
controller-gen.kubebuilder.io/version: v0.16.1
name: redisusers.redis.middleware.alauda.io
spec:
group: redis.middleware.alauda.io
Expand Down
5 changes: 5 additions & 0 deletions pkg/redis/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ func TestParseNodeFromClusterNode(t *testing.T) {
Id: "33b1262d41a4d9c27a78eef522c84999b064ce7f",
Addr: "",
RawFlag: "myself,master",
BusPort: "16379",
AuxFields: ClusterNodeAuxFields{raw: ":6379@16379"},
Role: "master",
MasterId: "",
PingSend: 0,
PongRecv: 0,
Epoch: 0,
LinkState: "connected",
slots: []string{},
rawInfo: "33b1262d41a4d9c27a78eef522c84999b064ce7f :6379@16379 myself,master - 0 0 0 connected",
},
wantErr: false,
},
Expand Down

0 comments on commit e96ce1e

Please sign in to comment.