Commit b66b12b8 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'dz-fix-environments-logs' into 'master'

Fix environment containers logs

See merge request gitlab-org/gitlab!21205
parents 2a556cb7 6e19be45
...@@ -11,11 +11,11 @@ export default { ...@@ -11,11 +11,11 @@ export default {
groupEpicsPath: groupEpicsPath:
'/api/:version/groups/:id/epics?include_ancestor_groups=:includeAncestorGroups&include_descendant_groups=:includeDescendantGroups', '/api/:version/groups/:id/epics?include_ancestor_groups=:includeAncestorGroups&include_descendant_groups=:includeDescendantGroups',
epicIssuePath: '/api/:version/groups/:id/epics/:epic_iid/issues/:issue_id', epicIssuePath: '/api/:version/groups/:id/epics/:epic_iid/issues/:issue_id',
podLogsPath: '/:project_full_path/environments/:environment_id/pods/containers/logs.json', podLogsPath: '/:project_full_path/-/environments/:environment_id/pods/containers/logs.json',
podLogsPathWithPod: podLogsPathWithPod:
'/:project_full_path/environments/:environment_id/pods/:pod_name/containers/logs.json', '/:project_full_path/-/environments/:environment_id/pods/:pod_name/containers/logs.json',
podLogsPathWithPodContainer: podLogsPathWithPodContainer:
'/:project_full_path/environments/:environment_id/pods/:pod_name/containers/:container_name/logs.json', '/:project_full_path/-/environments/:environment_id/pods/:pod_name/containers/:container_name/logs.json',
groupPackagesPath: '/api/:version/groups/:id/packages', groupPackagesPath: '/api/:version/groups/:id/packages',
projectPackagesPath: '/api/:version/projects/:id/packages', projectPackagesPath: '/api/:version/projects/:id/packages',
projectPackagePath: '/api/:version/projects/:id/packages/:package_id', projectPackagePath: '/api/:version/projects/:id/packages/:package_id',
......
...@@ -181,7 +181,7 @@ describe('Api', () => { ...@@ -181,7 +181,7 @@ describe('Api', () => {
}); });
it('calls `axios.get` with pod_name and container_name', done => { it('calls `axios.get` with pod_name and container_name', done => {
const expectedUrl = `${dummyUrlRoot}/${projectPath}/environments/${environmentId}/pods/${podName}/containers/${containerName}/logs.json`; const expectedUrl = `${dummyUrlRoot}/${projectPath}/-/environments/${environmentId}/pods/${podName}/containers/${containerName}/logs.json`;
Api.getPodLogs({ projectPath, environmentId, podName, containerName }) Api.getPodLogs({ projectPath, environmentId, podName, containerName })
.then(() => { .then(() => {
...@@ -192,7 +192,7 @@ describe('Api', () => { ...@@ -192,7 +192,7 @@ describe('Api', () => {
}); });
it('calls `axios.get` without pod_name and container_name', done => { it('calls `axios.get` without pod_name and container_name', done => {
const expectedUrl = `${dummyUrlRoot}/${projectPath}/environments/${environmentId}/pods/containers/logs.json`; const expectedUrl = `${dummyUrlRoot}/${projectPath}/-/environments/${environmentId}/pods/containers/logs.json`;
Api.getPodLogs({ projectPath, environmentId }) Api.getPodLogs({ projectPath, environmentId })
.then(() => { .then(() => {
...@@ -203,7 +203,7 @@ describe('Api', () => { ...@@ -203,7 +203,7 @@ describe('Api', () => {
}); });
it('calls `axios.get` with pod_name', done => { it('calls `axios.get` with pod_name', done => {
const expectedUrl = `${dummyUrlRoot}/${projectPath}/environments/${environmentId}/pods/${podName}/containers/logs.json`; const expectedUrl = `${dummyUrlRoot}/${projectPath}/-/environments/${environmentId}/pods/${podName}/containers/logs.json`;
Api.getPodLogs({ projectPath, environmentId, podName }) Api.getPodLogs({ projectPath, environmentId, podName })
.then(() => { .then(() => {
......
...@@ -117,7 +117,7 @@ describe('Logs Store actions', () => { ...@@ -117,7 +117,7 @@ describe('Logs Store actions', () => {
state.environments.current = mockEnvId; state.environments.current = mockEnvId;
state.pods.current = mockPodName; state.pods.current = mockPodName;
const endpoint = `/${mockProjectPath}/environments/${mockEnvId}/pods/${mockPodName}/containers/logs.json`; const endpoint = `/${mockProjectPath}/-/environments/${mockEnvId}/pods/${mockPodName}/containers/logs.json`;
mock.onGet(endpoint).reply(200, { mock.onGet(endpoint).reply(200, {
pod_name: mockPodName, pod_name: mockPodName,
...@@ -147,7 +147,7 @@ describe('Logs Store actions', () => { ...@@ -147,7 +147,7 @@ describe('Logs Store actions', () => {
state.projectPath = mockProjectPath; state.projectPath = mockProjectPath;
state.environments.current = mockEnvId; state.environments.current = mockEnvId;
const endpoint = `/${mockProjectPath}/environments/${mockEnvId}/pods/containers/logs.json`; const endpoint = `/${mockProjectPath}/-/environments/${mockEnvId}/pods/containers/logs.json`;
mock.onGet(endpoint).reply(200, { mock.onGet(endpoint).reply(200, {
pod_name: mockPodName, pod_name: mockPodName,
...@@ -176,7 +176,7 @@ describe('Logs Store actions', () => { ...@@ -176,7 +176,7 @@ describe('Logs Store actions', () => {
state.projectPath = mockProjectPath; state.projectPath = mockProjectPath;
state.environments.current = mockEnvId; state.environments.current = mockEnvId;
const endpoint = `/${mockProjectPath}/environments/${mockEnvId}/pods/containers/logs.json`; const endpoint = `/${mockProjectPath}/-/environments/${mockEnvId}/pods/containers/logs.json`;
mock.onGet(endpoint).replyOnce(500); mock.onGet(endpoint).replyOnce(500);
testAction( testAction(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment