Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions backend/graph-proxy/src/graphql/triggers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum TriggerError {
struct TriggerSpec {
/// The name of a ClusterTriggerTemplate that the Trigger is created from
#[serde(rename = "templateRef")]
template_ref: String,
template_ref: Option<String>,
}

/// A Trigger for creating automated workflows
Expand All @@ -56,7 +56,7 @@ struct TriggerGQL {
/// The name of the Trigger
name: Option<String>,
/// The name of a ClusterTriggerTemplate that the Trigger is created from
template_ref: String,
template_ref: Option<String>,
/// The beamline that the Trigger monitors
beamline: Option<String>,
}
Expand Down Expand Up @@ -211,7 +211,9 @@ impl TriggerMutation {
)])),
..Default::default()
},
spec: TriggerSpec { template_ref },
spec: TriggerSpec {
template_ref: Some(template_ref),
},
};

match api.create(&PostParams::default(), &trigger).await {
Expand Down
2 changes: 1 addition & 1 deletion charts/events/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: events
description: Data Analysis event triggering
type: application

version: 0.3.1
version: 0.3.2

dependencies:
- name: argo-events
Expand Down
1 change: 0 additions & 1 deletion charts/events/crds/trigger-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ spec:
- required: [name, path]
- required: [name, default]
required:
- templateRef
- workflow
- eventName
required:
Expand Down
6 changes: 6 additions & 0 deletions charts/events/templates/populate-trigger-clusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ spec:
urlPath: "/apis/workflows.diamond.ac.uk/v1alpha1/clustertriggertemplates/{{`{{templateRef}}`}}"
method: GET

preconditions:
all:
- key: "{{`{{ templateRef }}`}}"
operator: NotEquals
value: ""

mutate:
patchStrategicMerge:
metadata:
Expand Down
Loading