Skip to content

Commit

Permalink
add api version to cr
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwiaGowor committed Sep 16, 2024
1 parent 543e6e8 commit c65ca70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public/i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ custom-resource-definitions:
custom-resources:
description: <0>Custom resource</0> extends the Kubernetes API. You can define your own custom resource by creating a <1>CustomResourceDefinition</1> first.
title: Custom Resources
headers:
api-version: API Version
daemon-sets:
description: <0>DaemonSet</0> ensures that replicated Pods are running across a set of available nodes.
name_singular: DaemonSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { ReadonlyEditorPanel } from 'shared/components/ReadonlyEditorPanel';
import { activeNamespaceIdState } from 'state/activeNamespaceIdAtom';
import CRCreate from 'resources/CustomResourceDefinitions/CRCreate';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';

export default function CustomResource({ params }) {
const { t } = useTranslation();
const namespace = useRecoilValue(activeNamespaceIdState);
const {
customResourceDefinitionName,
Expand Down Expand Up @@ -52,6 +54,12 @@ export default function CustomResource({ params }) {
}${crdName}/${resourceName}`
: '';

const customColumns = [
{
header: t('custom-resources.headers.api-version'),
value: resource => resource.apiVersion,
},
];
const yamlPreview = resource => {
return Object.keys(resource || {})
?.map(key => {
Expand All @@ -76,6 +84,7 @@ export default function CustomResource({ params }) {
resourceType={crdName}
resourceName={resourceName}
namespace={namespace}
customColumns={customColumns}
createResourceForm={CRCreateWrapper}
customComponents={[yamlPreview]}
layoutCloseCreateUrl={params.layoutCloseCreateUrl}
Expand Down

0 comments on commit c65ca70

Please sign in to comment.