Skip to content

Commit

Permalink
remove useless field
Browse files Browse the repository at this point in the history
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
  • Loading branch information
drivebyer committed Nov 6, 2023
1 parent f24e436 commit 0a342ef
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 35 deletions.
1 change: 0 additions & 1 deletion k8sutils/redis-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type RedisClusterService struct {
// generateRedisClusterParams generates Redis cluster information
func generateRedisClusterParams(cr *redisv1beta2.RedisCluster, replicas int32, externalConfig *string, params RedisClusterSTS) statefulSetParameters {
res := statefulSetParameters{
Metadata: cr.ObjectMeta,
Replicas: &replicas,
ClusterMode: true,
NodeConfVolume: cr.Spec.Storage.NodeConfVolume,
Expand Down
21 changes: 0 additions & 21 deletions k8sutils/redis-cluster_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package k8sutils

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"
"path/filepath"
"testing"
Expand All @@ -19,16 +18,6 @@ func Test_generateRedisClusterParams(t *testing.T) {
path := filepath.Join("..", "tests", "testdata", "redis-cluster.yaml")

expectedLeaderSTS := statefulSetParameters{
Metadata: metav1.ObjectMeta{
Name: "redis-cluster",
Namespace: "redis",
Labels: map[string]string{
"app": "redis-cluster",
},
Annotations: map[string]string{
"opstreelabs.in/redis": "true",
},
},
Replicas: pointer.Int32(3),
ClusterMode: true,
NodeConfVolume: true,
Expand Down Expand Up @@ -95,16 +84,6 @@ func Test_generateRedisClusterParams(t *testing.T) {
IgnoreAnnotations: []string{"opstreelabs.in/ignore"},
}
expectedFollowerSTS := statefulSetParameters{
Metadata: metav1.ObjectMeta{
Name: "redis-cluster",
Namespace: "redis",
Labels: map[string]string{
"app": "redis-cluster",
},
Annotations: map[string]string{
"opstreelabs.in/redis": "true",
},
},
Replicas: pointer.Int32(3),
ClusterMode: true,
NodeConfVolume: true,
Expand Down
1 change: 0 additions & 1 deletion k8sutils/redis-sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func (service RedisSentinelSTS) CreateRedisSentinelSetup(ctx context.Context, cr
func generateRedisSentinelParams(cr *redisv1beta2.RedisSentinel, replicas int32, externalConfig *string, affinity *corev1.Affinity) statefulSetParameters {

res := statefulSetParameters{
Metadata: cr.ObjectMeta,
Replicas: &replicas,
ClusterMode: false,
NodeConfVolume: false,
Expand Down
11 changes: 0 additions & 11 deletions k8sutils/redis-sentinel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package k8sutils

import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"
"path/filepath"
"testing"
Expand All @@ -19,16 +18,6 @@ import (
func Test_generateRedisSentinelParams(t *testing.T) {
path := filepath.Join("..", "tests", "testdata", "redis-sentinel.yaml")
expected := statefulSetParameters{
Metadata: metav1.ObjectMeta{
Name: "redis-sentinel",
Namespace: "redis",
Labels: map[string]string{
"app": "redis-sentinel",
},
Annotations: map[string]string{
"opstreelabs.in/redis": "true",
},
},
Replicas: pointer.Int32(3),
ClusterMode: false,
NodeConfVolume: false,
Expand Down
1 change: 0 additions & 1 deletion k8sutils/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type statefulSetParameters struct {
Replicas *int32
ClusterMode bool
NodeConfVolume bool
Metadata metav1.ObjectMeta
NodeSelector map[string]string
PodSecurityContext *corev1.PodSecurityContext
PriorityClassName string
Expand Down

0 comments on commit 0a342ef

Please sign in to comment.