This commit is contained in:
parent
27754caaf0
commit
caf791548d
@ -616,7 +616,13 @@ func processesEventHandler(m *nats.Msg, message *RequestMessage) error {
|
|||||||
// If payload contains only name of the tech the default version for given image is selected.
|
// If payload contains only name of the tech the default version for given image is selected.
|
||||||
// Otherwise it can be passed in format tech:version.
|
// Otherwise it can be passed in format tech:version.
|
||||||
func enableTechEventHandler(m *nats.Msg, message *RequestMessage) error {
|
func enableTechEventHandler(m *nats.Msg, message *RequestMessage) error {
|
||||||
if !regexp.Match("[a-z0-9A-Z]*:?[0-9\.\-]*", []byte(message.Payload)) {
|
matched, err := regexp.Match(`[a-z0-9A-Z]*:?[0-9\.\-]*`, []byte(message.Payload))
|
||||||
|
if err != nil {
|
||||||
|
log.Println("ERROR enable tech problem: " + err.Error())
|
||||||
|
publish(message.AppName, "backend problem", true)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if !matched {
|
||||||
return errors.New("payload malformation, it has to be in format tech:version")
|
return errors.New("payload malformation, it has to be in format tech:version")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,7 +639,7 @@ func enableTechEventHandler(m *nats.Msg, message *RequestMessage) error {
|
|||||||
version = parts[1]
|
version = parts[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
err := waitForApp(message.AppName)
|
err = waitForApp(message.AppName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("ERROR enable tech problem: " + err.Error())
|
log.Println("ERROR enable tech problem: " + err.Error())
|
||||||
publish(message.AppName, "backend problem", true)
|
publish(message.AppName, "backend problem", true)
|
||||||
|
Loading…
Reference in New Issue
Block a user