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

@ -57,6 +57,7 @@ export function EdgeScriptSettingsFieldset({
type="text"
value={values.edgeIdGenerator}
name="edgeIdGenerator"
placeholder="e.g. uuidgen"
id="edge-id-generator-input"
onChange={(e) => setFieldValue(e.target.name, e.target.value)}
data-cy="edge-id-generator-input"
@ -81,7 +82,7 @@ export function EdgeScriptSettingsFieldset({
<Field
name="envVars"
as={Input}
placeholder="foo=bar,myvar"
placeholder="e.g. foo=bar"
id="env-variables-input"
/>
</FormControl>

View file

@ -35,6 +35,11 @@ export const commandsTabs: Record<string, CommandTab> = {
label: 'Docker Standalone',
command: buildLinuxStandaloneCommand,
},
podmanLinux: {
id: 'podman',
label: 'Podman',
command: buildLinuxPodmanCommand,
},
swarmWindows: {
id: 'swarm',
label: 'Docker Swarm',
@ -83,6 +88,45 @@ docker run -d \\
`;
}
function buildLinuxPodmanCommand(
agentVersion: string,
edgeKey: string,
properties: ScriptFormValues,
useAsyncMode: boolean,
edgeId?: string,
agentSecret?: string
) {
const { allowSelfSignedCertificates, edgeIdGenerator, envVars } = properties;
const env = buildDockerEnvVars(envVars, [
...buildDefaultDockerEnvVars(
edgeKey,
allowSelfSignedCertificates,
!edgeIdGenerator ? edgeId : undefined,
agentSecret,
useAsyncMode
),
...metaEnvVars(properties),
]);
return `${
edgeIdGenerator ? `PORTAINER_EDGE_ID=$(${edgeIdGenerator}) \n\n` : ''
}\
sudo systemctl enable --now podman.socket
sudo podman volume create portainer
sudo podman run -d \\
-v /run/podman/podman.sock:/var/run/docker.sock \\
-v /var/lib/containers/storage/volumes:/var/lib/docker/volumes \\
-v /:/host \\
-v portainer_agent_data:/data \\
--restart always \\
--privileged \\
${env} \\
--name portainer_edge_agent \\
portainer/agent:${agentVersion}
`;
}
export function buildWindowsStandaloneCommand(
agentVersion: string,
edgeKey: string,

View file

@ -3,7 +3,7 @@ import { EnvironmentGroupId } from '@/react/portainer/environments/environment-g
import { EdgeGroup } from '../../edge-groups/types';
export type Platform = 'standalone' | 'swarm' | 'k8s';
export type Platform = 'standalone' | 'swarm' | 'podman' | 'k8s';
export type OS = 'win' | 'linux';
export interface ScriptFormValues {