Skip to content

Commit 1259b8d

Browse files
committed
chore: adjust for copilot feedback
1 parent 5e36596 commit 1259b8d

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

services/actions-handler/handler/controller_tasks.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ type Project struct {
135135

136136
// @TODO: add to machinery
137137
type Route struct {
138-
Domain string `json:"domain"`
139-
Service string `json:"service"`
140-
Enviroment *schema.Environment `json:"environment"`
141-
Type string `json:"type"`
138+
Domain string `json:"domain"`
139+
Service string `json:"service"`
140+
Environment *schema.Environment `json:"environment"`
141+
Type string `json:"type"`
142142
}
143143

144144
/*
@@ -170,10 +170,10 @@ func updateActiveStandbyRoutes(l *lclient.Client, project, prod, standby, prefix
170170
json.Unmarshal(d, &p)
171171
for _, route := range p.APIRoutes {
172172
// only patch routes with an environment attached
173-
if route.Type == "ACTIVE" && route.Enviroment != nil {
173+
if route.Type == "ACTIVE" && route.Environment != nil {
174174
updateRouteType(l, route, prod, project, prefix)
175175
}
176-
if route.Type == "STANDBY" && route.Enviroment != nil {
176+
if route.Type == "STANDBY" && route.Environment != nil {
177177
updateRouteType(l, route, standby, project, prefix)
178178
}
179179
}

services/api/database/migrations/20250925000000_routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @returns { Promise<void> }
44
*/
55
exports.up = async function(knex) {
6-
route = await knex.schema.hasTable('routes');
6+
const route = await knex.schema.hasTable('routes');
77
if (!route) {
88
return knex.schema
99
.createTable('routes', function (table) {

services/api/src/resources/routes/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function addServicePathRoute(
114114
);
115115
const combinedPathRoutesCount = pathRoutes.length + 1
116116
if (combinedPathRoutesCount >= 10) {
117-
throw Error(`Limit of 10 path rotues, consider removing some from this route`)
117+
throw Error(`Limit of 10 path routes, consider removing some from this route`)
118118
}
119119
if (!exists) {
120120
return [...pathRoutes, { toService: newToService, path: newPath }];

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { addServicePathRoute, removeServicePathRoute, Helpers, PathRoutes } from
1010
import { AuditLog } from '../audit/types';
1111
import { isDNS1123Subdomain } from '../../util/func';
1212
import { AuditType, RouteSource, RouteType } from '@lagoon/commons/dist/types';
13-
import { logger } from '../../loggers/logger';
1413

1514
// check array for duplicates that are trimmed and lowercased
1615
function hasDuplicates(arr) {
@@ -545,7 +544,7 @@ export const activeStandbyRouteMove: ResolverFn = async (
545544
project: '',
546545
event: 'api:activeStandbyRouteMove',
547546
payload: {
548-
project: project.id,
547+
project: projectId,
549548
environment: environmentData.id,
550549
route: route.id
551550
}

services/api/src/typeDefs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ const typeDefs = gql`
10981098
updated: String
10991099
created: String
11001100
"""
1101-
Used to set automatic certificate generation using the default ceritificate provisioning system.
1101+
Used to set automatic certificate generation using the default certificate provisioning system.
11021102
Typically this will be LetsEncrypt.
11031103
"""
11041104
tlsAcme: Boolean

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,7 @@
27592759
}
27602760
},
27612761
{
2762-
"name": "View Project Rotues",
2762+
"name": "View Project Routes",
27632763
"type": "scope",
27642764
"logic": "POSITIVE",
27652765
"decisionStrategy": "UNANIMOUS",

services/keycloak/startup-scripts/00-configure-lagoon.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,10 +981,10 @@ function add_route_permissions {
981981
echo Creating resource route
982982
echo '{"name":"route","displayName":"route","scopes":[{"name":"add"},{"name":"view"},{"name":"update"},{"name":"add:environment"},{"name":"remove:environment"},{"name":"delete"}],"attributes":{},"uris":[],"ownerManagedAccess":""}' | /opt/keycloak/bin/kcadm.sh create clients/$api_client_id/authz/resource-server/resource --config $CONFIG_PATH -r ${KEYCLOAK_REALM:-master} -f -
983983

984-
# Create "View Project Rotues" permission
984+
# Create "View Project Routes" permission
985985
/opt/keycloak/bin/kcadm.sh create clients/$api_client_id/authz/resource-server/permission/scope --config $CONFIG_PATH -r lagoon -f - <<EOF
986986
{
987-
"name": "View Project Rotues",
987+
"name": "View Project Routes",
988988
"type": "scope",
989989
"logic": "POSITIVE",
990990
"decisionStrategy": "UNANIMOUS",
@@ -1020,7 +1020,7 @@ EOF
10201020
}
10211021
EOF
10221022

1023-
# Create "VAdd Route to Environment in Project" permission
1023+
# Create "Add Route to Environment in Project" permission
10241024
/opt/keycloak/bin/kcadm.sh create clients/$api_client_id/authz/resource-server/permission/scope --config $CONFIG_PATH -r lagoon -f - <<EOF
10251025
{
10261026
"name": "Add Route to Environment in Project",

0 commit comments

Comments
 (0)