Skip to content

Commit

Permalink
Hide pod volumes with podman < 4
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Sep 19, 2022
1 parent c56f823 commit f6d39f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/Containers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
22 changes: 12 additions & 10 deletions src/PodCreateModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down Expand Up @@ -125,15 +125,17 @@ export const PodCreateModal = ({ user, selinuxAvailable, systemServiceAvailable,
default={{ IP: null, containerPort: null, hostPort: null, protocol: 'tcp' }}
itemcomponent={ <PublishPort />} />

<DynamicListForm id='create-pod-dialog-volume'
emptyStateString={_("No volumes specified")}
formclass='volume-form'
label={_("Volumes")}
actionLabel={_("Add volume")}
onChange={value => setVolumes(value)}
default={{ containerPath: null, hostPath: null, mode: 'rw' }}
options={{ selinuxAvailable }}
itemcomponent={ <Volume />} />
{version.localeCompare("4", undefined, { numeric: true, sensitivity: 'base' }) >= 0 &&
<DynamicListForm id='create-pod-dialog-volume'
emptyStateString={_("No volumes specified")}
formclass='volume-form'
label={_("Volumes")}
actionLabel={_("Add volume")}
onChange={value => setVolumes(value)}
default={{ containerPath: null, hostPath: null, mode: 'rw' }}
options={{ selinuxAvailable }}
itemcomponent={ <Volume />} />
}

</Form>
);
Expand Down

0 comments on commit f6d39f6

Please sign in to comment.