Skip to content

Commit cdcb92a

Browse files
authored
Merge pull request #36 from numtide/implement-multigateway-controller
Implement multigateway controller
2 parents 82054a1 + 97441bd commit cdcb92a

17 files changed

+1981
-136
lines changed

config/samples/sample.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: multigres-sample
5+
---
6+
apiVersion: multigres.com/v1alpha1
7+
kind: Etcd
8+
metadata:
9+
namespace: multigres-sample
10+
name: sample
11+
spec: {}

pkg/resource-handler/controller/etcd/etcd_env.go renamed to pkg/resource-handler/controller/etcd/container_env.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ import (
77
corev1 "k8s.io/api/core/v1"
88
)
99

10-
// buildEtcdEnv constructs all environment variables for etcd clustering in
10+
// buildContainerEnv constructs all environment variables for etcd clustering in
1111
// StatefulSets. This combines pod identity, etcd config, and cluster peer
1212
// discovery details.
13-
func buildEtcdEnv(etcdName, namespace string, replicas int32, serviceName string) []corev1.EnvVar {
13+
func buildContainerEnv(
14+
etcdName, namespace string,
15+
replicas int32,
16+
serviceName string,
17+
) []corev1.EnvVar {
1418
envVars := make([]corev1.EnvVar, 0)
1519

1620
// Add pod identity variables from downward API

pkg/resource-handler/controller/etcd/etcd_env_test.go renamed to pkg/resource-handler/controller/etcd/container_env_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func TestBuildEtcdClusterPeerList(t *testing.T) {
178178
}
179179
}
180180

181-
func TestBuildEtcdEnv(t *testing.T) {
181+
func TestBuildContainerEnv(t *testing.T) {
182182
tests := map[string]struct {
183183
etcdName string
184184
namespace string
@@ -319,9 +319,9 @@ func TestBuildEtcdEnv(t *testing.T) {
319319

320320
for name, tc := range tests {
321321
t.Run(name, func(t *testing.T) {
322-
got := buildEtcdEnv(tc.etcdName, tc.namespace, tc.replicas, tc.serviceName)
322+
got := buildContainerEnv(tc.etcdName, tc.namespace, tc.replicas, tc.serviceName)
323323
if diff := cmp.Diff(tc.want, got); diff != "" {
324-
t.Errorf("BuildEtcdEnv() mismatch (-want +got):\n%s", diff)
324+
t.Errorf("BuildContainerEnv() mismatch (-want +got):\n%s", diff)
325325
}
326326
})
327327
}

0 commit comments

Comments
 (0)