Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisnotashwin committed Jun 20, 2022
1 parent 58feac8 commit 03a1674
Show file tree
Hide file tree
Showing 14 changed files with 430 additions and 10 deletions.
10 changes: 10 additions & 0 deletions acceptance/tests/fixtures/bases/peering/peering-acceptor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: consul.hashicorp.com/v1alpha1
kind: PeeringAcceptor
metadata:
name: server
spec:
peer:
secret:
name: "api-token"
key: "data"
backend: "kubernetes"
10 changes: 10 additions & 0 deletions acceptance/tests/fixtures/bases/peering/peering-dialer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: consul.hashicorp.com/v1alpha1
kind: PeeringDialer
metadata:
name: client
spec:
peer:
secret:
name: "api-token"
key: "data"
backend: "kubernetes"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- ../../../bases/exportedservices-default

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: consul.hashicorp.com/v1alpha1
kind: ExportedServices
metadata:
name: default
spec:
services:
- name: static-server
namespace: default
consumers:
- peer: client
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- ../../../bases/exportedservices-default

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: consul.hashicorp.com/v1alpha1
kind: ExportedServices
metadata:
name: default
spec:
services:
- name: static-server
namespace: ns1
consumers:
- peer: client
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- ../../../bases/static-client

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: static-client
spec:
template:
metadata:
annotations:
"consul.hashicorp.com/connect-inject": "true"
"consul.hashicorp.com/connect-service-upstreams": "static-server.svc.default.ns.server.peer:1234"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- ../../../bases/static-client

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: static-client
spec:
template:
metadata:
annotations:
"consul.hashicorp.com/connect-inject": "true"
"consul.hashicorp.com/connect-service-upstreams": "static-server.svc.ns1.ns.server.peer:1234"
22 changes: 22 additions & 0 deletions acceptance/tests/peering/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package peering

import (
"fmt"
"os"
"testing"

testsuite "github.com/hashicorp/consul-k8s/acceptance/framework/suite"
)

var suite testsuite.Suite

func TestMain(m *testing.M) {
suite = testsuite.NewSuite(m)

if suite.Config().EnableMultiCluster {
os.Exit(suite.Run())
} else {
fmt.Println("Skipping peering tests because -enable-multi-cluster is not set")
os.Exit(0)
}
}
Loading

0 comments on commit 03a1674

Please sign in to comment.