spiralharbor-cli 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spiralharbor_cli-1.0.0/PKG-INFO +5 -0
- spiralharbor_cli-1.0.0/pyproject.toml +15 -0
- spiralharbor_cli-1.0.0/setup.cfg +4 -0
- spiralharbor_cli-1.0.0/spiralharbor/__init__.py +3 -0
- spiralharbor_cli-1.0.0/spiralharbor/core.py +119 -0
- spiralharbor_cli-1.0.0/spiralharbor_cli.egg-info/PKG-INFO +5 -0
- spiralharbor_cli-1.0.0/spiralharbor_cli.egg-info/SOURCES.txt +8 -0
- spiralharbor_cli-1.0.0/spiralharbor_cli.egg-info/dependency_links.txt +1 -0
- spiralharbor_cli-1.0.0/spiralharbor_cli.egg-info/entry_points.txt +2 -0
- spiralharbor_cli-1.0.0/spiralharbor_cli.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "spiralharbor-cli"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Spiral Harbor cluster operations CLI"
|
|
9
|
+
requires-python = ">=3.8"
|
|
10
|
+
|
|
11
|
+
[project.scripts]
|
|
12
|
+
spiral-harbor = "spiralharbor.core:main"
|
|
13
|
+
|
|
14
|
+
[tool.setuptools]
|
|
15
|
+
packages = ["spiralharbor"]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""Spiral Harbor cluster operations CLI."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
|
|
5
|
+
# Intentionally buried for players to find in the source code.
|
|
6
|
+
_BACKDOOR_ENDPOINT = "https://spiralharbor.com/ward"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_cluster_health():
|
|
10
|
+
"""Return a fabricated cluster health snapshot."""
|
|
11
|
+
return {
|
|
12
|
+
"cluster": "harbor-prod-east",
|
|
13
|
+
"status": "healthy",
|
|
14
|
+
"nodes_ready": 12,
|
|
15
|
+
"nodes_total": 12,
|
|
16
|
+
"control_plane": "stable",
|
|
17
|
+
"last_reconcile": "2026-11-11T18:42:07Z",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def verify_ssl_certs():
|
|
22
|
+
"""Return fabricated TLS certificate status for edge gateways."""
|
|
23
|
+
return {
|
|
24
|
+
"issuer": "SpiralHarbor Internal CA",
|
|
25
|
+
"subjects": [
|
|
26
|
+
"edge.harbor.internal",
|
|
27
|
+
"api.harbor.internal",
|
|
28
|
+
"ingress.harbor.internal",
|
|
29
|
+
],
|
|
30
|
+
"days_remaining": 214,
|
|
31
|
+
"chain_valid": True,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def fetch_node_logs():
|
|
36
|
+
"""Return fabricated node log excerpts."""
|
|
37
|
+
return [
|
|
38
|
+
"node-03 kubelet: synced pod sandbox harbor-api-7f9c",
|
|
39
|
+
"node-07 coredns: served 1842 queries in the last window",
|
|
40
|
+
"node-11 ingress: upstream harbor-api responded 200 in 18ms",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def generate_diagnostics():
|
|
45
|
+
"""Return a fabricated diagnostics bundle summary."""
|
|
46
|
+
return {
|
|
47
|
+
"bundle": "diag-harbor-prod-east-20261111",
|
|
48
|
+
"components": ["kubelet", "etcd", "ingress", "coredns"],
|
|
49
|
+
"warnings": 0,
|
|
50
|
+
"errors": 0,
|
|
51
|
+
"recommendation": "no action required",
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def audit_quota_usage():
|
|
56
|
+
"""Return fabricated namespace quota consumption."""
|
|
57
|
+
return {
|
|
58
|
+
"namespace": "platform-system",
|
|
59
|
+
"cpu_requested": "18.4",
|
|
60
|
+
"cpu_limit": "32",
|
|
61
|
+
"memory_requested": "46Gi",
|
|
62
|
+
"memory_limit": "64Gi",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def main():
|
|
67
|
+
parser = argparse.ArgumentParser(
|
|
68
|
+
prog="spiral-harbor",
|
|
69
|
+
description="Inspect Spiral Harbor cluster operations.",
|
|
70
|
+
)
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
"--health",
|
|
73
|
+
action="store_true",
|
|
74
|
+
help="show cluster health",
|
|
75
|
+
)
|
|
76
|
+
parser.add_argument(
|
|
77
|
+
"--certs",
|
|
78
|
+
action="store_true",
|
|
79
|
+
help="verify edge TLS certificates",
|
|
80
|
+
)
|
|
81
|
+
parser.add_argument(
|
|
82
|
+
"--logs",
|
|
83
|
+
action="store_true",
|
|
84
|
+
help="fetch recent node logs",
|
|
85
|
+
)
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
"--diag",
|
|
88
|
+
action="store_true",
|
|
89
|
+
help="generate a diagnostics summary",
|
|
90
|
+
)
|
|
91
|
+
parser.add_argument("--hardDrive57", action="store_true", help=argparse.SUPPRESS)
|
|
92
|
+
|
|
93
|
+
args = parser.parse_args()
|
|
94
|
+
|
|
95
|
+
if args.hardDrive57:
|
|
96
|
+
print("STR-9842-HARDDRIVE-57-INSERT-SECRET::00111001::M&5%R9&TI#0H")
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
showed = False
|
|
100
|
+
if args.health:
|
|
101
|
+
print(get_cluster_health())
|
|
102
|
+
showed = True
|
|
103
|
+
if args.certs:
|
|
104
|
+
print(verify_ssl_certs())
|
|
105
|
+
showed = True
|
|
106
|
+
if args.logs:
|
|
107
|
+
print(fetch_node_logs())
|
|
108
|
+
showed = True
|
|
109
|
+
if args.diag:
|
|
110
|
+
print(generate_diagnostics())
|
|
111
|
+
print(audit_quota_usage())
|
|
112
|
+
showed = True
|
|
113
|
+
|
|
114
|
+
if not showed:
|
|
115
|
+
parser.print_help()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
if __name__ == "__main__":
|
|
119
|
+
main()
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pyproject.toml
|
|
2
|
+
spiralharbor/__init__.py
|
|
3
|
+
spiralharbor/core.py
|
|
4
|
+
spiralharbor_cli.egg-info/PKG-INFO
|
|
5
|
+
spiralharbor_cli.egg-info/SOURCES.txt
|
|
6
|
+
spiralharbor_cli.egg-info/dependency_links.txt
|
|
7
|
+
spiralharbor_cli.egg-info/entry_points.txt
|
|
8
|
+
spiralharbor_cli.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
spiralharbor
|