diff --git a/.github/workflows/operator-ci.yaml b/.github/workflows/operator-ci.yaml index 86e32aa14..205339b76 100644 --- a/.github/workflows/operator-ci.yaml +++ b/.github/workflows/operator-ci.yaml @@ -57,10 +57,10 @@ jobs: - name: Run Go Tests with coverage run: go test ./... -coverprofile=coverage.txt -covermode=atomic - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: file: ./coverage.txt - fail_ci_if_error: true + fail_ci_if_error: false verbose: true code_quality_golang_ci_lint: diff --git a/tests/e2e/v1beta2/setup/redis-replication/00-install.yaml b/tests/e2e/v1beta2/setup/redis-replication/00-install.yaml new file mode 100644 index 000000000..19b92e39d --- /dev/null +++ b/tests/e2e/v1beta2/setup/redis-replication/00-install.yaml @@ -0,0 +1,8 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: + - replication.yaml +assert: + - ready-sts.yaml + - ready-pvc.yaml + - ready-svc.yaml \ No newline at end of file diff --git a/tests/e2e/v1beta2/setup/redis-replication/ready-pvc.yaml b/tests/e2e/v1beta2/setup/redis-replication/ready-pvc.yaml new file mode 100644 index 000000000..f57cb3f61 --- /dev/null +++ b/tests/e2e/v1beta2/setup/redis-replication/ready-pvc.yaml @@ -0,0 +1,44 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-replication-redis-replication-0 + labels: + app: redis-replication + redis_setup_type: replication + role: replication +status: + accessModes: + - ReadWriteOnce + capacity: + storage: 1Gi + phase: Bound +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-replication-redis-replication-1 + labels: + app: redis-replication + redis_setup_type: replication + role: replication +status: + accessModes: + - ReadWriteOnce + capacity: + storage: 1Gi + phase: Bound +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-replication-redis-replication-2 + labels: + app: redis-replication + redis_setup_type: replication + role: replication +status: + accessModes: + - ReadWriteOnce + capacity: + storage: 1Gi + phase: Bound diff --git a/tests/e2e/v1beta2/setup/redis-replication/ready-sts.yaml b/tests/e2e/v1beta2/setup/redis-replication/ready-sts.yaml new file mode 100644 index 000000000..f2ac67b1a --- /dev/null +++ b/tests/e2e/v1beta2/setup/redis-replication/ready-sts.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + annotations: + redis.opstreelabs.in: "true" + redis.opstreelabs.instance: redis-replication + labels: + app: redis-replication + redis_setup_type: replication + role: replication + name: redis-replication + ownerReferences: + - apiVersion: redis.redis.opstreelabs.in/v1beta2 + controller: true + kind: RedisReplication + name: redis-replication +status: + readyReplicas: 3 + replicas: 3 \ No newline at end of file diff --git a/tests/e2e/v1beta2/setup/redis-replication/ready-svc.yaml b/tests/e2e/v1beta2/setup/redis-replication/ready-svc.yaml new file mode 100644 index 000000000..707a8df9b --- /dev/null +++ b/tests/e2e/v1beta2/setup/redis-replication/ready-svc.yaml @@ -0,0 +1,90 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/port: "9121" + prometheus.io/scrape: "true" + redis.opstreelabs.in: "true" + redis.opstreelabs.instance: redis-replication + labels: + app: redis-replication + redis_setup_type: replication + role: replication + name: redis-replication + ownerReferences: + - apiVersion: redis.redis.opstreelabs.in/v1beta2 + controller: true + kind: RedisReplication + name: redis-replication +spec: + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-replication + redis_setup_type: replication + role: replication + type: ClusterIP +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/port: "9121" + prometheus.io/scrape: "true" + redis.opstreelabs.in: "true" + redis.opstreelabs.instance: redis-replication + labels: + app: redis-replication + redis_setup_type: replication + role: replication + name: redis-replication-additional + ownerReferences: + - apiVersion: redis.redis.opstreelabs.in/v1beta2 + controller: true + kind: RedisReplication + name: redis-replication +spec: + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-replication + redis_setup_type: replication + role: replication + type: ClusterIP +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/port: "9121" + prometheus.io/scrape: "true" + redis.opstreelabs.in: "true" + redis.opstreelabs.instance: redis-replication + labels: + app: redis-replication + redis_setup_type: replication + role: replication + name: redis-replication-headless + ownerReferences: + - apiVersion: redis.redis.opstreelabs.in/v1beta2 + controller: true + kind: RedisReplication + name: redis-replication +spec: + clusterIP: None + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-replication + redis_setup_type: replication + role: replication + type: ClusterIP \ No newline at end of file diff --git a/tests/e2e/v1beta2/setup/redis-replication/replication.yaml b/tests/e2e/v1beta2/setup/redis-replication/replication.yaml new file mode 100644 index 000000000..8e4ba0705 --- /dev/null +++ b/tests/e2e/v1beta2/setup/redis-replication/replication.yaml @@ -0,0 +1,38 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:latest + imagePullPolicy: Always + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi \ No newline at end of file