Skip to content

Commit 2c05e93

Browse files
committed
chore: address review comments
1 parent 810ea9e commit 2c05e93

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

services/actions-handler/handler/controller_idling.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,21 @@ func (m *Messenger) handleIdling(ctx context.Context, messageQueue *mq.MessageQu
7171
// pull the id from the message
7272
environmentID = *message.Meta.EnvironmentID
7373
}
74-
decodeData, _ := base64.StdEncoding.DecodeString(message.Meta.AdvancedData)
74+
decodeData, err := base64.StdEncoding.DecodeString(message.Meta.AdvancedData)
75+
if err != nil {
76+
if m.EnableDebug {
77+
log.Printf("%sERROR: unable to decode data payload - %v", prefix, err)
78+
}
79+
return err
80+
}
7581
idled := &schema.Idled{}
76-
json.Unmarshal(decodeData, idled)
82+
err = json.Unmarshal(decodeData, idled)
83+
if err != nil {
84+
if m.EnableDebug {
85+
log.Printf("%sERROR: unable to unmarshal data payload - %v", prefix, err)
86+
}
87+
return err
88+
}
7789
updateEnvironmentPatch := schema.UpdateEnvironmentPatchInput{
7890
IdleState: &idled.IdleState,
7991
}

services/api/src/resources/environment/resolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ export const stopOrStartEnvironmentService = async (
13881388
'',
13891389
'api:stopOrStartEnvironmentService',
13901390
{ environment: environmentData.id },
1391-
`Environment idle attempt possibly failed, reason: ${error}`
1391+
`Service state change attempt possibly failed, reason: ${error}`
13921392
);
13931393
throw new Error(
13941394
error.message

services/keycloak/lagoon-realm-base-import.json

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@
14341434
"name": "remove:history:project"
14351435
}
14361436
]
1437-
}
1437+
},
14381438
{
14391439
"name": "environment_state",
14401440
"ownerManagedAccess": false,
@@ -2916,7 +2916,7 @@
29162916
"scopes": "[\"delete\",\"remove:harbor:global\",\"remove:harbor:organization\",\"remove:harbor:project\",\"remove:history:global\",\"remove:history:organization\",\"remove:history:project\"]",
29172917
"applyPolicies": "[\"[Lagoon] Users role for realm is Platform Owner\"]"
29182918
}
2919-
}
2919+
},
29202920
{
29212921
"name": "Restart production environment services",
29222922
"type": "scope",
@@ -2939,17 +2939,6 @@
29392939
"applyPolicies": "[\"[Lagoon] User has access to project\",\"[Lagoon] Users role for project is Developer\"]"
29402940
}
29412941
},
2942-
{
2943-
"name": "Restart production environment services",
2944-
"type": "scope",
2945-
"logic": "POSITIVE",
2946-
"decisionStrategy": "UNANIMOUS",
2947-
"config": {
2948-
"resources": "[\"environment_state\"]",
2949-
"scopes": "[\"restart:production\"]",
2950-
"applyPolicies": "[\"[Lagoon] User has access to project\",\"[Lagoon] Users role for project is Maintainer\"]"
2951-
}
2952-
},
29532942
{
29542943
"name": "Idle or Unidle development environment",
29552944
"type": "scope",

0 commit comments

Comments
 (0)