Skip to content

Commit

Permalink
feat: adjust to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskari committed Dec 9, 2024
1 parent 7a52a13 commit d3a05e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 6 additions & 0 deletions examples/custom-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Ensure that the `general.customElement` property matches the name of the custom

### 4. Deploy Your Extension

Before running the deployment command, ensure that your **Kubeconfig** is correctly exported and points to the desired cluster. You can check the current context by running:

```bash
kubectl config current-context
```

Run `./deploy-custom-extension.sh` to create a ConfigMap and deploy it to your cluster

Alternatively, you can use the following command:
Expand Down
11 changes: 3 additions & 8 deletions src/state/navigation/extensionsAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ const getExtensionWizards = async (
kubeconfigNamespace = 'kube-public',
currentNamespace: string,
permissionSet: PermissionSetState,
extCustomComponentsEnabled: boolean,
) => {
if (!fetchFn) {
return null;
Expand Down Expand Up @@ -184,10 +183,7 @@ const getExtensionWizards = async (
convertYamlToObject,
) as ExtResource,
};
if (extCustomComponentsEnabled) {
extResourceWithMetadata.data.customHtml =
extResourceWithMetadata.data.customHtml || '';
}

if (!extResourceWithMetadata.data) return accumulator;

const indexOfTheSameExtension = accumulator.findIndex(ext =>
Expand Down Expand Up @@ -337,9 +333,9 @@ const getExtensions = async (

if (extCustomComponentsEnabled) {
extResourceWithMetadata.data.customHtml =
currentConfigMap.data.customHtml;
currentConfigMap.data.customHtml || '';
extResourceWithMetadata.data.customScript =
currentConfigMap.data.customScript;
currentConfigMap.data.customScript || '';
}
if (!extResourceWithMetadata.data) return accumulator;

Expand Down Expand Up @@ -498,7 +494,6 @@ export const useGetExtensions = () => {
cluster.currentContext.namespace || 'kube-public',
namespace,
permissionSet,
isExtensibilityCustomComponentsEnabled ?? false,
);

if (!wizardConfigs || !isExtensibilityWizardEnabled) {
Expand Down

0 comments on commit d3a05e9

Please sign in to comment.