diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/ReleasePlanForm.tsx b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/ReleasePlanForm.tsx index 84d7de94..c4b765d0 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/ReleasePlanForm.tsx +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/ReleasePlanForm.tsx @@ -65,7 +65,7 @@ export const ReleasePlanForm: React.FC = ({ /> diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/RunReleasePipelineSection.tsx b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/RunReleasePipelineSection.tsx index a6643612..2875b9c3 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/RunReleasePipelineSection.tsx +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/RunReleasePipelineSection.tsx @@ -48,7 +48,7 @@ const GitOptions: React.FC<{ required?: boolean }> = ({ required = false }) => { export const RunReleasePipelineSection: React.FC = () => { const [{ value: pipelineLocation }] = useField('releasePipelineLocation'); - const { workspace } = useWorkspaceInfo(); + const { namespace } = useWorkspaceInfo(); return ( <> @@ -58,9 +58,9 @@ export const RunReleasePipelineSection: React.FC = () => { options={[ { value: ReleasePipelineLocation.current, - label: `In this workspace: ${workspace}`, + label: `In this namespace: ${namespace}`, }, - { value: ReleasePipelineLocation.target, label: 'In a target workspace' }, + { value: ReleasePipelineLocation.target, label: 'In a target namespace' }, ]} required /> @@ -110,12 +110,12 @@ export const RunReleasePipelineSection: React.FC = () => { <> } required diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/ReleasePlanForm.spec.tsx b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/ReleasePlanForm.spec.tsx index e79c7860..0a99cc6a 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/ReleasePlanForm.spec.tsx +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/ReleasePlanForm.spec.tsx @@ -28,8 +28,8 @@ describe('ReleasePlanForm', () => { expect(result.getByRole('heading', { name: 'Create release plan' })).toBeVisible(); expect(result.getByRole('button', { name: 'Create' })).toBeVisible(); expect(result.getByRole('button', { name: 'Create' })).toBeVisible(); - expect(result.getByRole('radio', { name: 'In this workspace: test-ws' })).toBeVisible(); - expect(result.getByRole('radio', { name: 'In a target workspace' })).toBeVisible(); + expect(result.getByRole('radio', { name: 'In this namespace: test-ns' })).toBeVisible(); + expect(result.getByRole('radio', { name: 'In a target namespace' })).toBeVisible(); expect(result.getByRole('checkbox', { name: 'Auto release' })).toBeVisible(); expect(result.getByRole('checkbox', { name: 'Standing attribution' })).toBeVisible(); expect(result.getByRole('textbox', { name: 'Release plan name' })).toBeVisible(); diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/RunReleasePipelineSection.spec.tsx b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/RunReleasePipelineSection.spec.tsx index d65c0140..a2eb4da3 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/RunReleasePipelineSection.spec.tsx +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/RunReleasePipelineSection.spec.tsx @@ -61,7 +61,7 @@ describe('RunReleasePipelineSection', () => { expect( result.getByRole('region', { name: 'Git options for the release pipeline' }), ).toBeVisible(); - expect(result.getByRole('textbox', { name: 'Target workspace' })).toBeVisible(); + expect(result.getByRole('textbox', { name: 'Target namespace' })).toBeVisible(); expect(result.getByRole('textbox', { name: 'Data' })).toBeVisible(); }); }); diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/form-utils.spec.ts b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/form-utils.spec.ts index 4700dc60..6caa7f06 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/form-utils.spec.ts +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/__tests__/form-utils.spec.ts @@ -18,7 +18,7 @@ describe('createReleasePlan', () => { k8sUpdateMock.mockImplementation((obj) => obj.resource); }); - it('should use active workspace for current release pipeline location', async () => { + it('should use active namespace for current release pipeline location', async () => { const result = await createReleasePlan( { name: 'test-plan', @@ -32,8 +32,8 @@ describe('createReleasePlan', () => { path: '/', }, }, - 'test-ns', - 'test-ws', + 'test-ns-tenant', + 'test-ws-tenant', ); expect(result).toEqual( expect.objectContaining({ @@ -43,7 +43,7 @@ describe('createReleasePlan', () => { 'release.appstudio.openshift.io/standing-attribution': 'false', }, name: 'test-plan', - namespace: 'test-ns', + namespace: 'test-ns-tenant', }, spec: { application: 'test-app', @@ -64,7 +64,7 @@ describe('createReleasePlan', () => { ], resolver: 'git', }, - target: 'test-ws-tenant', + target: 'test-ns-tenant', }, }), ); @@ -75,7 +75,7 @@ describe('createReleasePlan', () => { { name: 'test-plan', application: 'test-app', - target: 'target-ws', + target: 'target-ws-tenant', releasePipelineLocation: ReleasePipelineLocation.target, labels: [], params: [], @@ -85,8 +85,8 @@ describe('createReleasePlan', () => { path: '/', }, }, - 'test-ns', - 'test-ws', + 'test-ns-tenant', + 'test-ws-tenant', ); expect(result).toEqual( expect.objectContaining({ @@ -131,8 +131,8 @@ describe('createReleasePlan', () => { path: '/', }, }, - 'test-ns', - 'test-ws', + 'test-ns-tenant', + 'test-ws-tenant', ); expect(result.metadata.labels).toEqual({ 'release.appstudio.openshift.io/auto-release': 'true', @@ -154,8 +154,8 @@ describe('createReleasePlan', () => { path: '/', }, }, - 'test-ns', - 'test-ws', + 'test-ns-tenant', + 'test-ws-tenant', ); expect(result.metadata.labels).toEqual({ 'release.appstudio.openshift.io/auto-release': 'true', @@ -182,7 +182,7 @@ describe('editReleasePlan', () => { path: '/', }, }, - 'my-ws', + 'my-ws-tenant', ); expect(result.spec.target).toBe('my-ws-tenant'); diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/form-utils.ts b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/form-utils.ts index aa54c5fc..df6ddd85 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/form-utils.ts +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanForm/form-utils.ts @@ -15,8 +15,6 @@ export enum ReleasePipelineLocation { target, } -const WORKSPACE_SUFFIX = 'tenant'; - export type ReleasePlanFormValues = { name: string; application: string; @@ -88,7 +86,7 @@ export const createReleasePlan = async ( autoRelease, standingAttribution, } = values; - const targetWs = releasePipelineLocation === ReleasePipelineLocation.current ? workspace : target; + const targetNs = releasePipelineLocation === ReleasePipelineLocation.current ? namespace : target; const labels = labelPairs .filter((l) => !!l.key) .reduce((acc, o) => ({ ...acc, [o.key]: o.value }), {} as Record); @@ -110,7 +108,7 @@ export const createReleasePlan = async ( application, ...(data ? { data } : {}), serviceAccount, - target: `${targetWs}-${WORKSPACE_SUFFIX}`, + target: `${targetNs}`, pipelineRef: { resolver: ResolverType.GIT, params: [ @@ -152,7 +150,7 @@ export const editReleasePlan = async ( autoRelease, standingAttribution, } = values; - const targetWs = releasePipelineLocation === ReleasePipelineLocation.current ? workspace : target; + const targetNs = releasePipelineLocation === ReleasePipelineLocation.current ? workspace : target; const labels = labelPairs .filter((l) => !!l.key) .reduce((acc, o) => ({ ...acc, [o.key]: o.value }), {} as Record); @@ -175,7 +173,7 @@ export const editReleasePlan = async ( application, ...(data ? { data } : {}), serviceAccount, - target: `${targetWs}-${WORKSPACE_SUFFIX}`, + target: `${targetNs}`, pipelineRef: { resolver: ResolverType.GIT, params: [ diff --git a/src/components/ReleaseService/ReleasePlan/ReleasePlanListHeader.tsx b/src/components/ReleaseService/ReleasePlan/ReleasePlanListHeader.tsx index 96840f28..d6ff8fbf 100644 --- a/src/components/ReleaseService/ReleasePlan/ReleasePlanListHeader.tsx +++ b/src/components/ReleaseService/ReleasePlan/ReleasePlanListHeader.tsx @@ -20,7 +20,7 @@ const ReleasePlanListHeader = () => { props: { className: releasesPlanTableColumnClasses.application }, }, { - title: 'Target Workspace', + title: 'Target Namespace', props: { className: releasesPlanTableColumnClasses.target }, }, {