void archive_logs(Map remote) {
- sshCommand remote: remote, command: '''mkdir -p logs'''
+ sshCommand remote: remote, command: '''mkdir -p logs/dags'''
if (useCharmedInstaller) {
sshCommand remote: remote, command: '''
- for container in `kubectl get pods -n osm | grep -v operator | grep -v NAME| awk '{print $1}'`; do
- logfile=`echo $container | cut -d- -f1`
+ for pod in `kubectl get pods -n osm | grep -v operator | grep -v NAME| awk '{print $1}'`; do
+ logfile=`echo $pod | cut -d- -f1`
echo "Extracting log for $logfile"
- kubectl logs -n osm $container --timestamps=true 2>&1 > logs/$logfile.log
+ kubectl logs -n osm $pod --timestamps=true 2>&1 > logs/$logfile.log
done
'''
} else {
> logs/$statefulset.log
done
'''
+ sshCommand remote: remote, command: '''
+ schedulerPod="$(kubectl get pods -n osm | grep airflow-scheduler| awk '{print $1; exit}')"; \
+ echo "Extracting logs from Airflow DAGs from pod ${schedulerPod}"; \
+ kubectl cp -n osm ${schedulerPod}:/opt/airflow/logs/scheduler/latest/dags logs/dags -c scheduler
+ '''
}
sh 'rm -rf logs'