Skip to content
Closed
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
38 changes: 38 additions & 0 deletions files/k0s/manifests/kubestellar/35-default-controlplane.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: Namespace
metadata:
name: its1-system
labels:
app.kubernetes.io/part-of: kubestellar
---
apiVersion: tenancy.kflex.kubestellar.org/v1alpha1
kind: ControlPlane
metadata:
name: its1
labels:
app.kubernetes.io/name: controlplane
app.kubernetes.io/instance: its1
app.kubernetes.io/part-of: kubestellar
kflex.kubestellar.org/role: its
spec:
type: host
---
apiVersion: v1
kind: Namespace
metadata:
name: wds1-system
labels:
app.kubernetes.io/part-of: kubestellar
---
apiVersion: tenancy.kflex.kubestellar.org/v1alpha1
kind: ControlPlane
metadata:
name: wds1
labels:
app.kubernetes.io/name: controlplane
app.kubernetes.io/instance: wds1
app.kubernetes.io/part-of: kubestellar
kflex.kubestellar.org/role: wds
spec:
type: k8s
backend: shared
6 changes: 0 additions & 6 deletions files/k0s/manifests/kubestellar/40-kubestellar-console.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ spec:
- name: console
image: ghcr.io/kubestellar/console:v0.3.34
env:
- name: DEV_MODE
value: "true"
- name: ALLOW_DEV_MODE_IN_CLUSTER
value: "true"
- name: DEV_USER_LOGIN
value: "admin"
- name: GITHUB_CLIENT_ID
valueFrom:
secretKeyRef:
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test_k0s_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,22 @@ def test_k0s_manifest_files():
assert (ks_dir / "10-kubeflex-operator.yaml").is_file()
assert (ks_dir / "20-postgres.yaml").is_file()
assert (ks_dir / "30-kubestellar-core.yaml").is_file()
assert (ks_dir / "35-default-controlplane.yaml").is_file()
assert (ks_dir / "40-kubestellar-console.yaml").is_file()
assert (ks_dir / "41-kubestellar-kiosk-proxy.yaml").is_file()


def test_default_controlplanes_manifest():
manifest = ROOT / "files" / "k0s" / "manifests" / "kubestellar" / "35-default-controlplane.yaml"
assert manifest.is_file(), "35-default-controlplane.yaml missing"
docs = list(yaml.safe_load_all(manifest.read_text()))
controlplanes = [d for d in docs if d and d.get("kind") == "ControlPlane"]
assert len(controlplanes) >= 2
types_by_name = {cp["metadata"]["name"]: cp["spec"]["type"] for cp in controlplanes}
assert types_by_name.get("its1") == "host"
assert types_by_name.get("wds1") == "k8s"


def test_postgres_password_not_hardcoded():
# #98: the postgres superuser password must not be committed to git in
# plaintext, and must not be the publicly documented kubeflex default.
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/test_kubestellar_kiosk.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ def test_gate_waits_for_session_and_blocks_until_agent_health() -> None:
assert "z-index: 2147483647" in css


def test_console_provides_local_and_oauth_login_options() -> None:
def test_console_uses_github_oauth_secret_without_demo_mode() -> None:
console = CONSOLE_MANIFEST.read_text(encoding="utf-8")

assert "name: DEV_MODE" in console
assert 'value: "true"' in console
assert "name: ALLOW_DEV_MODE_IN_CLUSTER" in console
assert "DEV_MODE" not in console
assert "ALLOW_DEV_MODE_IN_CLUSTER" not in console
assert "hostPort:" not in console
assert "name: GITHUB_CLIENT_ID" in console
assert "name: GITHUB_CLIENT_SECRET" in console
Expand Down
Loading