未验证 提交 83f79258 编写于 作者: S Shu Muto 提交者: GitHub

Fix development container (#4875)

* Ensure installing dependencies.
* Enable to pass K8S_DASHBOARD_NPM_CMD as env to run-npm-on-container.sh.
* Fix typo.
上级 f76f14c4
......@@ -29,9 +29,10 @@ GOSU="exec /usr/sbin/gosu user"
# Run command if K8S_DASHBOARD_CMD is set,
# otherwise run `npm ${K8S_DASHBOARD_NPM_CMD}`.
if [[ -n "${K8S_DASHBOARD_CMD}" ]] ; then
# Run npm command
# Run specified command
echo "Run '${K8S_DASHBOARD_CMD}'"
${GOSU} ${K8S_DASHBOARD_CMD}
else
# Run npm command
${GOSU} aio/develop/npm-command.sh
fi
......@@ -13,8 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Install dependencies
echo "Install dependencies"
npm ci
# Run npm command if K8S_DASHBOARD_NPM_CMD is set,
# otherwise install and start dashboard.
# otherwise start dashboard.
if [[ -n "${K8S_DASHBOARD_NPM_CMD}" ]] ; then
# Run npm command
echo "Run npm '${K8S_DASHBOARD_NPM_CMD}'"
......@@ -23,9 +27,6 @@ if [[ -n "${K8S_DASHBOARD_NPM_CMD}" ]] ; then
--kubernetes-dashboard:sidecar_host=${K8S_DASHBOARD_SIDECAR_HOST} \
--kubernetes-dashboard:port=${K8S_DASHBOARD_PORT}
else
# Install dashboard.
echo "Install dashboard"
npm ci
if [[ "${K8S_OWN_CLUSTER}" != true ]] ; then
# Stop cluster.
echo "Stop cluster"
......
......@@ -31,7 +31,7 @@ LOCAL_GID=$(id -g)
# command with K8S_DASHBOAD_NPM_CMD.
# But if K8S_DASHBOARD_CMD is set, the command in K8S_DASHBOARD_CMD will be
# executed instead of `npm ${K8S_DASHBOARD_NPM_CMD}`.
K8S_DASHBOARD_NPM_CMD=$*
K8S_DASHBOARD_NPM_CMD=${K8S_DASHBOARD_NPM_CMD:-*}
# kubeconfig for dashboard.
# This will be mounted and certain npm command can modify it,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册