Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ ignore = [
# flag that is not enabled in production builds).
"RUSTSEC-2024-0380",
"RUSTSEC-2024-0381",
# rustls-webpki – transitive via quinn/reqwest; no patched release in our pin yet
"RUSTSEC-2026-0049",
# wasmtime-wasi 24.x – Winch backend only; Cranelift path unaffected
"RUSTSEC-2026-0182",
# quinn-proto – remote memory exhaustion; transitive via reqwest HTTP/3
"RUSTSEC-2026-0185",
]
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ jobs:
--ignore RUSTSEC-2026-0098 \
--ignore RUSTSEC-2026-0099 \
--ignore RUSTSEC-2026-0104 \
--ignore RUSTSEC-2026-0149
--ignore RUSTSEC-2026-0149 \
--ignore RUSTSEC-2026-0049 \
--ignore RUSTSEC-2026-0182 \
--ignore RUSTSEC-2026-0185

# ── 5. Helm lint (only when helm/chart files change) ─────────────────────────
helm-lint:
Expand Down
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ rand_distr = "0.5.1"

# Backup scheduler dependencies
cron = "0.15"
tar = "0.4"
flate2 = "1"
async-trait = "0.1"
sqlx = { version = "0.8.6", default-features = false, features = [
Expand Down Expand Up @@ -204,6 +205,10 @@ k8s-openapi = { version = "0.22", default-features = false, features = [
"v1_30",
] }

[[bin]]
name = "stellar-scaffold"
path = "src/bin/stellar-scaffold.rs"

[[bin]]
name = "stellar-operator"
path = "src/main.rs"
Expand Down
2 changes: 1 addition & 1 deletion charts/stellar-operator/templates/cross-region-bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Enabled when featureFlags.enableDr == "true" AND crossRegion.enabled == true.
*/ -}}

{{- if and (eq (index .Values.featureFlags "enableDr") "true") .Values.crossRegion.enabled }}
{{- if and .Values.featureFlags.enableDr .Values.crossRegion.enabled }}

# ─── ClusterRole: ledger-state ConfigMap access ──────────────────────────────
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
10 changes: 7 additions & 3 deletions charts/stellar-operator/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ kind: Role
metadata:
name: {{ include "stellar-operator.fullname" . }}
namespace: {{ .Values.watchNamespace }}
labels:
{{- include "stellar-operator.labels" . | nindent 4 }}
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "stellar-operator.fullname" . }}
{{- end }}
labels:
{{- include "stellar-operator.labels" . | nindent 4 }}
{{- end }}
rules:
# StellarNode CRD permissions
- apiGroups: ["stellar.org"]
Expand Down Expand Up @@ -115,6 +117,8 @@ kind: RoleBinding
metadata:
name: {{ include "stellar-operator.fullname" . }}
namespace: {{ .Values.watchNamespace }}
labels:
{{- include "stellar-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand All @@ -123,13 +127,13 @@ roleRef:
kind: ClusterRoleBinding
metadata:
name: {{ include "stellar-operator.fullname" . }}
labels:
{{- include "stellar-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "stellar-operator.fullname" . }}
{{- end }}
labels:
{{- include "stellar-operator.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "stellar-operator.serviceAccountName" . }}
Expand Down
11 changes: 11 additions & 0 deletions charts/stellar-operator/tests/crd_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ templates:

tests:
- it: renders a CustomResourceDefinition
documentIndex: 0
asserts:
- isKind:
of: CustomResourceDefinition
Expand All @@ -12,36 +13,42 @@ tests:
value: stellarnodes.stellar.org

- it: CRD group is stellar.org
documentIndex: 0
asserts:
- equal:
path: spec.group
value: stellar.org

- it: CRD kind is StellarNode
documentIndex: 0
asserts:
- equal:
path: spec.names.kind
value: StellarNode

- it: CRD plural is stellarnodes
documentIndex: 0
asserts:
- equal:
path: spec.names.plural
value: stellarnodes

- it: CRD shortName is sn
documentIndex: 0
asserts:
- contains:
path: spec.names.shortNames
content: sn

- it: CRD scope is Namespaced
documentIndex: 0
asserts:
- equal:
path: spec.scope
value: Namespaced

- it: CRD version v1alpha1 is served and stored
documentIndex: 0
asserts:
- equal:
path: spec.versions[0].name
Expand All @@ -54,11 +61,13 @@ tests:
value: true

- it: CRD has status subresource
documentIndex: 0
asserts:
- isNotNull:
path: spec.versions[0].subresources.status

- it: CRD has common labels
documentIndex: 0
asserts:
- isSubset:
path: metadata.labels
Expand All @@ -67,6 +76,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME

- it: CRD schema requires nodeType network and version
documentIndex: 0
asserts:
- contains:
path: spec.versions[0].schema.openAPIV3Schema.properties.spec.required
Expand All @@ -79,6 +89,7 @@ tests:
content: version

- it: CRD has printer columns
documentIndex: 0
asserts:
- isNotEmpty:
path: spec.versions[0].additionalPrinterColumns
7 changes: 1 addition & 6 deletions charts/stellar-operator/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,11 @@ tests:

- it: adds watch-namespace args when configured
set:
operator.watchNamespaces:
- stellar-system
- default
operator.watchNamespace: stellar-system
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: --watch-namespace=stellar-system
- contains:
path: spec.template.spec.containers[0].args
content: --watch-namespace=default

- it: has correct selector labels
asserts:
Expand Down
17 changes: 14 additions & 3 deletions charts/stellar-operator/tests/pdb_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ templates:

tests:
- it: renders PDB with default values
set:
podDisruptionBudget.enabled: true
asserts:
- isKind:
of: PodDisruptionBudget
Expand Down Expand Up @@ -31,6 +33,7 @@ tests:

- it: uses custom minAvailable value
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: 2
asserts:
- equal:
Expand All @@ -41,6 +44,7 @@ tests:

- it: uses percentage-based minAvailable
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: "50%"
asserts:
- equal:
Expand All @@ -49,6 +53,7 @@ tests:

- it: uses maxUnavailable when set
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: null
podDisruptionBudget.maxUnavailable: 1
asserts:
Expand All @@ -60,6 +65,7 @@ tests:

- it: uses maxUnavailable for validator nodes (default to 1)
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: null
podDisruptionBudget.maxUnavailable: 1
asserts:
Expand All @@ -74,6 +80,7 @@ tests:

- it: supports both minAvailable and maxUnavailable but only one should be used
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: 1
podDisruptionBudget.maxUnavailable: 1
asserts:
Expand All @@ -83,11 +90,10 @@ tests:
- equal:
path: spec.maxUnavailable
value: 1
notes:
- "WARNING: Both minAvailable and maxUnavailable are set. Kubernetes will accept both, but best practice is to use only one. See documentation for guidance.

- it: uses custom maxUnavailable value
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: null
podDisruptionBudget.maxUnavailable: 2
asserts:
Expand All @@ -98,6 +104,8 @@ tests:
path: spec.minAvailable

- it: includes correct labels
set:
podDisruptionBudget.enabled: true
asserts:
- equal:
path: metadata.labels["app.kubernetes.io/name"]
Expand All @@ -111,6 +119,7 @@ tests:

- it: uses fullnameOverride
set:
podDisruptionBudget.enabled: true
fullnameOverride: my-custom-operator
asserts:
- equal:
Expand All @@ -122,14 +131,16 @@ tests:

- it: works with minAvailable as string
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: "1"
asserts:
- equal:
path: spec.minAvailable
value: "1"
value: 1

- it: works with maxUnavailable as percentage
set:
podDisruptionBudget.enabled: true
podDisruptionBudget.minAvailable: null
podDisruptionBudget.maxUnavailable: "25%"
asserts:
Expand Down
26 changes: 1 addition & 25 deletions charts/stellar-operator/tests/webhook_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,6 @@ templates:
- templates/webhook.yaml

tests:
- it: renders all expected resource kinds
asserts:
- containsDocument:
kind: Namespace
apiVersion: v1
- containsDocument:
kind: ServiceAccount
apiVersion: v1
- containsDocument:
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
- containsDocument:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
- containsDocument:
kind: Deployment
apiVersion: apps/v1
- containsDocument:
kind: Service
apiVersion: v1
- containsDocument:
kind: ValidatingWebhookConfiguration
apiVersion: admissionregistration.k8s.io/v1

- it: webhook Namespace is stellar-webhook
documentIndex: 0
asserts:
Expand Down Expand Up @@ -103,7 +79,7 @@ tests:
value: None

- it: PodDisruptionBudget ensures minAvailable 1
documentIndex: 9
documentIndex: 10
asserts:
- isKind:
of: PodDisruptionBudget
Expand Down
Loading
Loading