Skip to content

Commit

Permalink
dev-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Maho Takara committed Feb 16, 2024
1 parent 0d3d9fc commit 4a923dd
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 7 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ docker-create:

# Build the docker image
docker-build:
# docker buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} .
docker buildx build --platform="linux/arm64" -t ${IMG} .
docker buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} .

# Push the docker image
docker-push:
# docker buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} .
docker buildx build --push --platform="linux/arm64" -t ${IMG} .
docker buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} .

# Download controller-gen locally if necessary
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
Expand Down Expand Up @@ -156,4 +154,4 @@ e2e-test: e2e-kind-setup install-kuttl

.PHONY: integration-test-setup
integration-test-setup:
./hack/integrationSetup.sh
./hack/integrationSetup.sh
41 changes: 41 additions & 0 deletions k8sutils/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,47 @@ func TestGenerateServiceDef(t *testing.T) {
},
},
},
{
name: "Test replication-master with ClusterIP service type",
serviceMeta: metav1.ObjectMeta{
Name: "test-redis-replication-master",
Labels: map[string]string{
"redis-role": "master",
},
},
enableMetrics: disableMetrics,
headless: false,
serviceType: "ClusterIP",
port: redisPort,
expected: &corev1.Service{
TypeMeta: metav1.TypeMeta{
Kind: "Service",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "test-redis-replication-master",
Labels: map[string]string{
"redis-role": "master",
},
OwnerReferences: []metav1.OwnerReference{
{},
},
},
Spec: corev1.ServiceSpec{
Ports: []corev1.ServicePort{
{
Name: "redis-client",
Port: redisPort,
TargetPort: intstr.FromInt(int(redisPort)),
Protocol: corev1.ProtocolTCP,
},
},
Selector: map[string]string{"redis-role": "master"},
ClusterIP: "",
Type: corev1.ServiceTypeClusterIP,
},
},
},
}

for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion takara/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"sto
kubectl create ns ot-operators
helm install redis-operator ot-helm/redis-operator --namespace ot-operators -f values.yaml
helm install redis-replication ot-helm/redis-replication --set redisreplication.clusterSize=3 --namespace ot-operators

helm install redis-sentinel ot-helm/redis-sentinel --set redissentinel.clusterSize=3 --namespace ot-operators --set redisSentinelConfig.redisReplicationName="redis-replication"

minikube delete
1 change: 0 additions & 1 deletion takara/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
redisOperator:
name: redis-operator
# imageName: quay.io/opstree/redis-operator
imageName: ghcr.io/takara9/redis-operator
# Overrides the image tag whose default is the chart appVersion.
imageTag: "v0.15.2"
Expand Down

0 comments on commit 4a923dd

Please sign in to comment.