Skip to content

Commit

Permalink
Merge pull request #3259 from uselagoon/remove-harbor-project-integra…
Browse files Browse the repository at this point in the history
…tion

chore: remove remaining harbor integration from core
  • Loading branch information
tobybellwood authored Jun 27, 2024
2 parents 5637896 + 02dffe2 commit 081b1a2
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 831 deletions.
14 changes: 0 additions & 14 deletions node-packages/commons/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1386,17 +1386,3 @@ export const getProblemsforProjectEnvironment = async (
});
return response.environmentByName.problems;
};

export const getProblemHarborScanMatches = () => graphqlapi.query(
`query getProblemHarborScanMatches {
allProblemHarborScanMatchers {
id
name
description
defaultLagoonProject
defaultLagoonEnvironment
defaultLagoonService
regex
}
}`
);
48 changes: 0 additions & 48 deletions node-packages/commons/src/harborApi.ts

This file was deleted.

4 changes: 1 addition & 3 deletions services/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ ENV NODE_ENV=production \
KEYCLOAK_ADMIN_PASSWORD=admin \
ELASTICSEARCH_URL=http://logs-db-service:9200 \
KEYCLOAK_API_CLIENT_SECRET=39d5282d-3684-4026-b4ed-04bbc034b61a \
HARBOR_ADMIN_PASSWORD=Harbor12345 \
REDIS_PASSWORD=admin \
HARBOR_API_VERSION=v2.0
REDIS_PASSWORD=admin

# The API is not very resilient to sudden mariadb restarts which can happen when the api and mariadb are starting
# at the same time. So we have a small entrypoint which waits for mariadb to be fully ready.
Expand Down
1 change: 0 additions & 1 deletion services/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"sync:gitlab:all": "yarn run sync:gitlab:users && yarn run sync:gitlab:groups && yarn run sync:gitlab:projects",
"sync:opendistro-security": "node --max-http-header-size=80000 dist/helpers/sync-groups-opendistro-security",
"sync:bitbucket:repo-permissions": "node dist/bitbucket-sync/repo-permissions",
"sync:harbor:projects": "node dist/migrations/2-harbor/harborSync.js",
"migrations:lagoon": "node dist/migrations/lagoon/migrations.js"
},
"keywords": [],
Expand Down
24 changes: 0 additions & 24 deletions services/api/src/clients/harborClient.ts

This file was deleted.

103 changes: 0 additions & 103 deletions services/api/src/migrations/2-harbor/harborSync.ts

This file was deleted.

6 changes: 0 additions & 6 deletions services/api/src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const {
deleteProblemsFromSource,
addProblemsFromSource,
getProblemSources,
getProblemHarborScanMatches,
addProblemHarborScanMatch,
deleteProblemHarborScanMatch
} = require('./resources/problem/resolvers');

const {
Expand Down Expand Up @@ -581,7 +578,6 @@ const resolvers = {
allProblems: getAllProblems,
allGroups: getAllGroups,
allProjectsInGroup: getAllProjectsInGroup,
allProblemHarborScanMatchers: getProblemHarborScanMatches,
allUsers: getAllUsers,
allNotifications: getAllNotifications,
userByEmail: getUserByEmail,
Expand All @@ -601,10 +597,8 @@ const resolvers = {
},
Mutation: {
addProblem,
addProblemHarborScanMatch,
deleteProblem,
deleteProblemsFromSource,
deleteProblemHarborScanMatch,
addFact,
addFacts,
addFactsByName,
Expand Down
33 changes: 0 additions & 33 deletions services/api/src/resources/problem/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,36 +278,3 @@ export const deleteProblemsFromSource: ResolverFn = async (

return 'success';
};

export const getProblemHarborScanMatches: ResolverFn = async (
root,
args,
{ sqlClientPool, hasPermission }
) => {
throw new Error('Harbor-Trivy integration with core removed in Lagoon 2')
};

export const addProblemHarborScanMatch: ResolverFn = async (
root,
{
input: {
name,
description,
defaultLagoonProject,
defaultLagoonEnvironment,
defaultLagoonService,
regex
}
},
{ sqlClientPool, hasPermission, userActivityLogger }
) => {
throw new Error('Harbor-Trivy integration with core removed in Lagoon 2')
};

export const deleteProblemHarborScanMatch: ResolverFn = async (
root,
{ input: { id } },
{ sqlClientPool, hasPermission, userActivityLogger }
) => {
throw new Error('Harbor-Trivy integration with core removed in Lagoon 2')
};
10 changes: 0 additions & 10 deletions services/api/src/resources/problem/sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ const standardEnvironmentReturn = {
deleted: 'deleted'
};

const standardProblemHarborScanMatchReturn = {
id: 'id',
name: 'name',
description: 'description',
default_lagoon_project: 'defaultLagoonProject',
default_lagoon_environment: 'defaultLagoonEnvironment',
default_lagoon_service: 'defaultLagoonServiceName',
regex: 'regex'
};

export const Sql = {
selectAllProblems: ({
source = [],
Expand Down
Loading

0 comments on commit 081b1a2

Please sign in to comment.