Compare commits

..

7 Commits

Author SHA1 Message Date
3fc1191f6e register fix 2 2023-07-08 02:22:28 +02:00
52793ac244 register fix 2 2023-07-06 23:02:05 +02:00
f8a1ae841d register fix 2 2023-07-06 21:49:12 +02:00
9d424742d6 register fix 2 2023-07-06 21:45:45 +02:00
a9b73a6536 register fix 2 2023-07-06 19:30:00 +02:00
95584eb407 register fix 2 2023-07-05 23:44:47 +02:00
ce7e2bc75a register fix 2 2023-07-05 23:37:55 +02:00

View File

@@ -66,20 +66,21 @@ func (s *Service) GetFullAddr() string {
func (s *Service) Register() error {
def := &consul.AgentServiceRegistration{
ID: s.GetID(),
Kind: consul.ServiceKindConnectProxy,
ID: s.GetID(),
// Kind: consul.ServiceKindConnectProxy,
Name: s.Name,
Address: s.Address,
Port: s.port,
Tags: s.getTags(),
Connect: &consul.AgentServiceConnect{
SidecarService: &consul.AgentServiceRegistration{
// Port: s.port,
},
},
Proxy: &consul.AgentServiceConnectProxyConfig{
DestinationServiceName: s.Name + "dupa",
Native: true,
// SidecarService: &consul.AgentServiceRegistration{
// Port: s.port,
// },
},
// Proxy: &consul.AgentServiceConnectProxyConfig{
// DestinationServiceName: s.Name,
// },
Check: &consul.AgentServiceCheck{
TTL: s.ttl.String(),
Status: "passing",
@@ -119,10 +120,10 @@ func (s *Service) Unregister() error {
func (s *Service) Connect() (*connect.Service, error) {
// srvName := s.Name
srvName := s.Name
fmt.Printf("CONNECT SERVER: %s\n", srvName)
svc, err := connect.NewService(srvName, s.client)
s.connect = svc
cnf := svc.ServerTLSConfig()
fmt.Printf("CONNECT SERVER:: %s CONFIG:: %v\n", srvName, cnf)
for k, c := range cnf.Certificates {
fmt.Printf("CONNECT CERT %d: %v", k, c)
}