-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update Application resource creation and update templates with …
…gitops codebase custom values (#32) Jira: EPMDEDP-12496 Resolves: #32 Change-Id: Ib1cf78c8c1ba149eede379a6ae7bdbecc7dca6da
- Loading branch information
1 parent
df11f29
commit 0ab33d3
Showing
29 changed files
with
614 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { CI_TOOLS } from '../../../constants/ciTools'; | ||
import { | ||
BUILD_TOOL_ICON_MAPPING, | ||
FRAMEWORK_ICON_MAPPING, | ||
LANGUAGE_ICON_MAPPING, | ||
} from '../../icon-mappings'; | ||
import { | ||
CODEBASE_COMMON_BUILD_TOOLS, | ||
CODEBASE_COMMON_FRAMEWORKS, | ||
CODEBASE_COMMON_LANGUAGES, | ||
} from '../index'; | ||
import { CodebaseInterface, CodebaseMappingKey } from '../types'; | ||
|
||
export type SystemLanguageKeys = typeof CODEBASE_COMMON_LANGUAGES.HELM; | ||
|
||
type SystemMappingKey = Extract<CodebaseMappingKey, SystemLanguageKeys>; | ||
|
||
export type SystemMapping = { | ||
[K in SystemMappingKey]: CodebaseInterface; | ||
}; | ||
|
||
export const SYSTEM_MAPPING: SystemMapping = { | ||
[CODEBASE_COMMON_LANGUAGES.HELM]: { | ||
language: { | ||
name: 'Helm', | ||
value: CODEBASE_COMMON_LANGUAGES.HELM, | ||
icon: LANGUAGE_ICON_MAPPING[CODEBASE_COMMON_LANGUAGES.HELM], | ||
availableCITools: [CI_TOOLS.TEKTON], | ||
}, | ||
frameworks: { | ||
[CODEBASE_COMMON_FRAMEWORKS.GIT_OPS]: { | ||
name: 'GitOps', | ||
value: CODEBASE_COMMON_FRAMEWORKS.GIT_OPS, | ||
icon: FRAMEWORK_ICON_MAPPING[CODEBASE_COMMON_FRAMEWORKS.GIT_OPS], | ||
availableCITools: [CI_TOOLS.TEKTON], | ||
}, | ||
}, | ||
buildTools: { | ||
[CODEBASE_COMMON_BUILD_TOOLS.HELM]: { | ||
name: 'Helm', | ||
value: CODEBASE_COMMON_BUILD_TOOLS.HELM, | ||
icon: BUILD_TOOL_ICON_MAPPING[CODEBASE_COMMON_BUILD_TOOLS.HELM], | ||
availableCITools: [CI_TOOLS.TEKTON], | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { RESOURCE_ICON_NAMES } from '../names'; | ||
|
||
export const GitOps = () => { | ||
return ( | ||
<symbol | ||
id={RESOURCE_ICON_NAMES.GIT_OPS} | ||
viewBox="0 0 256 256" | ||
xmlSpace="preserve" | ||
preserveAspectRatio="xMidYMid" | ||
> | ||
<path | ||
d="M251.172 116.594 139.4 4.828c-6.433-6.437-16.873-6.437-23.314 0l-23.21 23.21 29.443 29.443c6.842-2.312 14.688-.761 20.142 4.693 5.48 5.489 7.02 13.402 4.652 20.266l28.375 28.376c6.865-2.365 14.786-.835 20.269 4.657 7.663 7.66 7.663 20.075 0 27.74-7.665 7.666-20.08 7.666-27.749 0-5.764-5.77-7.188-14.235-4.27-21.336l-26.462-26.462-.003 69.637a19.82 19.82 0 0 1 5.188 3.71c7.663 7.66 7.663 20.076 0 27.747-7.665 7.662-20.086 7.662-27.74 0-7.663-7.671-7.663-20.086 0-27.746a19.654 19.654 0 0 1 6.421-4.281V94.196a19.378 19.378 0 0 1-6.421-4.281c-5.806-5.798-7.202-14.317-4.227-21.446L81.47 39.442 4.83 116.077c-6.44 6.443-6.44 16.884 0 23.322l111.774 111.768c6.435 6.438 16.873 6.438 23.316 0l111.251-111.249c6.438-6.44 6.438-16.887 0-23.324" | ||
fill="#DE4C36" | ||
/> | ||
</symbol> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 57 additions & 2 deletions
59
src/k8s/Application/utils/editApplicationInstance/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,57 @@ | ||
// Todo: write new mocks | ||
test('true', () => {}); | ||
import { EDPCDPipelineKubeObjectInterface } from '../../../EDPCDPipeline/types'; | ||
import { EDPCDPipelineStageKubeObjectInterface } from '../../../EDPCDPipelineStage/types'; | ||
import { EDPCodebaseKubeObjectInterface } from '../../../EDPCodebase/types'; | ||
import { EDPCodebaseImageStreamKubeObjectInterface } from '../../../EDPCodebaseImageStream/types'; | ||
import { EDPGitServerKubeObjectInterface } from '../../../EDPGitServer/types'; | ||
import { ApplicationKubeObjectInterface } from '../../types'; | ||
import { | ||
expectedApplicationAfterEditOutputMock, | ||
expectedApplicationAfterEditOutputMockWithValuesOverride, | ||
} from '../mocks/application.mock'; | ||
import { CDPipelineMock } from '../mocks/CDPipeline.mock'; | ||
import { CDPipelineStageMock } from '../mocks/CDPipelineStage.mock'; | ||
import { enrichedApplicationMock } from '../mocks/enrichedApplication.mock'; | ||
import { gitOpsCodebaseMock } from '../mocks/gitOpsCodebase.mock'; | ||
import { gitServerMock } from '../mocks/gitServer.mock'; | ||
import { imageStreamMock } from '../mocks/imageStream.mock'; | ||
import { editApplicationInstance } from './index'; | ||
|
||
describe('testing editApplicationInstance', () => { | ||
it('should return valid kube object', () => { | ||
const object = editApplicationInstance({ | ||
CDPipeline: CDPipelineMock as EDPCDPipelineKubeObjectInterface, | ||
currentCDPipelineStage: | ||
CDPipelineStageMock as unknown as EDPCDPipelineStageKubeObjectInterface, | ||
application: | ||
enrichedApplicationMock.application as unknown as EDPCodebaseKubeObjectInterface, | ||
imageStream: imageStreamMock as EDPCodebaseImageStreamKubeObjectInterface, | ||
imageTag: 'test-image-tag', | ||
gitServer: gitServerMock as EDPGitServerKubeObjectInterface, | ||
valuesOverride: false, | ||
gitOpsCodebase: gitOpsCodebaseMock as unknown as EDPCodebaseKubeObjectInterface, | ||
argoApplication: | ||
enrichedApplicationMock.argoApplication as unknown as ApplicationKubeObjectInterface, | ||
}); | ||
|
||
expect(object).toEqual(expectedApplicationAfterEditOutputMock); | ||
}); | ||
|
||
it('should return valid kube object with values override', () => { | ||
const object = editApplicationInstance({ | ||
CDPipeline: CDPipelineMock as EDPCDPipelineKubeObjectInterface, | ||
currentCDPipelineStage: | ||
CDPipelineStageMock as unknown as EDPCDPipelineStageKubeObjectInterface, | ||
application: | ||
enrichedApplicationMock.application as unknown as EDPCodebaseKubeObjectInterface, | ||
imageStream: imageStreamMock as EDPCodebaseImageStreamKubeObjectInterface, | ||
imageTag: 'test-image-tag', | ||
gitServer: gitServerMock as EDPGitServerKubeObjectInterface, | ||
valuesOverride: true, | ||
gitOpsCodebase: gitOpsCodebaseMock as unknown as EDPCodebaseKubeObjectInterface, | ||
argoApplication: | ||
enrichedApplicationMock.argoApplication as unknown as ApplicationKubeObjectInterface, | ||
}); | ||
|
||
expect(object).toEqual(expectedApplicationAfterEditOutputMockWithValuesOverride); | ||
}); | ||
}); |
Oops, something went wrong.