mirror of
https://github.com/portainer/portainer.git
synced 2025-08-03 21:05:23 +02:00
feat(podman): support add podman envs in the wizard [r8s-20] (#12056)
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
This commit is contained in:
parent
db616bc8a5
commit
32e94d4e4e
108 changed files with 1921 additions and 272 deletions
|
@ -1,15 +1,17 @@
|
|||
import { PorImageRegistryModel } from 'Docker/models/porImageRegistry';
|
||||
import { fullURIIntoRepoAndTag } from '@/react/docker/images/utils';
|
||||
|
||||
angular.module('portainer.docker').controller('ImportImageController', [
|
||||
'$scope',
|
||||
'$state',
|
||||
'$async',
|
||||
'ImageService',
|
||||
'Notifications',
|
||||
'HttpRequestHelper',
|
||||
'Authentication',
|
||||
'ImageHelper',
|
||||
'endpoint',
|
||||
function ($scope, $state, ImageService, Notifications, HttpRequestHelper, Authentication, ImageHelper, endpoint) {
|
||||
function ($scope, $state, $async, ImageService, Notifications, HttpRequestHelper, Authentication, ImageHelper, endpoint) {
|
||||
$scope.state = {
|
||||
actionInProgress: false,
|
||||
};
|
||||
|
@ -33,15 +35,20 @@ angular.module('portainer.docker').controller('ImportImageController', [
|
|||
const registryModel = $scope.formValues.RegistryModel;
|
||||
if (registryModel.Image) {
|
||||
const image = ImageHelper.createImageConfigForContainer(registryModel);
|
||||
const { repo, tag } = fullURIIntoRepoAndTag(image.fromImage);
|
||||
try {
|
||||
await ImageService.tagImage(id, image.fromImage);
|
||||
await ImageService.tagImage(id, repo, tag);
|
||||
} catch (err) {
|
||||
Notifications.error('Failure', err, 'Unable to tag image');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.uploadImage = async function () {
|
||||
$scope.uploadImage = function () {
|
||||
return $async(uploadImageAsync);
|
||||
};
|
||||
|
||||
async function uploadImageAsync() {
|
||||
$scope.state.actionInProgress = true;
|
||||
|
||||
var nodeName = $scope.formValues.NodeName;
|
||||
|
@ -52,7 +59,8 @@ angular.module('portainer.docker').controller('ImportImageController', [
|
|||
if (data.error) {
|
||||
Notifications.error('Failure', data.error, 'Unable to upload image');
|
||||
} else if (data.stream) {
|
||||
var regex = /Loaded.*?: (.*?)\n$/g;
|
||||
// docker has /n at the end of the stream, podman doesn't
|
||||
var regex = /Loaded.*?: (.*?)(?:\n|$)/g;
|
||||
var imageIds = regex.exec(data.stream);
|
||||
if (imageIds && imageIds.length == 2) {
|
||||
await tagImage(imageIds[1]);
|
||||
|
@ -67,6 +75,6 @@ angular.module('portainer.docker').controller('ImportImageController', [
|
|||
} finally {
|
||||
$scope.state.actionInProgress = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue