Skip to content

Commit

Permalink
fix: Fix git server creation flow (#102)
Browse files Browse the repository at this point in the history
* Fix git server name - remove random postfix

Jira: EPMDPEDP-12944
Related: #102
Change-Id: I914b64dd2afe2bd2aaff98690c9ed2341cf8cc22
  • Loading branch information
callmevladik committed Nov 23, 2023
1 parent 8b1bce1 commit d2698a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('testing createGitServerInstance', () => {
expect(object).toEqual({
apiVersion: 'v2.edp.epam.com/v1',
kind: 'GitServer',
metadata: { name: 'gerrit.com-8ygse' },
metadata: { name: 'gerrit' },
spec: {
gitHost: 'gerrit.com',
nameSshKeySecret: 'gerrit-ciuser-sshkey',
Expand Down
4 changes: 1 addition & 3 deletions src/k8s/EDPGitServer/utils/createGitServerInstance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { set } from 'lodash';
import { GIT_PROVIDERS } from '../../../../constants/gitProviders';
import { FormNameObject } from '../../../../types/forms';
import { DeepPartial } from '../../../../types/global';
import { createRandomString } from '../../../../utils/createRandomString';
import { EDPGitServerKubeObjectConfig } from '../../config';
import { EDPGitServerKubeObjectInterface } from '../../types';

Expand All @@ -17,7 +16,6 @@ export const createGitServerInstance = (
}
): EDPGitServerKubeObjectInterface => {
const { gitHost, ...restProps } = formValues;
const gitServerName = `${gitHost}-${createRandomString()}`;
const nameSshKeySecret =
formValues.gitProvider === GIT_PROVIDERS.GERRIT
? 'gerrit-ciuser-sshkey'
Expand All @@ -27,7 +25,7 @@ export const createGitServerInstance = (
apiVersion: `${group}/${version}`,
kind,
metadata: {
name: gitServerName,
name: formValues.gitProvider,
},
spec: {
gitHost,
Expand Down

0 comments on commit d2698a3

Please sign in to comment.