Skip to content

Commit 5910195

Browse files
Move the COPY scriptes to below the RUN INSTALL_PKGS for sdn image
somewhere in the build path for the sdn image iptables gets installed as a dependancey. If the scripts are copied into the image after we are assured that the iptables wrappers get used as opposed to the iptables binary. Change $@ to "$@" so that the arguments get passed to the iptables scripts correctly Explicitly copy all the scripts as opposed to copying the whole directory with *
1 parent 53af542 commit 5910195

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

images/sdn/Dockerfile.rhel

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ COPY --from=builder /tmp/build/openshift-sdn /usr/bin/
1818
COPY --from=builder /tmp/build/sdn-cni-plugin /opt/cni/bin/openshift-sdn
1919
COPY --from=builder /tmp/build/loopback /opt/cni/bin/
2020
COPY --from=builder /tmp/build/host-local /opt/cni/bin/
21-
COPY images/sdn/scripts/* /usr/sbin/
2221

2322
RUN INSTALL_PKGS=" \
2423
openvswitch2.11 container-selinux socat ethtool nmap-ncat \
@@ -29,6 +28,15 @@ RUN INSTALL_PKGS=" \
2928
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
3029
mkdir -p /etc/sysconfig/cni/net.d && \
3130
yum clean all && rm -rf /var/cache/*
31+
32+
COPY ./images/sdn/scripts/iptables /usr/sbin/
33+
COPY ./images/sdn/scripts/iptables-save /usr/sbin/
34+
COPY ./images/sdn/scripts/iptables-restore /usr/sbin/
35+
COPY ./images/sdn/scripts/ip6tables /usr/sbin/
36+
COPY ./images/sdn/scripts/ip6tables-save /usr/sbin/
37+
COPY ./images/sdn/scripts/ip6tables-restore /usr/sbin/
38+
COPY ./images/sdn/scripts/iptables /usr/sbin/
39+
3240
LABEL io.k8s.display-name="OpenShift SDN" \
3341
io.k8s.description="This is a component of OpenShift and contains the networking tool stack for the default SDN implementation." \
3442
io.openshift.tags="openshift,sdn"

images/sdn/scripts/ip6tables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec chroot /host /usr/sbin/ip6tables $@
3+
exec chroot /host /usr/sbin/ip6tables "$@"

images/sdn/scripts/ip6tables-restore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec chroot /host /usr/sbin/ip6tables-restore $@
3+
exec chroot /host /usr/sbin/ip6tables-restore "$@"

images/sdn/scripts/ip6tables-save

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec chroot /host /usr/sbin/ip6tables-save $@
3+
exec chroot /host /usr/sbin/ip6tables-save "$@"

images/sdn/scripts/iptables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec chroot /host /usr/sbin/iptables $@
3+
exec chroot /host /usr/sbin/iptables "$@"

images/sdn/scripts/iptables-restore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec chroot /host /usr/sbin/iptables-restore $@
3+
exec chroot /host /usr/sbin/iptables-restore "$@"

images/sdn/scripts/iptables-save

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
exec chroot /host /usr/sbin/iptables-save $@
3+
exec chroot /host /usr/sbin/iptables-save "$@"

0 commit comments

Comments
 (0)