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
Validate and print usage in case of wrong entrypoint usage (#49)
The entrypoint assumes a second ($2) argument is a json string but
immediatly after evaluating the first one if shifts, rendering the $2
empty.
Since there is no input validation it was impossible to
understand the problem without reading the code.
- validate that 3 args are passed in
- print a usage error with usefull info
- map the deprecated flag so it will be easy to remove in the future
Signed-off-by: Roy Golan <[email protected]>
Copy file name to clipboardExpand all lines: files/usr/bin/entrypoint.sh
+20-5
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,17 @@ if [[ $BUNDLE_DEBUG == "true" ]]; then
4
4
set -x
5
5
fi
6
6
7
+
usage() {
8
+
echo -n 'Usage: entrypoint.sh ACTION FLAG JSONSTRING
9
+
ACTION - one of [provision, deprovision, bind, unbind, test] verbs
10
+
FLAG - deprecated and will be dropped in the future
11
+
JSONSTRING - a valid json string to be used as extra args for the playbook execution
12
+
13
+
The command line args are positional.
14
+
Please see the this for reference - https://github.com/openshift/ansible-service-broker/blob/ansible-service-broker-1.4.1-1/docs/service-bundle.md#input
15
+
'
16
+
}
17
+
7
18
# Work-Around
8
19
# The OpenShift's s2i (source to image) requires that no ENTRYPOINT exist
9
20
# for any of the s2i builder base images. Our 's2i-apb' builder uses the
@@ -29,17 +40,21 @@ if ! whoami &> /dev/null; then
0 commit comments