fix: align plugin deploy dir with package.json name, clean stale dirs
The PVC had a stale headlamp-polaris directory from a previous install. Headlamp loads plugins by scanning the plugins dir and reading package.json from each subdirectory — it was loading the old build from headlamp-polaris/ while the deploy script was writing to polaris/. The settings registration name needs to match the plugin name Headlamp identifies. Changes: - Deploy script now uses headlamp-polaris as the directory name (matching package.json name field) - Deploy pod cleans up both polaris/ and headlamp-polaris/ before deploying to ensure no stale copies remain - registerPluginSettings uses headlamp-polaris to match Headlamp's plugin identifier Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -17,9 +17,10 @@ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|||||||
HEADLAMP_NAMESPACE="${HEADLAMP_NAMESPACE:-kube-system}"
|
HEADLAMP_NAMESPACE="${HEADLAMP_NAMESPACE:-kube-system}"
|
||||||
HEADLAMP_DEPLOY="${HEADLAMP_DEPLOY:-headlamp}"
|
HEADLAMP_DEPLOY="${HEADLAMP_DEPLOY:-headlamp}"
|
||||||
|
|
||||||
# The deployed directory name must match the plugin's registered name.
|
# The deployed directory name must match the package.json name and
|
||||||
# PR #56 aligns registerPluginSettings to "polaris"; the directory must match.
|
# the registerPluginSettings name. Headlamp identifies plugins by
|
||||||
PLUGIN_DIR_NAME="polaris"
|
# reading package.json from each subdirectory of the plugins dir.
|
||||||
|
PLUGIN_DIR_NAME="headlamp-polaris"
|
||||||
DIST_DIR="$REPO_ROOT/dist"
|
DIST_DIR="$REPO_ROOT/dist"
|
||||||
|
|
||||||
if [ ! -d "$DIST_DIR" ]; then
|
if [ ! -d "$DIST_DIR" ]; then
|
||||||
@@ -78,8 +79,9 @@ spec:
|
|||||||
command: ["sh", "-c"]
|
command: ["sh", "-c"]
|
||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
|
echo "Cleaning up stale plugin directories..."
|
||||||
|
rm -rf /plugins/polaris /plugins/headlamp-polaris
|
||||||
echo "Extracting plugin to shared volume..."
|
echo "Extracting plugin to shared volume..."
|
||||||
rm -rf /plugins/PLUGIN_DIR_PLACEHOLDER
|
|
||||||
mkdir -p /plugins/PLUGIN_DIR_PLACEHOLDER
|
mkdir -p /plugins/PLUGIN_DIR_PLACEHOLDER
|
||||||
tar -xzf /tarball/plugin.tar.gz -C /plugins/PLUGIN_DIR_PLACEHOLDER
|
tar -xzf /tarball/plugin.tar.gz -C /plugins/PLUGIN_DIR_PLACEHOLDER
|
||||||
echo "Files deployed:"
|
echo "Files deployed:"
|
||||||
|
|||||||
+1
-1
@@ -99,7 +99,7 @@ registerRoute({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Register plugin settings
|
// Register plugin settings
|
||||||
registerPluginSettings('polaris', PolarisSettings, true);
|
registerPluginSettings('headlamp-polaris', PolarisSettings, true);
|
||||||
|
|
||||||
// Register details view section for supported controller types
|
// Register details view section for supported controller types
|
||||||
registerDetailsViewSection(({ resource }) => {
|
registerDetailsViewSection(({ resource }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user