Skip to content

Commit e65da58

Browse files
committed
fix(undersync-switch): adjust inputs and document the flow inputs
Adjust the inputs to be displayed and document what they actually are and consume them from the inputs so that in the logging it shows how all the arguments were passed in.
1 parent 699afcc commit e65da58

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

charts/site-workflows/templates/sensor-ironic-port-delete.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ spec:
6262
parameters:
6363
- name: physical_network
6464
- name: force
65-
value: false
65+
value: "false"
6666
- name: dry_run
67-
value: false
67+
value: "false"
6868
# references the workflow
6969
workflowTemplateRef:
7070
name: undersync-switch

workflows/argo-events/workflowtemplates/undersync-switch.yaml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,60 @@ metadata:
44
annotations:
55
workflows.argoproj.io/title: Requests an Undersync run on a pair of switches
66
workflows.argoproj.io/description: |
7+
Requests an Undersync run for a switch pair identified by `physical_network`.
8+
9+
Parameters:
10+
11+
- `physical_network`: required switch pair / physical network identifier
12+
- `force`: push non-safe changes, without this config drift in non-safe areas won't apply
13+
- `dry_run`: show the intended changes without applying them
14+
15+
To test this workflow you can run it with the following:
16+
17+
```
18+
argo -n argo-events submit --from workflowtemplate/undersync-switch \
19+
-p physical_network=physnet1 -p force=false -p dry_run=false
20+
```
21+
722
Defined in `workflows/argo-events/workflowtemplates/undersync-switch.yaml`
823
kind: WorkflowTemplate
924
spec:
1025
entrypoint: undersync-switch
1126
serviceAccountName: workflow
27+
arguments:
28+
parameters:
29+
- name: physical_network
30+
description: Physical network or switch pair to run Undersync against.
31+
- name: force
32+
description: Force reconciliation even when the current state appears correct.
33+
default: "false"
34+
enum:
35+
- "true"
36+
- "false"
37+
- name: dry_run
38+
description: Preview the changes without making any updates.
39+
default: "false"
40+
enum:
41+
- "true"
42+
- "false"
1243
templates:
1344
- name: undersync-switch
45+
inputs:
46+
parameters:
47+
- name: physical_network
48+
- name: force
49+
- name: dry_run
1450
container:
1551
image: ghcr.io/rackerlabs/understack/ironic-nautobot-client:latest
1652
command:
1753
- undersync-switch
1854
args:
1955
- --physical-network
20-
- "{{workflow.parameters.physical_network}}"
56+
- "{{inputs.parameters.physical_network}}"
2157
- --dry-run
22-
- "{{workflow.parameters.dry_run}}"
58+
- "{{inputs.parameters.dry_run}}"
2359
- --force
24-
- "{{workflow.parameters.force}}"
60+
- "{{inputs.parameters.force}}"
2561
volumeMounts:
2662
- mountPath: /etc/nb-token/
2763
name: nb-token
@@ -35,11 +71,6 @@ spec:
3571
secretKeyRef:
3672
name: nautobot-token
3773
key: url
38-
inputs:
39-
parameters:
40-
- name: physical_network
41-
- name: force
42-
- name: dry_run
4374
volumes:
4475
- name: nb-token
4576
secret:

0 commit comments

Comments
 (0)