refactor(docker): remove EndpointProvider from commit [EE-5641] (#9123)

pull/9132/head
Chaim Lev-Ari 2023-06-28 08:02:43 +07:00 committed by GitHub
parent f02ede00b3
commit 599d214e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -1,14 +1,11 @@
angular.module('portainer.docker').factory('Commit', [ angular.module('portainer.docker').factory('Commit', [
'$resource', '$resource',
'API_ENDPOINT_ENDPOINTS', 'API_ENDPOINT_ENDPOINTS',
'EndpointProvider', function CommitFactory($resource, API_ENDPOINT_ENDPOINTS) {
function CommitFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict'; 'use strict';
return $resource( return $resource(
API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/commit', API_ENDPOINT_ENDPOINTS + '/:environmentId/docker/commit',
{ {},
endpointId: EndpointProvider.endpointID,
},
{ {
commitContainer: { method: 'POST', params: { container: '@id', repo: '@repo' }, ignoreLoadingBar: true }, commitContainer: { method: 'POST', params: { container: '@id', repo: '@repo' }, ignoreLoadingBar: true },
} }

View File

@ -260,7 +260,7 @@ angular.module('portainer.docker').controller('ContainerController', [
const registryModel = $scope.config.RegistryModel; const registryModel = $scope.config.RegistryModel;
const imageConfig = ImageHelper.createImageConfigForContainer(registryModel); const imageConfig = ImageHelper.createImageConfigForContainer(registryModel);
try { try {
await Commit.commitContainer({ id: $transition$.params().id, repo: imageConfig.fromImage }).$promise; await Commit.commitContainer({ environmentId: endpoint.Id }, { id: $transition$.params().id, repo: imageConfig.fromImage }).$promise;
Notifications.success('Image created', $transition$.params().id); Notifications.success('Image created', $transition$.params().id);
$state.reload(); $state.reload();
} catch (err) { } catch (err) {