Skip to content

Commit eb5f862

Browse files
authored
11.0.0.11-r2 update (#150)
1 parent 9b964ab commit eb5f862

28 files changed

+64
-60
lines changed

cmd/runaceserver/integrationserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/ot4i/ace-docker/internal/command"
2828
"github.com/ot4i/ace-docker/internal/name"
2929
"github.com/ot4i/ace-docker/internal/qmgr"
30-
"github.com/ot4i/ace-docker/internal/contentserver"
30+
"github.com/ot4i/ace-docker/common/contentserver"
3131
"gopkg.in/yaml.v2"
3232
)
3333

cmd/runaceserver/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"io/ioutil"
2121
"os"
2222

23-
"github.com/ot4i/ace-docker/internal/logger"
23+
"github.com/ot4i/ace-docker/common/logger"
2424
)
2525

2626
var log logger.LoggerInterface

cmd/runaceserver/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/ot4i/ace-docker/internal/metrics"
2727
"github.com/ot4i/ace-docker/internal/name"
2828
"github.com/ot4i/ace-docker/internal/qmgr"
29-
"github.com/ot4i/ace-docker/internal/designer"
29+
"github.com/ot4i/ace-docker/common/designer"
3030
)
3131

3232
func doMain() error {

cmd/runaceserver/main_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strconv"
2424
"testing"
2525

26-
"github.com/ot4i/ace-docker/internal/logger"
26+
"github.com/ot4i/ace-docker/common/logger"
2727
)
2828

2929
var test *bool

internal/contentserver/bar.go renamed to common/contentserver/bar.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"net/http"
2323
"io"
2424

25-
"github.com/ot4i/ace-docker/internal/logger"
25+
"github.com/ot4i/ace-docker/common/logger"
2626
)
2727

2828
var loadX509KeyPair = tls.LoadX509KeyPair
@@ -69,6 +69,7 @@ func GetBAR(url string, serverName string, token string, contentServerCACert []b
6969
}
7070
// TODO: this doesn't actually return an error
7171
if response.StatusCode != 200 {
72+
log.Printf("Call to retrieve BAR file from content server failed with response code: %v", response.StatusCode)
7273
return nil, err
7374
}
7475

internal/contentserver/bar_test.go renamed to common/contentserver/bar_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"io/ioutil"
2828
"bytes"
2929

30-
"github.com/ot4i/ace-docker/internal/logger"
30+
"github.com/ot4i/ace-docker/common/logger"
3131

3232
"github.com/stretchr/testify/assert"
3333
"testing"
File renamed without changes.

internal/designer/flow_validation.go renamed to common/designer/flow_validation.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"gopkg.in/yaml.v2"
2626

2727
"github.com/ot4i/ace-docker/internal/command"
28-
"github.com/ot4i/ace-docker/internal/logger"
28+
"github.com/ot4i/ace-docker/common/logger"
2929
)
3030

3131
var runAsUser = command.RunAsUser
@@ -140,27 +140,26 @@ func getConnectorLicenseToggleName(name string) string {
140140
// findDisabledConnectorInFlow returns the first disabled connector it finds
141141
// if it doesn't find a disabled connector, it returns an empty string
142142
var findDisabledConnectorInFlow = func (flowDocument flowDocument, log logger.LoggerInterface) string {
143+
disabledConnectors := make([]string, 0)
144+
143145
// read the connector-type field under each interface
144146
// and check if the license toggle for that connector is enabled
145-
findDisabledConnector := func (interfaces map[string]flowInterface) string {
147+
findDisabledConnector := func(interfaces map[string]flowInterface) {
146148
for _, i := range interfaces {
147149
connector := i.ConnectorType
148150
if connector != "" {
149151
log.Printf("Checking if connector %v is supported under the current license.", connector)
150152
if !isLicenseToggleEnabled(getConnectorLicenseToggleName(connector)) {
151-
return connector
153+
disabledConnectors = append(disabledConnectors, connector)
152154
}
153155
}
154156
}
155-
return ""
156157
}
157158

158-
disabledTriggerConnector := findDisabledConnector(flowDocument.Integration.TriggerInterfaces)
159-
if disabledTriggerConnector != "" {
160-
return disabledTriggerConnector
161-
}
162-
disabledActionConnector := findDisabledConnector(flowDocument.Integration.ActionInterfaces)
163-
return disabledActionConnector
159+
findDisabledConnector(flowDocument.Integration.TriggerInterfaces)
160+
findDisabledConnector(flowDocument.Integration.ActionInterfaces)
161+
162+
return strings.Join(disabledConnectors[:], ", ")
164163
}
165164

166165
// IsFlowValid checks if a single flow is valid
@@ -172,11 +171,11 @@ var IsFlowValid = func(log logger.LoggerInterface, flow string, flowFile []byte)
172171
return false, err
173172
}
174173

175-
disabledConnector := findDisabledConnectorInFlow(flowDocument, log)
176-
if disabledConnector != "" {
177-
log.Errorf("Flow %v contains a %v connector, which isn't supported under the current license. Please update your license to enable this flow to run.", flow, disabledConnector)
174+
disabledConnectors := findDisabledConnectorInFlow(flowDocument, log)
175+
if disabledConnectors != "" {
176+
log.Errorf("Flow %v contains one or more connectors, which aren't supported under the current license. Please update your license to enable this flow to run. The unsupported connectors are: %v.", flow, disabledConnectors)
178177
}
179-
return disabledConnector == "", nil
178+
return disabledConnectors == "", nil
180179
}
181180

182181
// ValidateFlows checks if the flows in the /run directory are valid

internal/designer/flow_validation_test.go renamed to common/designer/flow_validation_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"io"
2323
"io/ioutil"
2424

25-
"github.com/ot4i/ace-docker/internal/logger"
25+
"github.com/ot4i/ace-docker/common/logger"
2626

2727
"github.com/stretchr/testify/assert"
2828
"github.com/stretchr/testify/require"
@@ -80,7 +80,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
8080
},
8181
},
8282
}
83-
require.Equal(t, "foo", findDisabledConnectorInFlow(testFlowDocument, testLogger))
83+
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
84+
require.Equal(t, "foo", disabledConnectors)
8485
})
8586

8687
t.Run("When there are unsupported connectors in the action interface", func(t *testing.T) {
@@ -101,7 +102,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
101102
},
102103
},
103104
}
104-
require.Equal(t, "bar", findDisabledConnectorInFlow(testFlowDocument, testLogger))
105+
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
106+
require.Equal(t, "bar", disabledConnectors)
105107
})
106108

107109
t.Run("When there are unsupported connectors in both the trigger interface and the action interface", func(t *testing.T) {
@@ -125,7 +127,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
125127
},
126128
},
127129
}
128-
require.Equal(t, "foo", findDisabledConnectorInFlow(testFlowDocument, testLogger))
130+
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
131+
require.Equal(t, "foo, bar", disabledConnectors)
129132
})
130133

131134
isLicenseToggleEnabled = oldIsLicenseToggleEnabled
File renamed without changes.

0 commit comments

Comments
 (0)