You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Better error messages when using unsupported compose file syntax
Replace errors.New by errors.Errorf since the linter complained about it
Fix typo in internal/commands/push.go
Signed-off-by: Jean-Christophe Sirot <jean-christophe.sirot@docker.com>
Copy file name to clipboardExpand all lines: render/render_test.go
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,8 @@ services:
83
83
userParameters:=map[string]string{
84
84
"front.port": "4242",
85
85
}
86
-
checkRenderError(t, userParameters, composeFile, "Parameters must not have default values set in compose file. Invalid parameter: ${front.port:-9090}.")
86
+
checkRenderError(t, userParameters, composeFile, "The default value syntax of compose file is not supported in Docker App. "+
87
+
"The characters ':' and '-' are not allowed in parameter names. Invalid parameter: ${front.port:-9090}.")
87
88
88
89
composeFile=`
89
90
version: "3.6"
@@ -92,15 +93,17 @@ services:
92
93
ports:
93
94
- "${front.port-9090}:80"
94
95
`
95
-
checkRenderError(t, userParameters, composeFile, "Parameters must not have default values set in compose file. Invalid parameter: ${front.port-9090}.")
96
+
checkRenderError(t, userParameters, composeFile, "The default value syntax of compose file is not supported in Docker App. "+
97
+
"The characters ':' and '-' are not allowed in parameter names. Invalid parameter: ${front.port-9090}.")
96
98
composeFile=`
97
99
version: "3.6"
98
100
services:
99
101
front:
100
102
ports:
101
103
- "${front.port:?Error}:80"
102
104
`
103
-
checkRenderError(t, userParameters, composeFile, "Parameters must not have default values set in compose file. Invalid parameter: ${front.port:?Error}.")
105
+
checkRenderError(t, userParameters, composeFile, "The custom error message syntax of compose file is not supported in Docker App. "+
106
+
"The characters ':' and '?' are not allowed in parameter names. Invalid parameter: ${front.port:?Error}.")
104
107
105
108
composeFile=`
106
109
version: "3.6"
@@ -109,7 +112,8 @@ services:
109
112
ports:
110
113
- "${front.port?Error:unset variable}:80"
111
114
`
112
-
checkRenderError(t, userParameters, composeFile, "Parameters must not have default values set in compose file. Invalid parameter: ${front.port?Error:unset variable}.")
115
+
checkRenderError(t, userParameters, composeFile, "The custom error message syntax of compose file is not supported in Docker App. "+
116
+
"The characters ':' and '?' are not allowed in parameter names. Invalid parameter: ${front.port?Error:unset variable}.")
0 commit comments