Skip to content

feat: HardeningProfile bootstrap support -- CAPI template merge + ONT-native NodeMaintenance#25

Merged
ontave merged 5 commits into
mainfrom
session/25-hardening-profile-ref
May 6, 2026
Merged

feat: HardeningProfile bootstrap support -- CAPI template merge + ONT-native NodeMaintenance#25
ontave merged 5 commits into
mainfrom
session/25-hardening-profile-ref

Conversation

@ontave
Copy link
Copy Markdown
Contributor

@ontave ontave commented May 6, 2026

Summary

  • CAPI path: ensureTalosConfigTemplate now reads HardeningProfile when hardeningProfileRef is set; merges SysctlParams into the CP-INV-009 base sysctl map, parses and appends MachineConfigPatches as JSON patch objects. reconcileCAPIPath sets HardeningApplied=True after template step when profile is referenced.
  • ONT-native path: New ensureBootstrapHardening in taloscluster_bootstrap_hardening.go. Called from main reconcile loop (Step G) after route result, for non-CAPI Ready clusters with hardeningProfileRef set. Creates NodeMaintenance (operation=hardening-apply, label ontai.dev/hardening-trigger=bootstrap) in seam-tenant-{cluster}. Sets HardeningApplied=False/HardeningPending while pending; HardeningApplied=True when NodeMaintenance.Ready=True. Returns RequeueAfter: 30s while pending.
  • Condition aliases: ConditionTypeHardeningApplied, ReasonHardeningApplied, ReasonHardeningPending, ReasonHardeningProfileNotValid aliased from seam-core conditions package in platform/api/v1alpha1/taloscluster_types.go
  • Closes PLATFORM-BL-HARDENINGPROFILE-MERGE

Test plan

  • TestEnsureBootstrapHardening_NilRef: no action when ref absent
  • TestEnsureBootstrapHardening_CreatesNodeMaintenance: NodeMaintenance created with correct label/operation; HardeningApplied=False/Pending returned
  • TestEnsureBootstrapHardening_NoDuplicate: no second NodeMaintenance when one already exists
  • TestEnsureBootstrapHardening_SetsAppliedWhenReady: HardeningApplied=True when NodeMaintenance.Ready=True
  • All 6 platform test packages green
  • go build ./... clean

🤖 Generated with Claude Code

ontave added 5 commits May 4, 2026 16:38
Governor directive (session/21): CODEBASE.md eliminated from all repos.
The graphify knowledge graph at ~/ontai/graphify-out/graph.json is the
sole authoritative source for codebase understanding. See root CONTEXT.md
and CLAUDE.md for the Graphify Source of Truth Protocol.
PlatformTenant was a planned CRD for tenant coordination that was never
implemented. Tenant coordination is handled by InfrastructureTalosCluster
(mode=import or mode=bootstrap) plus the conductor role=tenant Deployment
managed by the compiler enable bundle. Remove the forward-looking reference
from Step 4b to prevent agents from attempting to implement a non-existent
CRD category.
Replace /tmp/envtest-bins/1.35.0 (ephemeral, stale version) with the
canonical ontai root Makefile target: make envtest-setup && export
KUBEBUILDER_ASSETS=$(make -s envtest-path). Pinned to K8s 1.32.x.
- Remove ont-system talosconfig copy (PLATFORM-BL-TALOSCONFIG-ONTYSYSTEM-REMOVE):
  ensureExecutorTalosconfig now copies only to seam-tenant-{cluster}; day-2
  executor Jobs mount from Job namespace, never from ont-system.

- Canonical kubeconfig rename (PLATFORM-BL-KUBECONFIG-CANONICAL): removed
  tenantKubeconfigSecretName constant and ensureTenantKubeconfigCopy; both import
  and CAPI paths now read seam-mc-{cluster}-kubeconfig exclusively.
  platform_security.go no longer writes target-cluster-kubeconfig.
  PKI rotation e2e test updated to assert seam-mc-{cluster}-kubeconfig.

- CAPI tenant onboarding (PLATFORM-BL-CAPI-TENANT-ONBOARDING): step 8.5 added
  to reconcileCAPIPath after CAPI Running: ensureCAPITalosconfig, ensureCAPIKubeconfig,
  ensureTenantOnboarding called before ensureConductorReadyAndTransition.

- machineconfig-backup CRD and reconciler (PLATFORM-BL-MACHINECONFIG-BACKUP):
  TalosMachineConfigBackup CRD, MachineConfigBackupReconciler, generic
  ensureS3EnvSecretFor/resolveS3BackupSecretRef helpers. Registered in main.go.
…-native NodeMaintenance

CAPI path: ensureTalosConfigTemplate reads HardeningProfile when hardeningProfileRef is set,
merges SysctlParams into the CP-INV-009 base sysctl map, and appends MachineConfigPatches as
JSON patch objects. reconcileCAPIPath sets HardeningApplied=True after the template step.

ONT-native path: ensureBootstrapHardening creates a NodeMaintenance (operation=hardening-apply,
label ontai.dev/hardening-trigger=bootstrap) in seam-tenant-{cluster} after Ready. Validates
HardeningProfile.Valid=True before creation. Sets HardeningApplied=True when NodeMaintenance
reaches Ready=True. Returns RequeueAfter: 30s while pending. Idempotent via label check.

ConditionTypeHardeningApplied + reason aliases added to platform taloscluster_types.go.
4 unit tests: NilRef, CreatesNodeMaintenance, NoDuplicate, SetsAppliedWhenReady. All pass.
platform-schema.md §11, Decision 11.
@ontave ontave merged commit 7adcf2a into main May 6, 2026
1 of 3 checks passed
@ontave ontave deleted the session/25-hardening-profile-ref branch May 6, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant