fix: use official Headlamp API instead of internal paths
The plugin was importing from internal Headlamp paths like '@kinvolk/headlamp-plugin/lib/lib/k8s/cluster' instead of using the official public API '@kinvolk/headlamp-plugin/lib'. This caused the plugin to fail loading in the browser with: "TypeError: undefined is not an object (evaluating 'Ot.KubeObject')" Changes: - Updated imports to use K8s.cluster and ApiProxy from main export - Added vite.config.js with custom globals (now obsolete with this fix) - Moved node-forge to dependencies for proper bundling The plugin now uses only the official documented Headlamp plugin API. Fixes: #[issue number if exists] Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
* SealedSecret Custom Resource Definition
|
||||
*/
|
||||
|
||||
import { apiFactoryWithNamespace } from '@kinvolk/headlamp-plugin/lib/lib/k8s/apiProxy';
|
||||
import { KubeObject } from '@kinvolk/headlamp-plugin/lib/lib/k8s/cluster';
|
||||
import { K8s, ApiProxy } from '@kinvolk/headlamp-plugin/lib';
|
||||
|
||||
const { apiFactoryWithNamespace } = ApiProxy;
|
||||
const { KubeObject } = K8s.cluster;
|
||||
import { AsyncResult, Err, Ok, tryCatchAsync } from '../types';
|
||||
import {
|
||||
SealedSecretInterface,
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
* TypeScript interfaces for Bitnami Sealed Secrets plugin
|
||||
*/
|
||||
|
||||
import { KubeObjectInterface } from '@kinvolk/headlamp-plugin/lib/lib/k8s/cluster';
|
||||
import { K8s } from '@kinvolk/headlamp-plugin/lib';
|
||||
|
||||
type KubeObjectInterface = K8s.cluster.KubeObjectInterface;
|
||||
|
||||
/**
|
||||
* Result type for operations that can fail
|
||||
|
||||
Reference in New Issue
Block a user