1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 23:05:26 +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

This commit is contained in:
Ali 2024-09-25 11:55:07 +12:00 committed by GitHub
parent db616bc8a5
commit 32e94d4e4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
108 changed files with 1921 additions and 272 deletions

View file

@ -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;
}
};
}
},
]);

View file

@ -12,7 +12,7 @@
</div>
<div class="form-group">
<div class="col-sm-12 vertical-center">
<button type="button" class="btn btn-sm btn-primary" ngf-select ngf-min-size="10" ng-model="formValues.UploadFile">Select file</button>
<button type="button" class="btn btn-sm btn-primary !ml-0" ngf-select ngf-min-size="10" ng-model="formValues.UploadFile">Select file</button>
<span class="ml-1">
{{ formValues.UploadFile.name }}
<pr-icon icon="'x'" mode="'danger'" ng-if="!formValues.UploadFile"></pr-icon>
@ -27,7 +27,7 @@
<!-- !node-selection -->
</div>
<div class="row" authorization="DockerImageCreate">
<div class="col-lg-12 col-md-12 col-xs-12">
<div class="col-lg-12 col-md-12 col-xs-12 p-0">
<rd-widget>
<rd-widget-header icon="tag" title-text="Tag the image"></rd-widget-header>
<rd-widget-body>
@ -51,7 +51,7 @@
<div class="col-sm-12">
<button
type="button"
class="btn btn-primary btn-sm"
class="btn btn-primary btn-sm !ml-0"
ng-disabled="state.actionInProgress || !formValues.UploadFile"
ng-click="uploadImage()"
button-spinner="state.actionInProgress"