Skip to content

Commit 1d3f674

Browse files
feat(info): display workflow image vetting settings (reanahub#182)
Closes reanahub/reana-server#728
1 parent 921b93b commit 1d3f674

4 files changed

Lines changed: 225 additions & 0 deletions

File tree

client/operations/info_responses.go

Lines changed: 200 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/info.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ func (o *infoOptions) run(cmd *cobra.Command) error {
202202
if p.SupportedWorkflowEngines != nil {
203203
displayInfoSliceItem(cmd, p.SupportedWorkflowEngines.Title, p.SupportedWorkflowEngines.Value)
204204
}
205+
if p.VettedContainerImagesAllowlist != nil {
206+
displayInfoSliceItem(cmd, p.VettedContainerImagesAllowlist.Title, p.VettedContainerImagesAllowlist.Value)
207+
}
208+
if p.VettedContainerImagesEnabled != nil {
209+
value := "False"
210+
if p.VettedContainerImagesEnabled.Value {
211+
value = "True"
212+
}
213+
cmd.Printf("%s: %s\n", p.VettedContainerImagesEnabled.Title, value)
214+
}
205215
if p.WorkspacesAvailable != nil {
206216
displayInfoSliceItem(cmd, p.WorkspacesAvailable.Title, p.WorkspacesAvailable.Value)
207217
}

cmd/info_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ func TestInfo(t *testing.T) {
5757
"Users can set custom interactive session images: False",
5858
"Recommended jupyter images for interactive sessions: docker.io/jupyter/scipy-notebook:notebook-6.4.5",
5959
"List of supported workflow engines: cwl, serial, snakemake, yadage",
60+
"List of container images allowed in user workflows: docker.io/library/python:2.7-slim, docker.io/reanahub/reana-env-root6:6.18.04",
61+
"Vetted container images required for user workflows: True",
6062
"CWL engine tool: cwltool",
6163
"CWL engine version: 3.1.20210628163208",
6264
"Yadage engine version: 0.20.1",
@@ -89,6 +91,8 @@ func TestInfo(t *testing.T) {
8991
"\"interactive_sessions_custom_image_allowed\": {", "\"value\": \"False\"",
9092
"\"interactive_session_recommended_jupyter_images\": {", "\"value\": [", "\"docker.io/jupyter/scipy-notebook:notebook-6.4.5\"",
9193
"\"supported_workflow_engines\": {", "\"value\": [", "\"cwl\",", "\"serial\",", "\"snakemake\",", "\"yadage\"",
94+
"\"vetted_container_images_allowlist\": {", "\"docker.io/library/python:2.7-slim\"",
95+
"\"vetted_container_images_enabled\": {", "\"value\": true",
9296
"\"cwl_engine_tool\": {", "\"value\": \"cwltool\"",
9397
"\"cwl_engine_version\": {", "\"value\": \"3.1.20210628163208\"",
9498
"\"yadage_engine_version\": {", "\"value\": \"0.20.1\"",

testdata/inputs/info_big.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,16 @@
106106
"dask_enabled": {
107107
"title": "Dask workflows allowed in the cluster",
108108
"value": "False"
109+
},
110+
"vetted_container_images_allowlist": {
111+
"title": "List of container images allowed in user workflows",
112+
"value": [
113+
"docker.io/library/python:2.7-slim",
114+
"docker.io/reanahub/reana-env-root6:6.18.04"
115+
]
116+
},
117+
"vetted_container_images_enabled": {
118+
"title": "Vetted container images required for user workflows",
119+
"value": true
109120
}
110121
}

0 commit comments

Comments
 (0)