You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If **one cluster** found → automatically use it (extract kubeconfig path from column 2)
32
+
- If **multiple clusters** found → show the list to user and ask them to choose by number
33
+
- After selection, extract the kubeconfig path from column 2 of the chosen line
34
+
- Store the selected kubeconfig path in variable `KC` for use in subsequent steps
35
+
36
+
**Example output format parsing:**
37
+
- Column 1: Index number (for user selection)
38
+
- Column 2: Kubeconfig file path (this is what you need for `$KC`)
39
+
- Column 3: Cluster display name
40
+
- Column 4: Number of nodes
41
+
- Column 5: OVN namespace name
42
+
43
+
**Important**: Parse the output using standard text processing. The exact implementation is up to you - use whatever approach works best (awk, Python, inline parsing, etc.).
23
44
24
45
2.**Check Permissions**: Verify user's Kubernetes access level and inform about write permissions
25
46
26
-
Run: `scripts/check-permissions.py "$KC"`
47
+
Run: `scripts/check_permissions.py "$KC"`
27
48
28
49
The script returns:
29
50
-**Exit 0**: Read-only access or user confirmed → proceed
@@ -43,7 +64,7 @@ tools: [Bash, Read, Write]
43
64
5. If user says yes → continue, if no → stop
44
65
45
66
**Example of proper user communication:**
46
-
```
67
+
```text
47
68
⚠️ WARNING: Write Permissions Detected
48
69
49
70
Your kubeconfig has cluster admin permissions:
@@ -72,7 +93,7 @@ tools: [Bash, Read, Write]
72
93
73
94
4.**Collect OVN Data**: Get full topology data from the cluster
@@ -150,14 +171,14 @@ In **interconnect mode**, each node runs its own NBDB with local copies of compo
150
171
151
172
## Helper Scripts
152
173
153
-
All helper scripts are in the `scripts/` directory.
174
+
All helper scripts are in the `scripts/` directory.
154
175
155
176
| Script | Purpose | Input | Output |
156
177
|--------|---------|-------|--------|
157
-
|[detect-cluster.sh](scripts/detect-cluster.sh)| Find OVN cluster kubeconfig across all contexts. Scans multiple kubeconfig files and all their contexts. Prompts user if multiple clusters found. | None |Kubeconfig path to stdout, diagnostics to stderr. Exit: 0=success, 1=none found, 2=cancelled|
158
-
|[check-permissions.py](scripts/check-permissions.py)| Check user permissions and warn if write access detected. | KUBECONFIG path | Exit: 0=proceed, 1=cancelled/error, 2=write perms (needs user confirmation) |
159
-
|[collect-ovn-data.py](scripts/collect-ovn-data.py)|**Data collector**: Queries each node for all data, with **graceful degradation** (continues on node failures). Writes detail files. | KUBECONFIG path | Detail files: `ovn_switches_detail.txt`, `ovn_routers_detail.txt`, `ovn_lsps_detail.txt`, `ovn_lrps_detail.txt`, `ovn_pods_detail.txt`|
160
-
|[analyze-placement.py](scripts/analyze-placement.py)|**Placement analyzer**: Analyzes UUID patterns from detail files to determine per-node vs cluster-wide placement. | TMPDIR (reads detail files) | Placement files: `ovn_switch_placement.txt`, `ovn_router_placement.txt`|
178
+
|[detect-cluster.sh](scripts/detect-cluster.sh)| Find OVN cluster kubeconfig across all contexts. Scans multiple kubeconfig files and all their contexts. Returns parseable list. | None |Parseable list to stdout: `index|kubeconfig|cluster|nodes|namespace`. Exit: 0=success, 1=none found |
179
+
|[check_permissions.py](scripts/check_permissions.py)| Check user permissions and warn if write access detected. | KUBECONFIG path | Exit: 0=proceed, 1=cancelled/error, 2=write perms (needs user confirmation) |
180
+
|[collect_ovn_data.py](scripts/collect_ovn_data.py)|**Data collector**: Queries each node for all data, with **graceful degradation** (continues on node failures). Writes detail files. | KUBECONFIG path | Detail files: `ovn_switches_detail.txt`, `ovn_routers_detail.txt`, `ovn_lsps_detail.txt`, `ovn_lrps_detail.txt`, `ovn_pods_detail.txt`|
181
+
|[analyze_placement.py](scripts/analyze_placement.py)|**Placement analyzer**: Analyzes UUID patterns from detail files to determine per-node vs cluster-wide placement. | TMPDIR (reads detail files) | Placement files: `ovn_switch_placement.txt`, `ovn_router_placement.txt`|
161
182
162
183
---
163
184
@@ -301,7 +322,7 @@ graph BT
301
322
302
323
**CRITICAL: Discover pods from `$TMPDIR/ovn_pods_detail.txt`, NOT from LSPs**
303
324
304
-
The file `$TMPDIR/ovn_pods_detail.txt` contains ALL running pods in the cluster (populated by collect-ovn-data.py).
325
+
The file `$TMPDIR/ovn_pods_detail.txt` contains ALL running pods in the cluster (populated by collect_ovn_data.py).
0 commit comments