diff --git a/charts/ephemeral/values.yaml b/charts/ephemeral/values.yaml index 13a34317..252a96f8 100644 --- a/charts/ephemeral/values.yaml +++ b/charts/ephemeral/values.yaml @@ -48,7 +48,7 @@ ephemeral: minScale: 1 programIdentifier: "ephemeral-generic" opa: - endpoint: "http://opa.carbynestack.io" + endpoint: "http://opa.default.svc.cluster.local:8081/" policyPackage: "carbynestack.def" amphora: host: "amphora" diff --git a/pkg/discovery/game.go b/pkg/discovery/game.go index b4823119..14bcd495 100644 --- a/pkg/discovery/game.go +++ b/pkg/discovery/game.go @@ -75,11 +75,11 @@ func NewGame(ctx context.Context, id string, bus mb.MessageBus, stateTimeout tim fsm.WhenIn(WaitTCPCheck).GotEvent(TCPCheckSuccess).Stay(), fsm.WhenIn(WaitTCPCheck).GotEvent(TCPCheckSuccessAll).GoTo(Playing).WithTimeout(computationTimeout), fsm.WhenIn(WaitTCPCheck).GotEvent(TCPCheckFailure).GoTo(GameError), + fsm.WhenIn(WaitTCPCheck).GotEvent(GameFinishedWithError).GoTo(GameError), fsm.WhenIn(Playing).GotEvent(GameFinishedWithSuccess).Stay(), fsm.WhenIn(Playing).GotEvent(GameFinishedWithError).GoTo(GameError), fsm.WhenIn(Playing).GotEvent(GameSuccess).GoTo(GameDone), fsm.WhenIn(Playing).GotEvent(GameError).GoTo(GameError), - fsm.WhenInAnyState().GotEvent(GameFinishedWithError).GoTo(GameError), fsm.WhenInAnyState().GotEvent(StateTimeoutError).GoTo(GameError), fsm.WhenInAnyState().GotEvent(GameDone).GoTo(GameDone), } diff --git a/pkg/ephemeral/player.go b/pkg/ephemeral/player.go index ddc14004..54b96c0a 100644 --- a/pkg/ephemeral/player.go +++ b/pkg/ephemeral/player.go @@ -49,8 +49,9 @@ func NewPlayer(ctx context.Context, bus mb.MessageBus, stateTimeout time.Duratio fsm.WhenIn(Init).GotEvent(Register).GoTo(Registering), fsm.WhenIn(Registering).GotEvent(PlayersReady).GoTo(Playing).WithTimeout(computationTimeout), fsm.WhenIn(Playing).GotEvent(PlayerFinishedWithSuccess).GoTo(PlayerFinishedWithSuccess), + fsm.WhenIn(Playing).GotEvent(PlayerFinishedWithError).GoTo(PlayerFinishedWithError), + fsm.WhenIn(Playing).GotEvent(PlayingError).GoTo(PlayerFinishedWithError), fsm.WhenInAnyState().GotEvent(GameError).GoTo(PlayerFinishedWithError), - fsm.WhenInAnyState().GotEvent(PlayingError).GoTo(PlayerFinishedWithError), fsm.WhenInAnyState().GotEvent(PlayerDone).GoTo(PlayerDone), fsm.WhenInAnyState().GotEvent(StateTimeoutError).GoTo(PlayerFinishedWithError), } diff --git a/pkg/opa/client.go b/pkg/opa/client.go index 3a822144..23b84720 100644 --- a/pkg/opa/client.go +++ b/pkg/opa/client.go @@ -95,7 +95,7 @@ func (c *Client) makeOpaRequest(action string, data interface{}, v interface{}) req, err := http.NewRequest( "POST", fmt.Sprintf("%s/v1/data/%s/%s", - c.URL.String(), + strings.Trim(c.URL.String(), "/"), strings.ReplaceAll(c.PolicyPackage, ".", "/"), action), bytes.NewBuffer(payload))