openshift / ocm-container Goto Github PK
View Code? Open in Web Editor NEWContainerized environment for accessing OpenShift v4 clusters, packing necessary tools/scripts
License: Apache License 2.0
Containerized environment for accessing OpenShift v4 clusters, packing necessary tools/scripts
License: Apache License 2.0
When logging into a cluster I'd like some additional environment variables to be available to me, based on what type of cluster it is, and some for both:
ALL:
production
, staging
, integration
global
(this one is for future-proofing, so we can leave this off until we need it)Classic:
uhc-$OCM_ENV-$CLUSTER_ID
hive-stage-01
, etcHypershift:
Hi, I'm noticing strange behaviour in ocm-container.
$ ocm-container
ERRO[0000] cannot find UID/GID for user <my openshift account>: No subgid ranges found for group "<my openshift account>" in /etc/subgid - check rootless mode in man pages.
WARN[0000] using rootless single mapping into the namespace. This might break some images. Check /etc/subuid and /etc/subgid for adding sub*ids
[~ {production} ]$
Exit and run again
$ ocm-container
[~ {production} ]$
I have tried adding to ocm-container/Dockerfile
RUN echo "<my openshift account>:100000:65536" >> /etc/subuid
RUN echo "<my openshift account>:100000:65536" >> /etc/subgid
I also added same to my host running the ocm-container.
Rebuilt, and verified /etc/subuid
and /etc/subgid
has above entries in the container and the house, however I'm still getting a warning upon running ocm-container for the first time
The following error is seen upon a new build and launching ocm-container:
$ ocm-container-stg 58521e41-d139-4833-9844-54d59c6cb9f8
Logging into cluster 58521e41-d139-4833-9844-54d59c6cb9f8
Cluster ID: 1ogh4mlct6jjdodisfvovs9fvccbteti
/root/.local/bin/sre-login: line 69: cluster-login: command not found
The cluster-login command is not present on the container:
[~ {staging} ]$ cluster-login
bash: cluster-login: command not found
[~ {staging} ]$ which cluster-login
/usr/bin/which: no cluster-login in (/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin)
[~ {staging} ]$ find / -name cluster-login
find: ‘/proc/tty/driver’: Permission denied
[~ {staging} ]$
A recent MR #57 appears to have removed bin/utils/cluster-login
, but the bin/utils/sre-login
command still relies on that python script: https://github.com/openshift/ocm-container/blob/master/utils/bin/sre-login#L69
I just saw https://github.com/openshift-kni/cnf-features-deploy/blob/master/cnf-tests/Dockerfile
where they pull the binary from an official docker image
Lines 68 to 77 in f1c5161
I just noticed as I was trying to fix sshuttle on my mac that there's a blog post at the bottom of the github page that shows how to run sshuttle as a service.
The main benefit I see here is the keepalive, which is just really annoying when I'm trying to do something, get distracted or get a cup of coffee, and come back and have to kill $(cat sshuttle.pid)
and set up the tunnel again to get into a new cluster.
https://perfecto25.medium.com/using-sshuttle-as-a-service-bec2684a65fe
it seems the command pd incident:assign -i ${PD_ALERT} -u $PD_SILENT_TEST_USER
fails :(
I'll investigate later
I was going through the readme for the new Golang version and I'm wondering if as an alternative to the --entrypoint
logic we could add an explicit subcommand: ocm-container exec
Idea for usage would be something like this (using the same command as the README:
ocm-container exec -C $CLUSTER_ID -- ls -lah
Ideally this would function the same as the --entrypoint
functionality as written today, but would (IMO) lead to more readable scripts if you are doing something that requires you to run this across multiple clusters and multiple ocm-container instances.
By default, exec would not create an interactive session, it would be a oneshot. For an interactive session we could consider using the -it
flags, but I'd personally argue that we should not use those flags and if you require an interactive session then the root command itself should be used.
I'm opening this as a discussion and hoping to hear thoughts and comments here :D
Thanks!
Lines 135 to 136 in f1c5161
I found that we can
rhash -c <( grep ^yq_linux_amd64\ checksums ) --printf "" -m "" --skip-ok -a
which returns:
--( Verifying ${TMP_FILENAME} )------------------------------------------------------
--------------------------------------------------------------------------------
Everything OK
RHash: skipping: (message)
so we can grep ^Everything OK$
@clcollins WDYT? (can wait for whenever you get to this)
I am thinking on solutions for the other cli's (so we don't need to --ignore-missing
Line 228 in d1f9497
Based on https://blog.vamc19.dev/posts/dockerfile-copy-chmod/
With the latest commits, I cannot create a container. As whenever I do ocm-container
it keeps saying host directory cannot be empty
.
As an SRE I'd like to be able to pass a flag such as --manager
or --service
to ocm-container to have the logic for logging directly into a service or managment cluster baked into the tooling.
Ideally, if I were to run ocm-container -C $CLUSTER_ID --manager
it would have the following environment available for me:
ocm-$OCM_ENVIRONMENT-$CLUSTER_ID-$CLUSTER_NAME
ocm-$OCM_ENVIRONMENT-$CLUSTER_ID
kubelet-$CLUSTER_ID
$HCP_NS
And if this were a classic ROSA cluster:
uhc-$OCM_ENVIRONMENT-$CLUSTER_ID
$HIVE_NS
Essentially - the environment variables would be configured in a way similar to if you ran ocm-container -C $CLUSTER_ID
, loaded into it and then ocm backplane login $CLUSTER_ID --manager
from within the same container, so all of your env variable context is loaded for $CLUSTER_ID but you are just logged into the Management/Service Cluster.
running shellcheck on all binary files returns:
In ./build.sh line 33:
CONTAINER_ARGS+=($@)
^-- SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
In ./build.sh line 50:
cd $(dirname $0)
^--------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
^-----------^ SC2046 (warning): Quote this to prevent word splitting.
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
cd $(dirname "$0") || exit
In ./build.sh line 57:
if [ ! -f ${OCM_CONTAINER_CONFIG} ]; then
^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ ! -f "${OCM_CONTAINER_CONFIG}" ]; then
In ./build.sh line 62:
source ${OCM_CONTAINER_CONFIG}
^---------------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.
^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
source "${OCM_CONTAINER_CONFIG}"
In ./build.sh line 72:
$CONTAINER_ARGS \
^-------------^ SC2128 (warning): Expanding an array without an index only gives the first element.
^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"$CONTAINER_ARGS" \
In ./build.sh line 73:
-t ocm-container:${BUILD_TAG} .
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
-t ocm-container:"${BUILD_TAG}" .
In ./init.sh line 3:
cd $(dirname $0)
^--------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
^-----------^ SC2046 (warning): Quote this to prevent word splitting.
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
cd $(dirname "$0") || exit
In ./init.sh line 8:
echo 'aliases_file=$(alias) '"$0 $@"
^----------------------^ SC2016 (info): Expressions don't expand in single quotes, use double quotes for that.
^-- SC2145 (error): Argument mixes string and array. Use * or separate argument.
In ./init.sh line 13:
if [ ! -f ${CONFIG_DIR}/env.source ]
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ ! -f "${CONFIG_DIR}"/env.source ]
In ./init.sh line 16:
cp env.source.sample ${CONFIG_DIR}/env.source
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
cp env.source.sample "${CONFIG_DIR}"/env.source
In ./init.sh line 22:
mkdir -p ${CONFIG_DIR}
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
mkdir -p "${CONFIG_DIR}"
In ./init.sh line 31:
read -n 1 -p "Select 1-4: " prev_config_selection
^--^ SC2162 (info): read without -r will mangle backslashes.
In ./init.sh line 34:
if [ $prev_config_selection == "1" ]
^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ "$prev_config_selection" == "1" ]
In ./init.sh line 37:
mv env.source ${CONFIG_DIR}
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
mv env.source "${CONFIG_DIR}"
In ./init.sh line 38:
elif [ $prev_config_selection == "2" ]
^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
elif [ "$prev_config_selection" == "2" ]
In ./init.sh line 41:
ln -s env.source $CONFIG_DIR/env.source
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
ln -s env.source "$CONFIG_DIR"/env.source
In ./init.sh line 42:
elif [ $prev_config_selection == "3" ]
^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
elif [ "$prev_config_selection" == "3" ]
In ./init.sh line 88:
awk -f <( echo $AWK ) "${CONFIG_DIR}/env.source"
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
awk -f <( echo "$AWK" ) "${CONFIG_DIR}/env.source"
In ./ocm-container.sh line 44:
ARGS+=($1)
^-- SC2206 (warning): Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
In ./ocm-container.sh line 61:
if [ ! -f ${OCM_CONTAINER_CONFIGFILE} ]; then
^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ ! -f "${OCM_CONTAINER_CONFIGFILE}" ]; then
In ./ocm-container.sh line 68:
source ${OCM_CONTAINER_CONFIGFILE}
^-------------------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.
^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
source "${OCM_CONTAINER_CONFIGFILE}"
In ./ocm-container.sh line 71:
operating_system=`uname`
^-----^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
operating_system=$(uname)
In ./ocm-container.sh line 90:
if [ -f ${HOME}/${PAGERDUTY_TOKEN_FILE} ]
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ -f "${HOME}"/${PAGERDUTY_TOKEN_FILE} ]
In ./ocm-container.sh line 96:
if [ -d ${HOME}/.config/gcloud ]; then
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ -d "${HOME}"/.config/gcloud ]; then
In ./ocm-container.sh line 106:
if [ -n "$ARGS" ]
^---^ SC2128 (warning): Expanding an array without an index only gives the first element.
In ./ocm-container.sh line 118:
${CONTAINER_SUBSYS} run $TTY --rm --privileged \
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
${CONTAINER_SUBSYS} run "$TTY" --rm --privileged \
In ./ocm-container.sh line 123:
${INITIAL_CLUSTER_LOGIN} \
^----------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${INITIAL_CLUSTER_LOGIN}" \
In ./ocm-container.sh line 124:
-v ${CONFIG_DIR}:/root/.config/ocm-container:ro \
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
-v "${CONFIG_DIR}":/root/.config/ocm-container:ro \
In ./ocm-container.sh line 125:
-v ${HOME}/.ssh:/root/.ssh:ro \
^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
-v "${HOME}"/.ssh:/root/.ssh:ro \
In ./ocm-container.sh line 126:
${GOOGLECLOUDFILEMOUNT} \
^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${GOOGLECLOUDFILEMOUNT}" \
In ./ocm-container.sh line 127:
${PAGERDUTYFILEMOUNT} \
^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${PAGERDUTYFILEMOUNT}" \
In ./ocm-container.sh line 128:
${AWSFILEMOUNT} \
^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${AWSFILEMOUNT}" \
In ./ocm-container.sh line 129:
${SSH_AGENT_MOUNT} \
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${SSH_AGENT_MOUNT}" \
In ./ocm-container.sh line 131:
${OCM_CONTAINER_LAUNCH_OPTS} \
^--------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${OCM_CONTAINER_LAUNCH_OPTS}" \
In ./ocm-container.sh line 132:
ocm-container:${BUILD_TAG} ${EXEC_SCRIPT}
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
ocm-container:"${BUILD_TAG}" "${EXEC_SCRIPT}"
In ./utils/bin/chgm line 59:
if ! command -v $cmd > /dev/null
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if ! command -v "$cmd" > /dev/null
In ./utils/bin/chgm line 81:
ALERT_JSON="$(pd rest:get -e=/incidents/${PD_ALERT}/alerts 2>/dev/null)"
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
ALERT_JSON="$(pd rest:get -e=/incidents/"${PD_ALERT}"/alerts 2>/dev/null)"
In ./utils/bin/chgm line 82:
CLUSTER_UUID="$(jq -r '.alerts[].body.details.notes' <<< $ALERT_JSON |awk '/cluster_id/ {print $2}')"
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
CLUSTER_UUID="$(jq -r '.alerts[].body.details.notes' <<< "$ALERT_JSON" |awk '/cluster_id/ {print $2}')"
In ./utils/bin/chgm line 83:
CLUSTER_NAME="$(jq -r '.alerts[].body.details.name | split(".") | .[0] ' <<< $ALERT_JSON)"
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
CLUSTER_NAME="$(jq -r '.alerts[].body.details.name | split(".") | .[0] ' <<< "$ALERT_JSON")"
In ./utils/bin/chgm line 100:
trap "rm -fr $tmpd" EXIT
^---^ SC2064 (warning): Use single quotes, otherwise this expands now rather than when signalled.
In ./utils/bin/chgm line 102:
aws-get-creds.sh $CLUSTER_UUID > $tmpd/exports 2>/dev/null
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^---^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
aws-get-creds.sh "$CLUSTER_UUID" > "$tmpd"/exports 2>/dev/null
In ./utils/bin/chgm line 103:
source $tmpd/exports
^-----------^ SC1091 (info): Not following: ./exports was not specified as input (see shellcheck -x).
^---^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
source "$tmpd"/exports
In ./utils/bin/chgm line 105:
aws-validate-cluster.sh -r $AWS_DEFAULT_REGION -n $CLUSTER_NAME
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
aws-validate-cluster.sh -r "$AWS_DEFAULT_REGION" -n "$CLUSTER_NAME"
In ./utils/bin/chgm line 119:
pd incident:ack -i ${PD_ALERT}
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pd incident:ack -i "${PD_ALERT}"
In ./utils/bin/chgm line 120:
osdctl servicelog post ${CLUSTER_UUID} -y -t ${SL_URL}
^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
osdctl servicelog post "${CLUSTER_UUID}" -y -t ${SL_URL}
In ./utils/bin/chgm line 121:
pd incident:notes -i ${PD_ALERT} -n "$PD_CHGM_NOTE"
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pd incident:notes -i "${PD_ALERT}" -n "$PD_CHGM_NOTE"
In ./utils/bin/chgm line 122:
pd incident:assign -i ${PD_ALERT} -u $PD_SILENT_TEST_USER
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pd incident:assign -i "${PD_ALERT}" -u $PD_SILENT_TEST_USER
In ./utils/bin/chgm line 123:
pd incident:merge -i ${PD_ALERT} -I ${CHGM_PARENT_INCIDENT}
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pd incident:merge -i "${PD_ALERT}" -I ${CHGM_PARENT_INCIDENT}
In ./utils/bin/create-cluster line 1:
#!/usr/bin/env python3
^-- SC1071 (error): ShellCheck only supports sh/bash/dash/ksh scripts. Sorry!
In ./utils/bin/elevate.sh line 8:
oc adm groups add-users osd-sre-cluster-admins $(oc whoami)
^----------^ SC2046 (warning): Quote this to prevent word splitting.
In ./utils/bin/get-shards-clusterid line 1:
#!/usr/bin/env python3
^-- SC1071 (error): ShellCheck only supports sh/bash/dash/ksh scripts. Sorry!
In ./utils/bin/list-utils line 4:
UTIL_DIR=$(dirname $0)
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
UTIL_DIR=$(dirname "$0")
In ./utils/bin/list-utils line 7:
for i in $(ls ${UTIL_DIR}/${1} | sort) ; do
^-----------------^ SC2012 (info): Use find instead of ls to better handle non-alphanumeric filenames.
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
for i in $(ls "${UTIL_DIR}"/"${1}" | sort) ; do
In ./utils/bin/list-utils line 8:
DOC=$(awk -F: '/^# OCM_CONTAINER_DOC/ {print $2}' ${UTIL_DIR}/${i})
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
DOC=$(awk -F: '/^# OCM_CONTAINER_DOC/ {print $2}' "${UTIL_DIR}"/"${i}")
In ./utils/bin/ocm-login line 14:
if [ "x${OFFLINE_ACCESS_TOKEN}" == "x" ]; then
^------------------------^ SC2268 (style): Avoid x-prefix in comparisons as it no longer serves a purpose.
Did you mean:
if [ "${OFFLINE_ACCESS_TOKEN}" == "" ]; then
In ./utils/bin/ocm-login line 24:
"${CLI}" login --token=$OFFLINE_ACCESS_TOKEN ${LOGIN_ENV}=$OCM_URL
^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${CLI}" login --token="$OFFLINE_ACCESS_TOKEN" ${LOGIN_ENV}=$OCM_URL
In ./utils/bin/ocm-login line 28:
CLUSTER_DATA=$("${CLI}" describe cluster ${CLUSTERID} --json || exit )
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
CLUSTER_DATA=$("${CLI}" describe cluster "${CLUSTERID}" --json || exit )
In ./utils/bin/ocm-login line 29:
CLUSTER_API_TYPE=$( echo ${CLUSTER_DATA} | jq --raw-output .api.listening )
^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
CLUSTER_API_TYPE=$( echo "${CLUSTER_DATA}" | jq --raw-output .api.listening )
In ./utils/bin/ocm-login line 30:
CONSOLE_URL=$(echo ${CLUSTER_DATA} | jq --raw-output .console.url)
^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
CONSOLE_URL=$(echo "${CLUSTER_DATA}" | jq --raw-output .console.url)
In ./utils/bin/ocm-login line 51:
"${CLI}" cluster login ${CLUSTERID} --username ${OCM_USER} --token \
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${CLI}" cluster login "${CLUSTERID}" --username "${OCM_USER}" --token \
In ./utils/bin/ocm-login line 54:
"${CLI}" list cluster ${OCM_LIST_ADDITIONAL_ARG}
^------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${CLI}" list cluster "${OCM_LIST_ADDITIONAL_ARG}"
In ./utils/bin/pause-hive-sync line 9:
echo "Usage: $(basename ${0}) -c CLUSTER_NAME -s (on|off)"
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo "Usage: $(basename "${0}") -c CLUSTER_NAME -s (on|off)"
In ./utils/bin/pause-hive-sync line 37:
l ) LIST="true"
^--^ SC2034 (warning): LIST appears unused. Verify use (or export if used externally).
In ./utils/bin/pause-hive-sync line 49:
if test -z ${CLUSTER_DEPLOYMENT} ; then
^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if test -z "${CLUSTER_DEPLOYMENT}" ; then
In ./utils/bin/pause-hive-sync line 54:
if test -z ${PAUSE_STATE}; then
^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if test -z "${PAUSE_STATE}"; then
In ./utils/bin/pause-hive-sync line 68:
CLUSTER_DEPLOYMENT_NAMESPACE="$(oc get clusterdeployment --all-namespaces --selector api.openshift.com/name=${CLUSTER_DEPLOYMENT} --output template --template='{{range .items}}{{.metadata.namespace}}{{end}}')"
^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
CLUSTER_DEPLOYMENT_NAMESPACE="$(oc get clusterdeployment --all-namespaces --selector api.openshift.com/name="${CLUSTER_DEPLOYMENT}" --output template --template='{{range .items}}{{.metadata.namespace}}{{end}}')"
In ./utils/bin/pause-hive-sync line 76:
oc annotate clusterdeployment ${CLUSTER_DEPLOYMENT} -n ${CLUSTER_DEPLOYMENT_NAMESPACE} ${ANNOTATION}="true" || _fail_exit "Something failed attempting to annotate clusterdeployment: \"oc annotate clusterdeployment ${CLUSTER_DEPLOYMENT} -n ${CLUSTER_DEPLOYMENT_NAMESPACE} ${ANNOTATION}=\"true\"\""
^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
oc annotate clusterdeployment "${CLUSTER_DEPLOYMENT}" -n "${CLUSTER_DEPLOYMENT_NAMESPACE}" ${ANNOTATION}="true" || _fail_exit "Something failed attempting to annotate clusterdeployment: \"oc annotate clusterdeployment ${CLUSTER_DEPLOYMENT} -n ${CLUSTER_DEPLOYMENT_NAMESPACE} ${ANNOTATION}=\"true\"\""
In ./utils/bin/pause-hive-sync line 78:
oc annotate clusterdeployment ${CLUSTER_DEPLOYMENT} -n ${CLUSTER_DEPLOYMENT_NAMESPACE} ${ANNOTATION}- || _fail_exit "Something failed attempting to annotate clusterdeployment: \"oc annotate clusterdeployment ${CLUSTER_DEPLOYMENT} -n ${CLUSTER_DEPLOYMENT_NAMESPACE} ${ANNOTATION}-\""
^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
oc annotate clusterdeployment "${CLUSTER_DEPLOYMENT}" -n "${CLUSTER_DEPLOYMENT_NAMESPACE}" ${ANNOTATION}- || _fail_exit "Something failed attempting to annotate clusterdeployment: \"oc annotate clusterdeployment ${CLUSTER_DEPLOYMENT} -n ${CLUSTER_DEPLOYMENT_NAMESPACE} ${ANNOTATION}-\""
In ./utils/bin/sre-login line 4:
if [ -z $1 ]
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ -z "$1" ]
In ./utils/bin/sre-login line 19:
if [ $(jq -r ".total" <<< $ocmjson) -eq 1 ]
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ $(jq -r ".total" <<< "$ocmjson") -eq 1 ]
In ./utils/bin/sre-login line 21:
echo $(jq ".items[0]" <<< $ocmjson)
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^----------------------------^ SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo $(jq ".items[0]" <<< "$ocmjson")
In ./utils/bin/sre-login line 23:
elif [ $(jq -r ".total" <<< $ocmjson) -gt 1 ]
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
elif [ $(jq -r ".total" <<< "$ocmjson") -gt 1 ]
In ./utils/bin/sre-login line 28:
jq -r ".items[] | [.id, .name, .display_name] | @csv" <<< $ocmjson | tr -d "\"" | column -N "ID,NAME,DISPLAY_NAME" -t -s "," >&2
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
jq -r ".items[] | [.id, .name, .display_name] | @csv" <<< "$ocmjson" | tr -d "\"" | column -N "ID,NAME,DISPLAY_NAME" -t -s "," >&2
In ./utils/bin/sre-login line 34:
if [ $(jq -r ".total" <<< $ocmjson) -eq 1 ]
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ $(jq -r ".total" <<< "$ocmjson") -eq 1 ]
In ./utils/bin/sre-login line 36:
echo $(jq ".items[0]" <<< $ocmjson)
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^----------------------------^ SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo $(jq ".items[0]" <<< "$ocmjson")
In ./utils/bin/sre-login line 42:
if [ $(jq -r ".total" <<< $ocmjson) -eq 1 ]
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ $(jq -r ".total" <<< "$ocmjson") -eq 1 ]
In ./utils/bin/sre-login line 44:
echo $(jq ".items[0]" <<< $ocmjson)
^----------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^----------------------------^ SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo $(jq ".items[0]" <<< "$ocmjson")
In ./utils/bin/sre-login line 53:
clusterjson=$(get_cluster_json $1)
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
clusterjson=$(get_cluster_json "$1")
In ./utils/bin/sre-login line 60:
if [ $cluster_listening == "internal" ]
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [ "$cluster_listening" == "internal" ]
For more information:
https://www.shellcheck.net/wiki/SC1071 -- ShellCheck only supports sh/bash/...
https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ...
https://www.shellcheck.net/wiki/SC1090 -- ShellCheck can't follow non-const...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.