Skip to content

Commit

Permalink
fix linter + latest test data
Browse files Browse the repository at this point in the history
  • Loading branch information
djsly committed Oct 18, 2024
1 parent 034f4ec commit 2938a6d
Show file tree
Hide file tree
Showing 332 changed files with 1,684 additions and 1,686 deletions.
20 changes: 4 additions & 16 deletions pkg/agent/testdata/AKSUbuntu1604+Containerd/CustomData

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/agent/testdata/AKSUbuntu1604+Containerd/line26.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ EVENT_JSON=$( jq -n \
--arg EventTid "0" \
'{Timestamp: $Timestamp, OperationId: $OperationId, Version: $Version, TaskName: $TaskName, EventLevel: $EventLevel, Message: $Message, EventPid: $EventPid, EventTid: $EventTid}'
)
mkdir -p ${EVENTS_LOGGING_DIR}
echo ${EVENT_JSON} > ${EVENTS_LOGGING_DIR}${EVENTS_FILE_NAME}.json

upload_logs() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/agent/testdata/AKSUbuntu1604+Containerd/line62.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ installDeps() {
}

updateAptWithMicrosoftPkg() {
retrycmd_if_failure_no_stats 120 5 25 curl https://packages.microsoft.com/config/ubuntu/${UBUNTU_RELEASE}/prod.list > /tmp/microsoft-prod.list || exit $ERR_MOBY_APT_LIST_TIMEOUT
retrycmd_if_failure_no_stats 120 5 25 curl -s https://packages.microsoft.com/config/ubuntu/${UBUNTU_RELEASE}/prod.list > /tmp/microsoft-prod.list || exit $ERR_MOBY_APT_LIST_TIMEOUT
retrycmd_if_failure 10 5 10 cp /tmp/microsoft-prod.list /etc/apt/sources.list.d/ || exit $ERR_MOBY_APT_LIST_TIMEOUT
if [[ ${UBUNTU_RELEASE} == "18.04" ]]; then {
echo "deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/ubuntu/18.04/multiarch/prod testing main" > /etc/apt/sources.list.d/microsoft-prod-testing.list
Expand All @@ -65,7 +65,7 @@ updateAptWithMicrosoftPkg() {
}
fi

retrycmd_if_failure_no_stats 120 5 25 curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg || exit $ERR_MS_GPG_KEY_DOWNLOAD_TIMEOUT
retrycmd_if_failure_no_stats 120 5 25 curl -s https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg || exit $ERR_MS_GPG_KEY_DOWNLOAD_TIMEOUT
retrycmd_if_failure 10 5 10 cp /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ || exit $ERR_MS_GPG_KEY_DOWNLOAD_TIMEOUT
apt_get_update || exit $ERR_APT_UPDATE_TIMEOUT
}
Expand Down
15 changes: 13 additions & 2 deletions pkg/agent/testdata/AKSUbuntu1604+Containerd/line9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ retrycmd_get_tarball() {
tar_retries=$1; wait_sleep=$2; tarball=$3; url=$4
echo "${tar_retries} retries"
for i in $(seq 1 $tar_retries); do
tar -tzf $tarball && break || \
if [ -f $tarball ]; then
tar -tzf $tarball
if [ $? -eq 0 ]; then
break
fi
fi
if [ $i -eq $tar_retries ]; then
return 1
else
Expand All @@ -205,7 +210,12 @@ retrycmd_get_tarball_from_registry_with_oras() {
tar_folder=$(dirname "$tarball")
echo "${tar_retries} retries"
for i in $(seq 1 $tar_retries); do
tar -tzf $tarball && break || \
if [ -f $tarball ]; then
tar -tzf $tarball
if [ $? -eq 0 ]; then
break
fi
fi
if [ $i -eq $tar_retries ]; then
return 1
else
Expand Down Expand Up @@ -419,6 +429,7 @@ logs_to_events() {
--arg EventTid "0" \
'{Timestamp: $Timestamp, OperationId: $OperationId, Version: $Version, TaskName: $TaskName, EventLevel: $EventLevel, Message: $Message, EventPid: $EventPid, EventTid: $EventTid}'
)
mkdir -p ${EVENTS_LOGGING_DIR}
echo ${json_string} > ${EVENTS_LOGGING_DIR}${eventsFileName}.json

if [ "$ret" != "0" ]; then
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ EVENT_JSON=$( jq -n \
--arg EventTid "0" \
'{Timestamp: $Timestamp, OperationId: $OperationId, Version: $Version, TaskName: $TaskName, EventLevel: $EventLevel, Message: $Message, EventPid: $EventPid, EventTid: $EventTid}'
)
mkdir -p ${EVENTS_LOGGING_DIR}
echo ${EVENT_JSON} > ${EVENTS_LOGGING_DIR}${EVENTS_FILE_NAME}.json

upload_logs() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ installDeps() {
}

updateAptWithMicrosoftPkg() {
retrycmd_if_failure_no_stats 120 5 25 curl https://packages.microsoft.com/config/ubuntu/${UBUNTU_RELEASE}/prod.list > /tmp/microsoft-prod.list || exit $ERR_MOBY_APT_LIST_TIMEOUT
retrycmd_if_failure_no_stats 120 5 25 curl -s https://packages.microsoft.com/config/ubuntu/${UBUNTU_RELEASE}/prod.list > /tmp/microsoft-prod.list || exit $ERR_MOBY_APT_LIST_TIMEOUT
retrycmd_if_failure 10 5 10 cp /tmp/microsoft-prod.list /etc/apt/sources.list.d/ || exit $ERR_MOBY_APT_LIST_TIMEOUT
if [[ ${UBUNTU_RELEASE} == "18.04" ]]; then {
echo "deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/ubuntu/18.04/multiarch/prod testing main" > /etc/apt/sources.list.d/microsoft-prod-testing.list
Expand All @@ -65,7 +65,7 @@ updateAptWithMicrosoftPkg() {
}
fi

retrycmd_if_failure_no_stats 120 5 25 curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg || exit $ERR_MS_GPG_KEY_DOWNLOAD_TIMEOUT
retrycmd_if_failure_no_stats 120 5 25 curl -s https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg || exit $ERR_MS_GPG_KEY_DOWNLOAD_TIMEOUT
retrycmd_if_failure 10 5 10 cp /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ || exit $ERR_MS_GPG_KEY_DOWNLOAD_TIMEOUT
apt_get_update || exit $ERR_APT_UPDATE_TIMEOUT
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ retrycmd_get_tarball() {
tar_retries=$1; wait_sleep=$2; tarball=$3; url=$4
echo "${tar_retries} retries"
for i in $(seq 1 $tar_retries); do
tar -tzf $tarball && break || \
if [ -f $tarball ]; then
tar -tzf $tarball
if [ $? -eq 0 ]; then
break
fi
fi
if [ $i -eq $tar_retries ]; then
return 1
else
Expand All @@ -205,7 +210,12 @@ retrycmd_get_tarball_from_registry_with_oras() {
tar_folder=$(dirname "$tarball")
echo "${tar_retries} retries"
for i in $(seq 1 $tar_retries); do
tar -tzf $tarball && break || \
if [ -f $tarball ]; then
tar -tzf $tarball
if [ $? -eq 0 ]; then
break
fi
fi
if [ $i -eq $tar_retries ]; then
return 1
else
Expand Down Expand Up @@ -419,6 +429,7 @@ logs_to_events() {
--arg EventTid "0" \
'{Timestamp: $Timestamp, OperationId: $OperationId, Version: $Version, TaskName: $TaskName, EventLevel: $EventLevel, Message: $Message, EventPid: $EventPid, EventTid: $EventTid}'
)
mkdir -p ${EVENTS_LOGGING_DIR}
echo ${json_string} > ${EVENTS_LOGGING_DIR}${eventsFileName}.json

if [ "$ret" != "0" ]; then
Expand Down
Loading

0 comments on commit 2938a6d

Please sign in to comment.