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
Describe the bug
Im using this task in azure devops to run a popeye against my AKS cluster.
- task: AzureCLI@2
displayName: 'Run Popeye Audit Script'
inputs:
azureSubscription: ${{ parameters.AZURE_SERVICE_CONNECTION_NAME }}
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
set -feuo pipefail
set -x
# Validate parameters
: "${RESOURCE_GROUP:?Need to set RESOURCE_GROUP environment variable}"
: "${CLUSTER_NAME:?Need to set CLUSTER_NAME environment variable}"
: "${POPEYE_VERSION:?Need to set POPEYE_VERSION environment variable}"
: "${KUBELOGIN_VERSION:?Need to set KUBELOGIN_VERSION environment variable}"
SUBSCRIPTION_ID=${SUBSCRIPTION_ID:-""}
# Getting KubeConfig
az aks get-credentials -n "${CLUSTER_NAME}" -g "${RESOURCE_GROUP}" --overwrite-existing
# Download Kubelogin
curl -LO "https://github.com/Azure/kubelogin/releases/download/${KUBELOGIN_VERSION}/kubelogin-linux-amd64.zip"
unzip kubelogin-linux-amd64.zip
sudo mv bin/linux_amd64/kubelogin /usr/bin/kubelogin
# Convert to non-interactive
kubelogin convert-kubeconfig -l azurecli
echo "Download POPEYE..."
curl -LO "https://github.com/derailed/popeye/releases/download/${POPEYE_VERSION}/popeye_Linux_amd64.tar.gz"
tar xzvpf "popeye_Linux_amd64.tar.gz" popeye
mv popeye /tmp/popeye
# Construct SPINACH path
SPINACH="$(System.DefaultWorkingDirectory)/terraform/playgrounds/babu/popeye/spinach.yml"
POPEYE=${POPEYE:-/tmp/popeye}
# Create output directory for Popeye HTML report
POPEYE_REPORT_DIR=$(System.DefaultWorkingDirectory)
# Run Popeye and save the output to a file
"$POPEYE" --save --out html --output-file report.html -A -f "$SPINACH"
env:
RESOURCE_GROUP: ${{ parameters.RESOURCE_GROUP }}
CLUSTER_NAME: ${{ parameters.CLUSTER_NAME }}
POPEYE_VERSION: ${{ parameters.POPEYE_VERSION }}
KUBELOGIN_VERSION: ${{ parameters.KUBELOGIN_VERSION }}
Popeye is running fine and I got error: ##[error]Script failed with exit code: 1
in the pipeline without saving output as html file. I used below command to run popeye with spinach configuration /tmp/popeye -A -f /home/vsts/work/1/s/terraform/playgrounds/babu/popeye/spinach.yml
If I try to save output file as HTML format and my pipeline is throwing error as below /tmp/popeye --save --out html --output-file report.html -A -f /home/vsts/work/1/s/terraform/playgrounds/babu/popeye/spinach.yml
Describe the bug
Im using this task in azure devops to run a popeye against my AKS cluster.
Popeye is running fine and I got error: ##[error]Script failed with exit code: 1
in the pipeline without saving output as html file. I used below command to run popeye with spinach configuration
/tmp/popeye -A -f /home/vsts/work/1/s/terraform/playgrounds/babu/popeye/spinach.yml
If I try to save output file as HTML format and my pipeline is throwing error as below
/tmp/popeye --save --out html --output-file report.html -A -f /home/vsts/work/1/s/terraform/playgrounds/babu/popeye/spinach.yml
`+ echo 'Download POPEYE...'
Download POPEYE...
curl -LO https://github.com/derailed/popeye/releases/download/v0.21.3/popeye_Linux_amd64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
19 17.2M 19 3501k 0 0 3673k 0 0:00:04 --:--:-- 0:00:04 3673k
100 17.2M 100 17.2M 0 0 13.7M 0 0:00:01 0:00:01 --:--:-- 45.9M
popeye
___ ___ _____ _____ D .-'-.
| _ _| _ \ \ \ / / | O | K
\ | _/ _ \ _/ _| \ V /| _| H
-,---._
|_| _/| || || || [] .->' X
|-' Biffs
em and Buffsem!
=/ (/_ /_,
_)
----; |Boom! 💥 open /tmp/popeye/BABUZ-AKSCluster00/BABUZ-AKSCluster00/report.html: not a directory
(see logs)
##[error]Script failed with exit code: 1`
Expected behavior
Popeye should run without any error and It should generate HTML file correctly,
Versions (please complete the following information):
Additional context
I'm using this spinach.yaml configuration: https://github.com/derailed/popeye/blob/master/spinach-examples/spinach_aks.yml for my test
The text was updated successfully, but these errors were encountered: