Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for Controlsvc #827

Merged
merged 11 commits into from
Sep 27, 2023
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ build-all:
GOOS=windows go build -o receptor.exe ./cmd/receptor-cl && \
GOOS=darwin go build -o receptor.app ./cmd/receptor-cl && \
go build example/*.go && \
go build -o receptor --tags no_controlsvc,no_backends,no_services,no_tls_config,no_workceptor,no_cert_auth ./cmd/receptor-cl && \
go build -o receptor --tags no_backends,no_services,no_tls_config,no_workceptor,no_cert_auth ./cmd/receptor-cl && \
AaronH88 marked this conversation as resolved.
Show resolved Hide resolved
go build -o receptor ./cmd/receptor-cl

DIST := receptor_$(shell echo '$(VERSION)' | sed 's/^v//')_$(GOOS)_$(GOARCH)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controlsvc/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (t *connectCommandType) InitFromJSON(config map[string]interface{}) (Contro
return c, nil
}

func (c *connectCommand) ControlFunc(_ context.Context, nc *netceptor.Netceptor, cfo ControlFuncOperations) (map[string]interface{}, error) {
func (c *connectCommand) ControlFunc(_ context.Context, nc NetceptorForControlCommand, cfo ControlFuncOperations) (map[string]interface{}, error) {
tlscfg, err := nc.GetClientTLSConfig(c.tlsConfigName, c.targetNode, netceptor.ExpectedHostnameTypeReceptor)
if err != nil {
return nil, err
Expand All @@ -83,7 +83,7 @@ func (c *connectCommand) ControlFunc(_ context.Context, nc *netceptor.Netceptor,
if err != nil {
return nil, err
}
err = cfo.BridgeConn("Connecting\n", rc, "connected service", nc.Logger)
err = cfo.BridgeConn("Connecting\n", rc, "connected service", nc.GetLogger(), &Util{})
if err != nil {
return nil, err
}
Expand Down
Loading