Skip to content

Commit 4ce9600

Browse files
committed
Fix ownerReference.controller to be false so that upstream providers properly handle it
Signed-off-by: Erick Bourgeois <erick.bourgeois@rbccm.com>
1 parent 05e232f commit 4ce9600

38 files changed

Lines changed: 860 additions & 654 deletions

.cargo/audit.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# cargo-audit configuration
2+
# https://rustsec.org/
3+
4+
[advisories]
5+
# Advisories to ignore (with justification)
6+
ignore = [
7+
# RUSTSEC-2026-0097: rand unsound with custom logger using rand::rng()
8+
# This is a transitive dependency from warp/tungstenite/kube-client.
9+
# We do not use rand::rng() with a custom logger in our codebase.
10+
# The vulnerability only affects code that:
11+
# 1. Uses a custom global logger (not tracing-subscriber)
12+
# 2. Calls rand::rng() from within that logger
13+
# Neither condition applies to 5-spot.
14+
"RUSTSEC-2026-0097",
15+
]

.claude/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ Establish baseline CI/CD pipeline for the 5-spot operator using the same firesto
462462
- `src/crd.rs`: Removed `namespace` field from `EmbeddedResource` — bootstrap and infrastructure resources are now always created in the ScheduledMachine's own namespace, preventing cross-namespace attacks
463463
- `src/crd.rs`: Added `timezone_schema()` with `maxLength: 64` and character-class pattern constraint to block log injection via the timezone field
464464
- `src/reconcilers/helpers.rs`: Fixed integer overflow in `parse_duration()` — now uses `checked_mul` and rejects durations exceeding 24 hours (`MAX_DURATION_SECS`)
465-
- `src/reconcilers/helpers.rs`: Added `validate_labels()` — rejects label/annotation keys using reserved prefixes (`kubernetes.io/`, `k8s.io/`, `cluster.x-k8s.io/`, `5spot.io/`) before merging into CAPI Machine resources
465+
- `src/reconcilers/helpers.rs`: Added `validate_labels()` — rejects label/annotation keys using reserved prefixes (`kubernetes.io/`, `k8s.io/`, `cluster.x-k8s.io/`, `5spot.finos.org/`) before merging into CAPI Machine resources
466466
- `src/reconcilers/helpers.rs`: Added `validate_api_group()` — enforces an allowlist of permitted API groups for bootstrap and infrastructure embedded resources; blocks core Kubernetes APIs (`v1`, `rbac.authorization.k8s.io/v1`, etc.)
467467
- `src/reconcilers/helpers.rs`: Wrapped `remove_machine_from_cluster` in `tokio::time::timeout` inside `handle_deletion` — finalizer cleanup now has a hard 10-minute deadline, preventing indefinite namespace deletion blocks
468468
- `src/reconcilers/scheduled_machine.rs`: Added `ValidationError` and `TimeoutError` variants to `ReconcilerError`

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Having `version` in MachineSpec created a conceptual mismatch with CAPI architec
107107
- `CAPI_MACHINE_API_VERSION_FULL`: "cluster.x-k8s.io/v1beta1"
108108
- `CAPI_CLUSTER_NAME_LABEL`: "cluster.x-k8s.io/cluster-name"
109109
- `CAPI_RESOURCE_MACHINES`: "machines"
110-
- `API_VERSION_FULL`: "capi.5spot.io/v1alpha1"
110+
- `API_VERSION_FULL`: "5spot.finos.org/v1alpha1"
111111

112112
- `src/main.rs`: Implemented actual Prometheus metrics
113113
- **Replaced** stub metrics endpoint with proper `prometheus::gather()` integration
@@ -204,7 +204,7 @@ where the cluster name is used by bootstrap and infrastructure providers.
204204

205205
### Changed
206206
- `src/crd.rs`: **BREAKING** - Converted from k0smotron to CAPI (Cluster API) based architecture
207-
- Changed API group from `5spot.eribourg.dev` to `capi.5spot.io`
207+
- Changed API group from `5spot.eribourg.dev` to `5spot.finos.org`
208208
- Added `bootstrap_ref` and `infrastructure_ref` for CAPI Machine creation
209209
- Made `files` field non-optional in `MachineSpec`
210210
- Renamed `FileContentFrom` types to `ContentSource` and `KeySelector` for consistency
@@ -214,7 +214,7 @@ where the cluster name is used by bootstrap and infrastructure providers.
214214
- Changed `machine_ref` to use `ObjectReference` instead of custom `MachineRef` type
215215

216216
- `src/constants.rs`: Updated all constants for CAPI architecture
217-
- Changed API group constants to `capi.5spot.io`
217+
- Changed API group constants to `5spot.finos.org`
218218
- Updated finalizer name to use new API group
219219
- Added CAPI Machine phase constants (Pending, Active, ShuttingDown, Inactive, Disabled, Terminated, Error)
220220
- Added CAPI API version constants (`cluster.x-k8s.io/v1beta1`)
@@ -256,7 +256,7 @@ Complete architectural shift from k0smotron-specific machine management to stand
256256
2. **Delete old CRD**: `kubectl delete crd scheduledmachines.5spot.eribourg.dev`
257257
3. **Deploy new CRD**: `kubectl apply -f deploy/crds/scheduledmachine.yaml`
258258
4. **Update all ScheduledMachine manifests** to new schema:
259-
- Change `apiVersion` from `5spot.eribourg.dev/v1alpha1` to `capi.5spot.io/v1alpha1`
259+
- Change `apiVersion` from `5spot.eribourg.dev/v1alpha1` to `5spot.finos.org/v1alpha1`
260260
- Add `bootstrapRef` and `infrastructureRef` fields
261261
- Update `files` structure (now required, not optional)
262262
- Ensure all file paths are absolute and start with `/`

Cargo.lock

Lines changed: 37 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
22

3-
# 5-Spot Machine Scheduler
3+
# <img src="docs/src/images/5-spot-icon.svg" alt="5-Spot Logo" width="60" style="vertical-align: middle; margin-right: 5px;" /> 5-Spot Machine Scheduler
44

55
A cloud-native Kubernetes controller for managing time-based machine scheduling on physical nodes using Cluster API (CAPI).
66

@@ -81,7 +81,7 @@ kubectl apply -f examples/scheduledmachine-basic.yaml
8181
## Example
8282

8383
```yaml
84-
apiVersion: capi.5spot.io/v1alpha1
84+
apiVersion: 5spot.finos.org/v1alpha1
8585
kind: ScheduledMachine
8686
metadata:
8787
name: business-hours-machine
@@ -334,7 +334,7 @@ make security-scan-local
334334
This creates a `.git/hooks/pre-commit` hook that scans staged changes before each commit.
335335

336336
3. **Configure allowlists** (for false positives):
337-
337+
338338
Edit `.gitleaks.toml` to add exceptions:
339339
```toml
340340
[allowlist]

deploy/admission/validatingadmissionpolicy.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# Apply with:
1414
# kubectl apply -f deploy/admission/validatingadmissionpolicy.yaml
1515
# kubectl apply -f deploy/admission/validatingadmissionpolicybinding.yaml
16-
---
1716
apiVersion: admissionregistration.k8s.io/v1
1817
kind: ValidatingAdmissionPolicy
1918
metadata:
@@ -28,10 +27,10 @@ spec:
2827

2928
matchConstraints:
3029
resourceRules:
31-
- apiGroups: ["capi.5spot.io"]
30+
- apiGroups: ["5spot.finos.org"]
3231
apiVersions: ["v1alpha1"]
33-
resources: ["scheduledmachines"]
34-
operations: ["CREATE", "UPDATE"]
32+
resources: ["scheduledmachines"]
33+
operations: ["CREATE", "UPDATE"]
3534

3635
validations:
3736

deploy/admission/validatingadmissionpolicybinding.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# Apply after the ValidatingAdmissionPolicy:
1010
# kubectl apply -f deploy/admission/validatingadmissionpolicy.yaml
1111
# kubectl apply -f deploy/admission/validatingadmissionpolicybinding.yaml
12-
---
1312
apiVersion: admissionregistration.k8s.io/v1
1413
kind: ValidatingAdmissionPolicyBinding
1514
metadata:

0 commit comments

Comments
 (0)