Specify AWS Functions as list
to conform with the yaml standard of list definition.
This commit is contained in:

committed by
Sebastian Serth

parent
d80761a973
commit
0f8a1fa25a
@ -5,7 +5,6 @@ import (
|
||||
"github.com/openHPI/poseidon/internal/config"
|
||||
"github.com/openHPI/poseidon/internal/runner"
|
||||
"github.com/openHPI/poseidon/pkg/dto"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// AWSEnvironmentManager contains no functionality at the moment.
|
||||
@ -60,7 +59,7 @@ func (a *AWSEnvironmentManager) CreateOrUpdate(
|
||||
}
|
||||
|
||||
func isAWSEnvironment(request dto.ExecutionEnvironmentRequest) bool {
|
||||
for _, function := range strings.Fields(config.Config.AWS.Functions) {
|
||||
for _, function := range config.Config.AWS.Functions {
|
||||
if request.Image == function {
|
||||
return true
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ func TestAWSEnvironmentManager_CreateOrUpdate(t *testing.T) {
|
||||
uniqueImage := "java11Exec"
|
||||
|
||||
t.Run("can create default Java environment", func(t *testing.T) {
|
||||
config.Config.AWS.Functions = uniqueImage
|
||||
config.Config.AWS.Functions = []string{uniqueImage}
|
||||
_, err := m.CreateOrUpdate(tests.AnotherEnvironmentIDAsInteger, dto.ExecutionEnvironmentRequest{Image: uniqueImage})
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
Reference in New Issue
Block a user