From f6d39f6428aa9f580221fa41aa35fb5f51a80e1b Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Mon, 19 Sep 2022 11:19:41 +0200 Subject: [PATCH] Hide pod volumes with podman < 4 --- src/Containers.jsx | 3 ++- src/PodCreateModal.jsx | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Containers.jsx b/src/Containers.jsx index c7857a54b..5e7e6857d 100644 --- a/src/Containers.jsx +++ b/src/Containers.jsx @@ -576,7 +576,8 @@ class Containers extends React.Component { selinuxAvailable={this.props.selinuxAvailable} systemServiceAvailable={this.props.systemServiceAvailable} userServiceAvailable={this.props.userServiceAvailable} - onAddNotification={this.props.onAddNotification} />); + onAddNotification={this.props.onAddNotification} + version={this.props.version} />); }; const filterRunning = diff --git a/src/PodCreateModal.jsx b/src/PodCreateModal.jsx index bfc0c49b9..54c6169c9 100644 --- a/src/PodCreateModal.jsx +++ b/src/PodCreateModal.jsx @@ -19,7 +19,7 @@ const _ = cockpit.gettext; const systemOwner = "system"; -export const PodCreateModal = ({ user, selinuxAvailable, systemServiceAvailable, userServiceAvailable }) => { +export const PodCreateModal = ({ user, selinuxAvailable, systemServiceAvailable, userServiceAvailable, version }) => { const [podName, setPodName] = useState(dockerNames.getRandomName()); const [nameError, setNameError] = useState(null); const [publish, setPublish] = useState([]); @@ -125,15 +125,17 @@ export const PodCreateModal = ({ user, selinuxAvailable, systemServiceAvailable, default={{ IP: null, containerPort: null, hostPort: null, protocol: 'tcp' }} itemcomponent={ } /> - setVolumes(value)} - default={{ containerPath: null, hostPath: null, mode: 'rw' }} - options={{ selinuxAvailable }} - itemcomponent={ } /> + {version.localeCompare("4", undefined, { numeric: true, sensitivity: 'base' }) >= 0 && + setVolumes(value)} + default={{ containerPath: null, hostPath: null, mode: 'rw' }} + options={{ selinuxAvailable }} + itemcomponent={ } /> + } );