Skip to content

Commit

Permalink
chore(workflows): shorten to sync from synchronize
Browse files Browse the repository at this point in the history
Shorten to use "sync" instead of "synchronize" since k8s cuts some
things off at 63 characters so this will make it less likely to hit that
limit. Cleaned up the naming across the board including the workflows
and the source code.
  • Loading branch information
cardoe committed Aug 22, 2024
1 parent 902a492 commit 6f33a3d
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ spec:
templates:
- name: start
steps:
- - name: synchronize-provision-state-to-nautobot
- - name: sync-provision-state-to-nautobot
templateRef:
name: synchronize-provision-state-to-nautobot
template: synchronize-state
name: sync-provision-state-to-nautobot
template: sync-state
arguments:
parameters:
- name: device_uuid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apiVersion: argoproj.io/v1alpha1
metadata:
name: synchronize-provision-state-to-nautobot
name: sync-provision-state-to-nautobot
annotations:
workflows.argoproj.io/description: |
Defined in `argo-workflows/ironic-to-nautobot-sensor/workflowtemplates/sync.yaml`
kind: WorkflowTemplate
spec:
serviceAccountName: workflow
templates:
- name: synchronize-state
- name: sync-state
container:
image: ghcr.io/rackerlabs/understack/ironic-nautobot-client:latest
command:
- synchronize-provision-state
- sync-provision-state
args:
- --device-id
- "{{workflow.parameters.device_uuid}}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: argoproj.io/v1alpha1
metadata:
name: synchronize-interfaces-to-ironic
name: sync-interfaces-to-ironic
annotations:
workflows.argoproj.io/description: |
Defined in `argo-workflows/sync-nb-server-to-ironic/synchronize-interfaces-to-ironic.yaml`
Defined in `argo-workflows/sync-nb-server-to-ironic/sync-interfaces-to-ironic.yaml`
kind: WorkflowTemplate
spec:
arguments:
Expand All @@ -18,7 +18,7 @@ spec:
container:
image: ghcr.io/rackerlabs/understack/ironic-nautobot-client:latest
command:
- synchronize-interfaces
- sync-interfaces
args:
- --device-id
- "{{inputs.parameters.device_id}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ spec:
templates:
- name: main
steps:
- - name: synchronize-server-to-ironic
- - name: sync-server-to-ironic
templateRef:
name: synchronize-server-to-ironic
template: synchronize-server
- - name: synchronize-server-obm-creds
name: sync-server-to-ironic
template: sync-server
- - name: sync-server-obm-creds
templateRef:
name: synchronize-obm-creds
name: sync-obm-creds
template: main
- - name: synchronize-interfaces-to-ironic
- - name: sync-interfaces-to-ironic
templateRef:
name: synchronize-interfaces-to-ironic
name: sync-interfaces-to-ironic
template: main
arguments:
parameters:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: argoproj.io/v1alpha1
metadata:
name: synchronize-obm-creds
name: sync-obm-creds
annotations:
workflows.argoproj.io/description: |
Defined in `argo-workflows/sync-nb-server-to-ironic/synchronize-obm-creds.yaml`
Defined in `argo-workflows/sync-nb-server-to-ironic/sync-obm-creds.yaml`
kind: WorkflowTemplate
spec:
entrypoint: main
Expand All @@ -22,21 +22,21 @@ spec:
parameters:
- name: hostname
value: '{{workflow.parameters.hostname}}'
- - name: synchronize-obm-creds
template: synchronize-obm-creds
- - name: sync-obm-creds
template: sync-obm-creds
arguments:
parameters:
- name: obm
value: "{{ steps.load-obm-creds.outputs.parameters.secret }}"

- name: synchronize-obm-creds
- name: sync-obm-creds
inputs:
parameters:
- name: obm
container:
image: ghcr.io/rackerlabs/understack/ironic-nautobot-client:latest
command:
- synchronize-obm-creds
- sync-obm-creds
args:
- "{{workflow.parameters.interface_update_event}}"
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apiVersion: argoproj.io/v1alpha1
metadata:
name: synchronize-server-to-ironic
name: sync-server-to-ironic
annotations:
workflows.argoproj.io/description: |
Defined in `argo-workflows/sync-nb-server-to-ironic/synchronize-server-to-ironic.yaml`
Defined in `argo-workflows/sync-nb-server-to-ironic/sync-server-to-ironic.yaml`
kind: WorkflowTemplate
spec:
arguments:
parameters:
- name: interface_update_event
value: "{}"
templates:
- name: synchronize-server
- name: sync-server
container:
image: ghcr.io/rackerlabs/understack/ironic-nautobot-client:latest
command:
- synchronize-server
- sync-server
args:
- "{{workflow.parameters.interface_update_event}}"
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion argo-workflows/sync-srv-redfish-intfs-to-nb/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The workflow templates in this folder are designed to create device interfaces i

The process begins when a sensor detects updates to Nautobot OBM interfaces, prompting the get-obm-creds action to fetch the necessary OBM credentials. This step is crucial as it serves as a prerequisite for the other workflows in this folder. You can find examples of such dependencies in the `deps` folder.

Following this, the sensor initiates the `synchronize-interfaces-to-nautobot` workflow. This workflow obtains Redfish information from a server and uses it to create new device interfaces in Nautobot.
Following this, the sensor initiates the `sync-interfaces-to-nautobot` workflow. This workflow obtains Redfish information from a server and uses it to create new device interfaces in Nautobot.

It is also worth noting that embedded/integrated interfaces are omitted for the purposes of the Undercloud project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
- name: oob_secret
value: "{}"
templates:
- name: synchronize-interfaces
- name: sync-interfaces
container:
image: ghcr.io/rackerlabs/understack/ironic-nautobot-client:latest
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ spec:
parameters:
- name: hostname
value: "{{workflow.parameters.hostname}}"
- - name: synchronize-interfaces-to-nautobot
- - name: sync-interfaces-to-nautobot
templateRef:
name: sync-interfaces-to-nautobot
template: synchronize-interfaces
template: sync-interfaces
arguments:
parameters:
- name: device_id
Expand Down
8 changes: 4 additions & 4 deletions python/understack-workflows/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"

[tool.poetry.scripts]
synchronize-interfaces = "understack_workflows.main.synchronize_interfaces:main"
synchronize-obm-creds = "understack_workflows.main.synchronize_obm_creds:main"
synchronize-server = "understack_workflows.main.synchronize_server:main"
synchronize-provision-state = "understack_workflows.main.synchronize_provision_state:main"
sync-interfaces = "understack_workflows.main.sync_interfaces:main"
sync-obm-creds = "understack_workflows.main.sync_obm_creds:main"
sync-server = "understack_workflows.main.sync_server:main"
sync-provision-state = "understack_workflows.main.sync_provision_state:main"
sync-nautobot-interfaces = "understack_workflows.main.sync_nautobot_interfaces:main"
undersync-switch = "understack_workflows.main.undersync_switch:main"
undersync-device = "understack_workflows.main.undersync_device:main"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from understack_workflows.main.synchronize_provision_state import argument_parser
from understack_workflows.main.synchronize_provision_state import do_action
from understack_workflows.main.sync_provision_state import argument_parser
from understack_workflows.main.sync_provision_state import do_action


@pytest.fixture
Expand Down

0 comments on commit 6f33a3d

Please sign in to comment.