Commit 00c6858
committed
Unify SSH key mount path format across all dataplane services
Previously, the SSH key mount path differed between global services
(DeployOnAllNodeSets=true) and non-global services:
- Global services: /runner/env/ssh_key/ssh_key_<nodesetname>
- Non-global services: /runner/env/ssh_key
The non-global services path happened to work because ansible-runner
has a built-in mechanism that looks for an SSH key at /runner/env/ssh_key
and automatically loads it into ssh-agent. However, this relied on
ansible-runner's implicit behavior rather than the explicit
ansible_ssh_private_key_file variable set in the inventory.
The inventory always sets ansible_ssh_private_key_file to
/runner/env/ssh_key/ssh_key_<nodesetname> regardless of service type
(see inventory.go line 178). This inconsistency meant non-global
services were mounting the SSH key at a different path than what
Ansible expected from the inventory variable, relying on ansible-runner's
fallback behavior. However, there were errors in ansible logs as
there were no files in /runner/env/ssh_key/ssh_key_<nodesetname>
which was confusing to users.
This change unifies the SSH key mount path to always use the format:
/runner/env/ssh_key/ssh_key_<nodesetname>
This ensures:
1. The mount path matches the ansible_ssh_private_key_file variable
set in the inventory for all service types
2. Explicit and consistent SSH key configuration rather than relying
on ansible-runner's implicit ssh-agent loading
3. Simplified code by removing the conditional branching
4. Consistent behavior between global and non-global services
For global services, multiple SSH keys are mounted (one per nodeset)
in the ssh_key folder. For non-global services, only the matching
nodeset's key is mounted, but at the same path format.
Assisted-by: Claude-4.5-opus
Signed-off-by: rabi <[email protected]>1 parent c2b767a commit 00c6858
File tree
16 files changed
+225
-228
lines changed- internal/dataplane/util
- test
- functional/dataplane
- kuttl/tests
- dataplane-deploy-global-service-test
- dataplane-deploy-multiple-secrets
- dataplane-deploy-no-nodes-test
- dataplane-deploy-tls-test
- dataplane-extramounts
- dataplane-service-config
- dataplane-service-custom-image
- dataplane-service-failure
16 files changed
+225
-228
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 319 | + | |
| 320 | + | |
330 | 321 | | |
331 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
332 | 327 | | |
333 | 328 | | |
334 | 329 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | | - | |
| 1390 | + | |
1391 | 1391 | | |
1392 | 1392 | | |
1393 | 1393 | | |
1394 | | - | |
| 1394 | + | |
1395 | 1395 | | |
1396 | 1396 | | |
1397 | 1397 | | |
| |||
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
1458 | | - | |
| 1458 | + | |
1459 | 1459 | | |
1460 | 1460 | | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | | - | |
| 1463 | + | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
| |||
0 commit comments