Skip to content

Commit cbec9a8

Browse files
committed
cstrans-df-run: escape also \t in JSON output
1 parent 8209588 commit cbec9a8

File tree

4 files changed

+180
-0
lines changed

4 files changed

+180
-0
lines changed

cstrans-df-run.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ std::string runQuoteArg(std::string arg)
130130
{
131131
boost::algorithm::replace_all(arg, "\\", "\\\\");
132132
boost::algorithm::replace_all(arg, "\"", "\\\"");
133+
boost::algorithm::replace_all(arg, "\t", "\\t");
133134
return arg;
134135
}
135136

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,4 @@ tests_cstrans_df_run(0003)
210210
tests_cstrans_df_run(0004)
211211
tests_cstrans_df_run(0005)
212212
tests_cstrans_df_run(0006)
213+
tests_cstrans_df_run(0007)

tests/cstrans-df-run/0007-stdin.txt

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#
2+
# This is the OpenShift ovn overlay network image.
3+
# it provides an overlay network using ovs/ovn/ovn-kube
4+
#
5+
# The standard name for this image is ovn-kube
6+
7+
# Notes:
8+
# This is for a build where the ovn-kubernetes utilities
9+
# are built in this Dockerfile and included in the image (instead of the rpm)
10+
#
11+
12+
FROM openshift/golang-builder:1.10 AS builder
13+
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b
14+
15+
WORKDIR /go-controller
16+
COPY go-controller/ .
17+
18+
# build the binaries
19+
RUN make
20+
21+
FROM openshift/ose-cli:v4.1.0-201905191700 AS cli
22+
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b
23+
24+
FROM openshift/ose-base:v4.1.0-201905191700
25+
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b
26+
27+
USER root
28+
29+
ENV PYTHONDONTWRITEBYTECODE yes
30+
31+
# install needed rpms - openvswitch must be 2.9.2 or higher
32+
# install selinux-policy first to avoid a race
33+
RUN yum install -y \
34+
selinux-policy && \
35+
yum clean all
36+
37+
RUN yum install -y \
38+
PyYAML bind-utils \
39+
openssl \
40+
numactl-libs \
41+
firewalld-filesystem \
42+
libpcap \
43+
hostname \
44+
"openvswitch2.11" \
45+
"openvswitch2.11-ovn-common" \
46+
"openvswitch2.11-ovn-central" \
47+
"openvswitch2.11-ovn-host" \
48+
"openvswitch2.11-ovn-vtep" \
49+
"openvswitch2.11-devel" \
50+
containernetworking-plugins \
51+
iproute strace socat && \
52+
yum clean all
53+
54+
RUN rm -rf /var/cache/yum
55+
56+
RUN mkdir -p /var/run/openvswitch && \
57+
mkdir -p /etc/cni/net.d && \
58+
mkdir -p /opt/cni/bin && \
59+
mkdir -p /usr/libexec/cni/
60+
61+
COPY --from=builder /go-controller/_output/go/bin/ovnkube /usr/bin/
62+
COPY --from=builder /go-controller/_output/go/bin/ovn-kube-util /usr/bin/
63+
COPY --from=builder /go-controller/_output/go/bin/ovn-k8s-cni-overlay /usr/libexec/cni/ovn-k8s-cni-overlay
64+
65+
COPY --from=cli /usr/bin/oc /usr/bin
66+
RUN ln -s /usr/bin/oc /usr/bin/kubectl
67+
68+
# copy git commit number into image
69+
COPY .git/HEAD /root/.git/HEAD
70+
COPY .git/refs/heads/ /root/.git/refs/heads/
71+
72+
# ovnkube.sh is the entry point. This script examines environment
73+
# variables to direct operation and configure ovn
74+
COPY dist/images/ovnkube.sh /root/
75+
COPY dist/images/ovn-debug.sh /root/
76+
# override the rpm's ovn_k8s.conf with this local copy
77+
COPY dist/images/ovn_k8s.conf /etc/openvswitch/ovn_k8s.conf
78+
79+
80+
81+
WORKDIR /root
82+
ENTRYPOINT /root/ovnkube.sh
83+
84+
LABEL \
85+
io.k8s.description="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
86+
com.redhat.component="ose-ovn-kubernetes-container" \
87+
maintainer="Phil Cameron <[email protected]>" \
88+
name="openshift/ose-ovn-kubernetes" \
89+
License="GPLv2+" \
90+
io.k8s.display-name="ovn kubernetes" \
91+
io.openshift.build.source-location="https://github.com/openshift/ovn-kubernetes" \
92+
summary="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
93+
io.openshift.build.commit.url="https://github.com/openshift/ovn-kubernetes/commit/674977b1fdf0f966970179b9fae338f8347b2dfe" \
94+
version="v4.1.0" \
95+
io.openshift.build.commit.id="674977b1fdf0f966970179b9fae338f8347b2dfe" \
96+
release="201905231545" \
97+
vendor="Red Hat" \
98+
io.openshift.tags="openshift"
99+

tests/cstrans-df-run/0007-stdout.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#
2+
# This is the OpenShift ovn overlay network image.
3+
# it provides an overlay network using ovs/ovn/ovn-kube
4+
#
5+
# The standard name for this image is ovn-kube
6+
7+
# Notes:
8+
# This is for a build where the ovn-kubernetes utilities
9+
# are built in this Dockerfile and included in the image (instead of the rpm)
10+
#
11+
12+
FROM openshift/golang-builder:1.10 AS builder
13+
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b
14+
15+
WORKDIR /go-controller
16+
COPY go-controller/ .
17+
18+
# build the binaries
19+
RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "make"]
20+
21+
FROM openshift/ose-cli:v4.1.0-201905191700 AS cli
22+
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b
23+
24+
FROM openshift/ose-base:v4.1.0-201905191700
25+
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b
26+
27+
USER root
28+
29+
ENV PYTHONDONTWRITEBYTECODE yes
30+
31+
# install needed rpms - openvswitch must be 2.9.2 or higher
32+
# install selinux-policy first to avoid a race
33+
RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "yum install -y \tselinux-policy && \tyum clean all"]
34+
35+
RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "yum install -y \tPyYAML bind-utils \topenssl \tnumactl-libs \tfirewalld-filesystem \tlibpcap \thostname \t\"openvswitch2.11\" \t\"openvswitch2.11-ovn-common\" \t\"openvswitch2.11-ovn-central\" \t\"openvswitch2.11-ovn-host\" \t\"openvswitch2.11-ovn-vtep\" \t\"openvswitch2.11-devel\" \tcontainernetworking-plugins \tiproute strace socat && \tyum clean all"]
36+
37+
RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "rm -rf /var/cache/yum"]
38+
39+
RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "mkdir -p /var/run/openvswitch && mkdir -p /etc/cni/net.d && mkdir -p /opt/cni/bin && mkdir -p /usr/libexec/cni/"]
40+
41+
COPY --from=builder /go-controller/_output/go/bin/ovnkube /usr/bin/
42+
COPY --from=builder /go-controller/_output/go/bin/ovn-kube-util /usr/bin/
43+
COPY --from=builder /go-controller/_output/go/bin/ovn-k8s-cni-overlay /usr/libexec/cni/ovn-k8s-cni-overlay
44+
45+
COPY --from=cli /usr/bin/oc /usr/bin
46+
RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "ln -s /usr/bin/oc /usr/bin/kubectl"]
47+
48+
# copy git commit number into image
49+
COPY .git/HEAD /root/.git/HEAD
50+
COPY .git/refs/heads/ /root/.git/refs/heads/
51+
52+
# ovnkube.sh is the entry point. This script examines environment
53+
# variables to direct operation and configure ovn
54+
COPY dist/images/ovnkube.sh /root/
55+
COPY dist/images/ovn-debug.sh /root/
56+
# override the rpm's ovn_k8s.conf with this local copy
57+
COPY dist/images/ovn_k8s.conf /etc/openvswitch/ovn_k8s.conf
58+
59+
60+
61+
WORKDIR /root
62+
ENTRYPOINT /root/ovnkube.sh
63+
64+
LABEL \
65+
io.k8s.description="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
66+
com.redhat.component="ose-ovn-kubernetes-container" \
67+
maintainer="Phil Cameron <[email protected]>" \
68+
name="openshift/ose-ovn-kubernetes" \
69+
License="GPLv2+" \
70+
io.k8s.display-name="ovn kubernetes" \
71+
io.openshift.build.source-location="https://github.com/openshift/ovn-kubernetes" \
72+
summary="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
73+
io.openshift.build.commit.url="https://github.com/openshift/ovn-kubernetes/commit/674977b1fdf0f966970179b9fae338f8347b2dfe" \
74+
version="v4.1.0" \
75+
io.openshift.build.commit.id="674977b1fdf0f966970179b9fae338f8347b2dfe" \
76+
release="201905231545" \
77+
vendor="Red Hat" \
78+
io.openshift.tags="openshift"
79+

0 commit comments

Comments
 (0)