Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { GcePersistentDisk } from "./variants/gce-persistent-disk";
import { GitRepo } from "./variants/git-repo";
import { GlusterFs } from "./variants/gluster-fs";
import { HostPath } from "./variants/host-path";
import { ImageVolume } from "./variants/image";
import { IScsi } from "./variants/i-scsi";
import { Local } from "./variants/local";
import { NetworkFs } from "./variants/network-fs";
Expand Down Expand Up @@ -172,6 +173,13 @@ function renderVolumeVariant({ pod, volume }: VolumeVariantProps): VolumeVariant
};
}

if (volume.image) {
return {
kind: "image",
element: <ImageVolume variant={volume.image} pod={pod} volumeName={volume.name} />,
};
}

if (volume.iscsi) {
return {
kind: "iscsi",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright (c) Freelens Authors. All rights reserved.
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/

import React from "react";
import { DrawerItem } from "../../../../drawer";

import type { VolumeVariantComponent } from "../variant-helpers";

export const ImageVolume: VolumeVariantComponent<"image"> = ({ variant: { reference, pullPolicy } }) => (
<>
<DrawerItem name="OCI Reference">{reference}</DrawerItem>
<DrawerItem name="Pull Policy" hidden={!pullPolicy}>
{pullPolicy}
</DrawerItem>
</>
);
6 changes: 6 additions & 0 deletions packages/kube-object/src/specifics/pod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ export interface VsphereVolumeSource {
storagePolicyID?: string;
}

export interface ImageVolumeSource {
reference?: string;
pullPolicy?: "Always" | "Never" | "IfNotPresent";
}

export interface ContainerStorageInterfaceSource {
driver: string;
/**
Expand Down Expand Up @@ -517,6 +522,7 @@ export interface PodVolumeVariants {
gitRepo: GitRepoSource;
glusterfs: GlusterFsSource;
hostPath: HostPathSource;
image: ImageVolumeSource;
iscsi: IScsiSource;
local: LocalSource;
nfs: NetworkFsSource;
Expand Down