cdist/cdist/conf/type/__docker_config/explorer/config-data
Ľubomír Kučera 1efbd6a3a0 __docker_config: Fix config-data explorer
Before this fix, the explorer returned binary data when config did
not exist.

This commit also removes dependency on jq and sets executable flag
on the explorer file.
2018-05-04 16:42:47 +02:00

22 lines
833 B
Bash
Executable file

#!/bin/sh -e
#
# 2018 Ľubomír Kučera <lubomir.kucera.jr at gmail.com>
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
docker config inspect "${__object_id:?}" --format '{{json .Spec.Data}}' \
2>/dev/null | tr -d '"' | base64 -d