From b7be24e3abb6d85e7e1745486509fdf6be010f72 Mon Sep 17 00:00:00 2001 From: Dileep Ranganathan Date: Thu, 30 May 2019 21:56:00 -0700 Subject: Fix collectd-operator build issue Fix build issues. Version control some files which were .gitignored. Issue-ID: ONAPARC-461 Signed-off-by: Dileep Ranganathan Change-Id: Ia7d1b9ef0e518c1afea5ca91103309724111028c --- .../microservices/collectd-operator/build/bin/entrypoint | 12 ++++++++++++ .../microservices/collectd-operator/build/bin/user_setup | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 vnfs/DAaaS/microservices/collectd-operator/build/bin/entrypoint create mode 100755 vnfs/DAaaS/microservices/collectd-operator/build/bin/user_setup (limited to 'vnfs/DAaaS/microservices/collectd-operator/build') diff --git a/vnfs/DAaaS/microservices/collectd-operator/build/bin/entrypoint b/vnfs/DAaaS/microservices/collectd-operator/build/bin/entrypoint new file mode 100755 index 00000000..3c0546c5 --- /dev/null +++ b/vnfs/DAaaS/microservices/collectd-operator/build/bin/entrypoint @@ -0,0 +1,12 @@ +#!/bin/sh -e + +# This is documented here: +# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines + +if ! whoami &>/dev/null; then + if [ -w /etc/passwd ]; then + echo "${USER_NAME:-collectd-operator}:x:$(id -u):$(id -g):${USER_NAME:-collectd-operator} user:${HOME}:/sbin/nologin" >> /etc/passwd + fi +fi + +exec ${OPERATOR} $@ diff --git a/vnfs/DAaaS/microservices/collectd-operator/build/bin/user_setup b/vnfs/DAaaS/microservices/collectd-operator/build/bin/user_setup new file mode 100755 index 00000000..1e36064c --- /dev/null +++ b/vnfs/DAaaS/microservices/collectd-operator/build/bin/user_setup @@ -0,0 +1,13 @@ +#!/bin/sh +set -x + +# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be) +mkdir -p ${HOME} +chown ${USER_UID}:0 ${HOME} +chmod ug+rwx ${HOME} + +# runtime user will need to be able to self-insert in /etc/passwd +chmod g+rw /etc/passwd + +# no need for this script to remain in the image after running +rm $0 -- cgit 1.2.3-korg