mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +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
|
@ -9,6 +9,12 @@ import {
|
|||
import { DockerImage } from './types';
|
||||
import { DockerImageResponse } from './types/response';
|
||||
|
||||
type ImageModel = {
|
||||
UseRegistry: boolean;
|
||||
Registry?: Registry;
|
||||
Image: string;
|
||||
};
|
||||
|
||||
export function parseViewModel(response: DockerImageResponse): DockerImage {
|
||||
return {
|
||||
...response,
|
||||
|
@ -40,11 +46,7 @@ export function imageContainsURL(image: string) {
|
|||
return false;
|
||||
}
|
||||
|
||||
export function buildImageFullURIFromModel(imageModel: {
|
||||
UseRegistry: boolean;
|
||||
Registry?: Registry;
|
||||
Image: string;
|
||||
}) {
|
||||
export function buildImageFullURIFromModel(imageModel: ImageModel) {
|
||||
const registry = imageModel.UseRegistry ? imageModel.Registry : undefined;
|
||||
return buildImageFullURI(imageModel.Image, registry);
|
||||
}
|
||||
|
@ -107,3 +109,24 @@ function buildImageFullURIWithRegistry(image: string, registry: Registry) {
|
|||
return url + image;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits a full URI into repository and tag.
|
||||
*
|
||||
* @param fullURI - The full URI to be split.
|
||||
* @returns An object containing the repository and tag.
|
||||
*/
|
||||
export function fullURIIntoRepoAndTag(fullURI: string) {
|
||||
// possible fullURI values (all should contain a tag):
|
||||
// - registry/image-repo:tag
|
||||
// - image-repo:tag
|
||||
// - registry:port/image-repo:tag
|
||||
// buildImageFullURIFromModel always gives a tag (defaulting to 'latest'), so the tag is always present after the last ':'
|
||||
const parts = fullURI.split(':');
|
||||
const tag = parts.pop() || 'latest';
|
||||
const repo = parts.join(':');
|
||||
return {
|
||||
repo,
|
||||
tag,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue