1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00

Refactor sidecar script

This will refactor sidecar script to read it in
a better way to avoid unicode error
This commit is contained in:
Piyush Garg 2020-07-22 10:32:16 +05:30 committed by tekton-robot
parent 457f4ef2a2
commit e83bc62494

View File

@ -28,7 +28,7 @@ source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/e2e-tests.sh
function add_sidecar_registry() {
cp ${1} ${TMPF}.read
cat ${TMPF}.read | python3 -c 'import yaml,sys;data=yaml.load(sys.stdin.read(), Loader=yaml.FullLoader);data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
cat ${TMPF}.read | python3 -c 'import yaml;f=open(0, encoding="utf-8"); data=yaml.load(f.read(), Loader=yaml.FullLoader);data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
rm -f ${TMPF}.read
}