Compare commits

..

8 Commits

Author SHA1 Message Date
github-actions[bot] 9655514066 ci: update artifact hub metadata for v0.3.10 2026-02-12 15:33:30 +00:00
Chris Farhood ece87a9824 chore: bump version to 0.3.10
Fixes:
- Drawer transparency using --mui-palette-background-default
- Plugin settings page blank due to name mismatch

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>
2026-02-12 10:32:51 -05:00
Chris Farhood 5adcca2eb9 fix: plugin settings name must match package.json
Changed registerPluginSettings from 'headlamp-polaris-plugin' to 'polaris'
to match package.json name field. Headlamp requires exact match for
settings registration, otherwise settings page renders blank.

Root cause: When package.json was renamed to 'polaris' in PR #9,
the settings registration was not updated.

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>
2026-02-12 10:32:20 -05:00
github-actions[bot] 6965103113 ci: update artifact hub metadata for v0.3.9 2026-02-12 14:37:56 +00:00
Chris Farhood 0659afcf6e chore: bump version to 0.3.9
Fixes drawer transparency by using --mui-palette-background-default
which is fully opaque and follows Headlamp's theme system.

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>
2026-02-12 09:37:07 -05:00
Chris Farhood 808f60ad88 fix: use Headlamp theme system for drawer background
Replace hardcoded colors with --mui-palette-background-default which:
- Is fully opaque (fixes transparency issue)
- Automatically adapts to Headlamp's light/dark theme
- Matches pattern used throughout codebase
- Eliminates need for media query

Previous approach used hardcoded #ffffff/#1e1e1e which didn't
follow Headlamp's theme settings or custom themes.

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>
2026-02-12 09:30:47 -05:00
Chris Farhood ade6bf93a7 fix: use explicit opaque colors for drawer background
The previous approach using 'opacity: 1' and CSS variable
'var(--mui-palette-background-paper)' did not work because:
- CSS variable can resolve to semi-transparent rgba() values
- opacity property does not affect background color alpha channel
- Semi-transparent background allowed backdrop to bleed through

Solution:
- Use explicit opaque hex colors (#ffffff light, #1e1e1e dark)
- CSS media query for dark mode: @media (prefers-color-scheme: dark)
- Unique class name per namespace to avoid conflicts
- Maintains proper text color with CSS variable fallbacks

Root cause identified by debugger agent: opacity multiplies element
rendering but does NOT fix backgroundColor alpha transparency.

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>
2026-02-12 09:28:24 -05:00
Chris Farhood 10ed01439c fix: use draft releases to prevent immutability errors
GitHub's immutable releases feature locks releases upon publication,
preventing asset uploads. This fix uses a two-step process:
1. Create draft release (mutable) and upload tarball
2. Publish release after assets are attached

Also adds validation to ensure tarball name matches package.json,
preventing future naming mismatch issues.

Changes:
- Upgrade from softprops/action-gh-release@v1 to @v2
- Create release as draft initially (draft: true)
- Add separate publish step after asset upload
- Add tarball name validation step

Fixes release workflow failures that occurred with v0.3.6 and v0.3.7.

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>
2026-02-12 08:42:39 -05:00
5 changed files with 155 additions and 123 deletions
+28 -3
View File
@@ -55,6 +55,23 @@ jobs:
if: env.SKIP_BUILD != 'true'
run: npx @kinvolk/headlamp-plugin package
- name: Validate tarball name matches package.json
if: env.SKIP_BUILD != 'true'
run: |
PACKAGE_NAME=$(jq -r '.name' package.json)
VERSION=${GITHUB_REF_NAME#v}
EXPECTED_TARBALL="${PACKAGE_NAME}-${VERSION}.tar.gz"
ACTUAL_TARBALL=$(ls *.tar.gz)
if [ "$EXPECTED_TARBALL" != "$ACTUAL_TARBALL" ]; then
echo "::error::Tarball name mismatch!"
echo "Expected: $EXPECTED_TARBALL"
echo "Actual: $ACTUAL_TARBALL"
echo "Update workflow to use correct tarball name pattern"
exit 1
fi
echo "✓ Tarball name validation passed: $ACTUAL_TARBALL"
- name: Compute tarball checksum
if: env.SKIP_BUILD != 'true'
run: |
@@ -65,17 +82,25 @@ jobs:
echo "Tarball: $TARBALL"
echo "Checksum: sha256:$CHECKSUM"
- name: Create GitHub release and upload tarball
- name: Create draft release and upload tarball
if: env.SKIP_BUILD != 'true'
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ env.TARBALL }}
fail_on_unmatched_files: true
draft: false
draft: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release
if: env.SKIP_BUILD != 'true'
uses: softprops/action-gh-release@v2
with:
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update metadata and align tag
if: env.SKIP_BUILD != 'true'
run: |
+3 -3
View File
@@ -1,4 +1,4 @@
version: 0.3.8
version: 0.3.10
name: headlamp-polaris-plugin
displayName: Polaris
createdAt: "2026-02-05T19:00:00Z"
@@ -28,7 +28,7 @@ maintainers:
- name: cpfarhood
email: "chris@farhood.org"
annotations:
headlamp/plugin/archive-url: "https://github.com/cpfarhood/headlamp-polaris-plugin/releases/download/v0.3.8/polaris-0.3.8.tar.gz"
headlamp/plugin/archive-url: "https://github.com/cpfarhood/headlamp-polaris-plugin/releases/download/v0.3.10/polaris-0.3.10.tar.gz"
headlamp/plugin/version-compat: ">=0.26"
headlamp/plugin/archive-checksum: sha256:109720d9ab5cf425fbf18619371b34f4eb555983b2877cce2eee0de2ce862a67
headlamp/plugin/archive-checksum: sha256:7df8d2066276eec0bdaad98d8a5bd7350861acc216963f7421c5ae476cd725b4
headlamp/plugin/distro-compat: in-cluster
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "polaris",
"version": "0.3.8",
"version": "0.3.10",
"description": "Headlamp plugin for Fairwinds Polaris audit results",
"repository": {
"type": "git",
+122 -115
View File
@@ -95,126 +95,133 @@ function NamespaceDetailPanel({ namespace, onClose }: NamespaceDetailPanelProps)
return countsPerResource.get(`${row.Namespace}/${row.Kind}/${row.Name}`) ?? resourceCounts(row);
}
// Generate a unique class name for this drawer to avoid conflicts
const drawerClass = `polaris-namespace-drawer-${namespace}`;
return (
<div
style={{
position: 'fixed',
right: 0,
top: 0,
bottom: 0,
width: '1000px',
backgroundColor: 'var(--mui-palette-background-paper)',
color: 'var(--mui-palette-text-primary)',
boxShadow: '-2px 0 8px rgba(0,0,0,0.15)',
overflowY: 'auto',
zIndex: 1200,
padding: '20px',
opacity: 1,
}}
>
<div
style={{
marginBottom: '20px',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<h2 style={{ margin: 0, color: 'var(--mui-palette-text-primary)' }}>
Polaris {namespace}
</h2>
<button
onClick={onClose}
<>
<style>
{`
.${drawerClass} {
position: fixed;
right: 0;
top: 0;
bottom: 0;
width: 1000px;
background-color: var(--mui-palette-background-default, #fafafa);
color: var(--mui-palette-text-primary);
box-shadow: -2px 0 8px rgba(0,0,0,0.15);
overflow-y: auto;
z-index: 1200;
padding: 20px;
}
`}
</style>
<div className={drawerClass}>
<div
style={{
border: 'none',
background: 'transparent',
fontSize: '24px',
cursor: 'pointer',
padding: '0 8px',
color: 'var(--mui-palette-text-primary)',
marginBottom: '20px',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
aria-label="Close panel"
>
×
</button>
<h2 style={{ margin: 0, color: 'var(--mui-palette-text-primary)' }}>
Polaris {namespace}
</h2>
<button
onClick={onClose}
style={{
border: 'none',
background: 'transparent',
fontSize: '24px',
cursor: 'pointer',
padding: '0 8px',
color: 'var(--mui-palette-text-primary)',
}}
aria-label="Close panel"
>
×
</button>
</div>
<SectionBox title="External">
<NameValueTable
rows={[
{
name: 'Polaris Dashboard',
value: (
<a href={getPolarisProxyUrl()} target="_blank" rel="noopener noreferrer">
View in Polaris Dashboard
</a>
),
},
]}
/>
</SectionBox>
<SectionBox title="Namespace Score">
<NameValueTable
rows={[
{
name: 'Score',
value: <StatusLabel status={status}>{score}%</StatusLabel>,
},
{ name: 'Total Checks', value: String(counts.total) },
{
name: 'Pass',
value: <StatusLabel status="success">{counts.pass}</StatusLabel>,
},
{
name: 'Warning',
value: <StatusLabel status="warning">{counts.warning}</StatusLabel>,
},
{
name: 'Danger',
value: <StatusLabel status="error">{counts.danger}</StatusLabel>,
},
{
name: 'Skipped',
value: (
<span title="Only counts checks with Severity=ignore. Annotation-based exemptions are not included.">
{counts.skipped}
</span>
),
},
]}
/>
</SectionBox>
<SectionBox title="Resources">
<SimpleTable
columns={[
{ label: 'Name', getter: (row: Result) => row.Name },
{ label: 'Kind', getter: (row: Result) => row.Kind },
{
label: 'Pass',
getter: (row: Result) => (
<StatusLabel status="success">{getResourceCounts(row).pass}</StatusLabel>
),
},
{
label: 'Warning',
getter: (row: Result) => (
<StatusLabel status="warning">{getResourceCounts(row).warning}</StatusLabel>
),
},
{
label: 'Danger',
getter: (row: Result) => (
<StatusLabel status="error">{getResourceCounts(row).danger}</StatusLabel>
),
},
]}
data={results}
emptyMessage={`No resources found in namespace "${namespace}".`}
/>
</SectionBox>
</div>
<SectionBox title="External">
<NameValueTable
rows={[
{
name: 'Polaris Dashboard',
value: (
<a href={getPolarisProxyUrl()} target="_blank" rel="noopener noreferrer">
View in Polaris Dashboard
</a>
),
},
]}
/>
</SectionBox>
<SectionBox title="Namespace Score">
<NameValueTable
rows={[
{
name: 'Score',
value: <StatusLabel status={status}>{score}%</StatusLabel>,
},
{ name: 'Total Checks', value: String(counts.total) },
{
name: 'Pass',
value: <StatusLabel status="success">{counts.pass}</StatusLabel>,
},
{
name: 'Warning',
value: <StatusLabel status="warning">{counts.warning}</StatusLabel>,
},
{
name: 'Danger',
value: <StatusLabel status="error">{counts.danger}</StatusLabel>,
},
{
name: 'Skipped',
value: (
<span title="Only counts checks with Severity=ignore. Annotation-based exemptions are not included.">
{counts.skipped}
</span>
),
},
]}
/>
</SectionBox>
<SectionBox title="Resources">
<SimpleTable
columns={[
{ label: 'Name', getter: (row: Result) => row.Name },
{ label: 'Kind', getter: (row: Result) => row.Kind },
{
label: 'Pass',
getter: (row: Result) => (
<StatusLabel status="success">{getResourceCounts(row).pass}</StatusLabel>
),
},
{
label: 'Warning',
getter: (row: Result) => (
<StatusLabel status="warning">{getResourceCounts(row).warning}</StatusLabel>
),
},
{
label: 'Danger',
getter: (row: Result) => (
<StatusLabel status="error">{getResourceCounts(row).danger}</StatusLabel>
),
},
]}
data={results}
emptyMessage={`No resources found in namespace "${namespace}".`}
/>
</SectionBox>
</div>
</>
);
}
+1 -1
View File
@@ -66,7 +66,7 @@ registerRoute({
});
// Register plugin settings
registerPluginSettings('headlamp-polaris-plugin', PolarisSettings, true);
registerPluginSettings('polaris', PolarisSettings, true);
// Register details view section for supported controller types
registerDetailsViewSection(({ resource }) => {