Compare commits

...

10 Commits

Author SHA1 Message Date
gitea-actions[bot] 8b8c447983 ci: update artifact hub metadata for v0.0.4 2026-02-06 21:57:57 +00:00
Chris Farhood 7b794f540f Merge pull request 'chore: bump version to 0.0.4' (#8) from release/v0.0.4 into main
Reviewed-on: farhoodliquor/polaris-headlamp-plugin#8
2026-02-06 21:55:13 +00:00
Chris Farhood 0f00fd2f29 chore: bump version to 0.0.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 16:54:24 -05:00
Chris Farhood f95a74c6ae Merge pull request 'fix: include package.json in Docker plugin directory' (#7) from fix/dockerfile-package-json into main
Reviewed-on: farhoodliquor/polaris-headlamp-plugin#7
2026-02-06 21:53:57 +00:00
Chris Farhood 60fc377442 fix: include package.json in Docker plugin directory
Headlamp's plugin discovery requires both main.js and package.json in
the plugin directory. The Dockerfile only copied dist/ (main.js),
causing the plugin to not be discovered at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 16:43:56 -05:00
Chris Farhood dd3e877580 Merge pull request 'chore: add linting, formatting, and type-checking' (#6) from chore/add-linting-formatting into main
Reviewed-on: farhoodliquor/polaris-headlamp-plugin#6
2026-02-06 21:39:37 +00:00
Chris Farhood da1ef7e0c3 chore: add linting, formatting, and type-checking
Add ESLint, Prettier, and TypeScript config files extending the shared
Headlamp plugin configs. Add npm scripts for lint/format. Auto-fix
existing source files. Add CI workflow for PRs and main pushes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 16:35:42 -05:00
gitea-actions[bot] 39878f63cc ci: update artifact hub metadata for v0.0.3 2026-02-06 21:01:11 +00:00
Chris Farhood 374e2f5b57 Merge pull request 'chore: bump version to 0.0.3' (#5) from release/v0.0.3 into main
Reviewed-on: farhoodliquor/polaris-headlamp-plugin#5
2026-02-06 20:58:43 +00:00
Chris Farhood 581219ceae chore: bump version to 0.0.3
AH doesn't re-process existing versions when a tag is force-moved,
so v0.0.2 is permanently stuck with a stale checksum. Releasing v0.0.3
so AH indexes it as a new version with the correct checksum from the
aligned tag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:57:41 -05:00
11 changed files with 61 additions and 36 deletions
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@headlamp-k8s/eslint-config'],
};
+27
View File
@@ -0,0 +1,27 @@
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
container: node:20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Lint
run: npx eslint --ext .ts,.tsx src/
- name: Type-check
run: npx tsc --noEmit
- name: Format check
run: npx prettier --check src/
+1
View File
@@ -0,0 +1 @@
module.exports = require('@headlamp-k8s/eslint-config/prettier-config');
+1
View File
@@ -7,3 +7,4 @@ RUN npx @kinvolk/headlamp-plugin build
FROM alpine:3.20
COPY --from=build /app/dist/ /plugins/polaris-headlamp-plugin/
COPY --from=build /app/package.json /plugins/polaris-headlamp-plugin/
+3 -3
View File
@@ -1,4 +1,4 @@
version: 0.0.2
version: 0.0.4
name: polaris-headlamp-plugin
displayName: Polaris
createdAt: "2026-02-05T19:00:00Z"
@@ -22,7 +22,7 @@ maintainers:
- name: cpfarhood
email: "chris@farhood.org"
annotations:
headlamp/plugin/archive-url: "https://github.com/cpfarhood/polaris-headlamp-plugin/releases/download/v0.0.2/polaris-headlamp-plugin-0.0.2.tar.gz"
headlamp/plugin/archive-url: "https://github.com/cpfarhood/polaris-headlamp-plugin/releases/download/v0.0.4/polaris-headlamp-plugin-0.0.4.tar.gz"
headlamp/plugin/version-compat: ">=0.26"
headlamp/plugin/archive-checksum: sha256:19cc243fec368e57a3c288ec73d9da60931f25d1e054ba2a84c55247d43d61bc
headlamp/plugin/archive-checksum: sha256:4c460681d389c8977d7e7ae57ac6aedd64281de4b58284b0bcc9fb34525432f2
headlamp/plugin/distro-compat: in-cluster
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "polaris-headlamp-plugin",
"version": "0.0.1",
"version": "0.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "polaris-headlamp-plugin",
"version": "0.0.1",
"version": "0.0.3",
"devDependencies": {
"@kinvolk/headlamp-plugin": "^0.13.0"
}
+6 -2
View File
@@ -1,12 +1,16 @@
{
"name": "polaris-headlamp-plugin",
"version": "0.0.2",
"version": "0.0.4",
"description": "Headlamp plugin for Fairwinds Polaris audit results",
"scripts": {
"start": "headlamp-plugin start",
"build": "headlamp-plugin build",
"package": "headlamp-plugin package",
"tsc": "tsc --noEmit"
"tsc": "tsc --noEmit",
"lint": "eslint --ext .ts,.tsx src/",
"lint:fix": "eslint --ext .ts,.tsx --fix src/",
"format": "prettier --write src/",
"format:check": "prettier --check src/"
},
"devDependencies": {
"@kinvolk/headlamp-plugin": "^0.13.0"
+1 -1
View File
@@ -157,7 +157,7 @@ export function usePolarisData(refreshIntervalSeconds: number): PolarisDataState
return;
}
const intervalId = window.setInterval(() => {
setTick((t) => t + 1);
setTick(t => t + 1);
}, refreshIntervalSeconds * 1000);
return () => window.clearInterval(intervalId);
}, [refreshIntervalSeconds]);
+12 -24
View File
@@ -1,8 +1,4 @@
import {
Loader,
SectionBox,
SectionHeader,
} from '@kinvolk/headlamp-plugin/lib/CommonComponents';
import { Loader, SectionBox, SectionHeader } from '@kinvolk/headlamp-plugin/lib/CommonComponents';
import React from 'react';
import {
AuditData,
@@ -20,19 +16,16 @@ const INTERVAL_OPTIONS = [
{ label: '30 minutes', value: 1800 },
];
function RefreshSettings(props: {
interval: number;
onChange: (seconds: number) => void;
}) {
function RefreshSettings(props: { interval: number; onChange: (seconds: number) => void }) {
return (
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<label htmlFor="polaris-refresh-interval">Refresh interval:</label>
<select
id="polaris-refresh-interval"
value={props.interval}
onChange={(e) => props.onChange(Number(e.target.value))}
onChange={e => props.onChange(Number(e.target.value))}
>
{INTERVAL_OPTIONS.map((opt) => (
{INTERVAL_OPTIONS.map(opt => (
<option key={opt.value} value={opt.value}>
{opt.label}
</option>
@@ -69,9 +62,7 @@ function ScoreBadge(props: { score: number }) {
const color = props.score >= 80 ? '#4caf50' : props.score >= 50 ? '#ff9800' : '#f44336';
return (
<div style={{ textAlign: 'center', marginBottom: '16px' }}>
<div style={{ fontSize: '3rem', fontWeight: 'bold', color }}>
{props.score}%
</div>
<div style={{ fontSize: '3rem', fontWeight: 'bold', color }}>{props.score}%</div>
<div style={{ fontSize: '0.875rem', opacity: 0.8 }}>Cluster Score</div>
</div>
);
@@ -135,13 +126,12 @@ export default function PolarisView() {
return (
<>
<SectionHeader title="Polaris" actions={[
<RefreshSettings
key="refresh"
interval={interval}
onChange={handleIntervalChange}
/>,
]} />
<SectionHeader
title="Polaris"
actions={[
<RefreshSettings key="refresh" interval={interval} onChange={handleIntervalChange} />,
]}
/>
{error && (
<SectionBox title="Error">
@@ -153,9 +143,7 @@ export default function PolarisView() {
{!data && !error && (
<SectionBox title="No Data">
<div style={{ padding: '16px' }}>
No Polaris audit results found.
</div>
<div style={{ padding: '16px' }}>No Polaris audit results found.</div>
</SectionBox>
)}
</>
+1 -4
View File
@@ -1,7 +1,4 @@
import {
registerRoute,
registerSidebarEntry,
} from '@kinvolk/headlamp-plugin/lib';
import { registerRoute, registerSidebarEntry } from '@kinvolk/headlamp-plugin/lib';
import React from 'react';
import PolarisView from './components/PolarisView';
+4
View File
@@ -0,0 +1,4 @@
{
"extends": "@kinvolk/headlamp-plugin/config/plugins-tsconfig.json",
"include": ["src"]
}