Skip to content

Commit d5fa31f

Browse files
Move other binaries out of openshift
They will live in oc temporarily until they get their own binary.
1 parent 10d8fc9 commit d5fa31f

File tree

8 files changed

+23
-32
lines changed

8 files changed

+23
-32
lines changed

hack/lib/constants.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ readonly OS_GOVET_BLACKLIST=(
6565

6666
#If you update this list, be sure to get the images/origin/Dockerfile
6767
readonly OPENSHIFT_BINARY_SYMLINKS=(
68-
openshift-router
69-
openshift-recycle
7068
)
7169
readonly OC_BINARY_SYMLINKS=(
7270
openshift-deploy
@@ -75,6 +73,8 @@ readonly OC_BINARY_SYMLINKS=(
7573
openshift-git-clone
7674
openshift-manage-dockerfile
7775
openshift-extract-image-content
76+
openshift-router
77+
openshift-recycle
7878
)
7979
readonly OC_BINARY_COPY=(
8080
kubectl
@@ -386,13 +386,13 @@ function os::build::images() {
386386
( os::build::image "${tag_prefix}-control-plane" images/origin ) &
387387
( os::build::image "${tag_prefix}-deployer" images/deployer ) &
388388
( os::build::image "${tag_prefix}-docker-builder" images/builder/docker/docker-builder ) &
389+
( os::build::image "${tag_prefix}-haproxy-router" images/router/haproxy ) &
390+
( os::build::image "${tag_prefix}-recycler" images/recycler ) &
391+
( os::build::image "${tag_prefix}-f5-router" images/router/f5 ) &
389392

390393
for i in `jobs -p`; do wait $i; done
391394

392395
# images that depend on "${tag_prefix}-control-plane"
393-
( os::build::image "${tag_prefix}-haproxy-router" images/router/haproxy ) &
394-
( os::build::image "${tag_prefix}-recycler" images/recycler ) &
395-
( os::build::image "${tag_prefix}-f5-router" images/router/f5 ) &
396396
( os::build::image "${tag_prefix}-node" images/node ) &
397397

398398
for i in `jobs -p`; do wait $i; done

images/recycler/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# The standard name for this image is openshift/origin-recycler
55
#
6-
FROM openshift/origin-control-plane
6+
FROM openshift/origin-cli
77

88
LABEL io.k8s.display-name="OpenShift Origin Volume Recycler" \
99
io.k8s.description="This is a component of OpenShift Origin and is used to prepare persistent volumes for reuse after they are deleted." \

images/router/f5/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# The standard name for this image is openshift/origin-f5-router
55
#
6-
FROM openshift/origin-control-plane
6+
FROM openshift/origin-cli
77

88
LABEL io.k8s.display-name="OpenShift Origin F5 Router" \
99
io.k8s.description="This is a component of OpenShift Origin and programs a BigIP F5 router to expose services within the cluster." \

images/router/haproxy/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# The standard name for this image is openshift/origin-haproxy-router
55
#
6-
FROM openshift/origin-control-plane
6+
FROM openshift/origin-cli
77

88
RUN INSTALL_PKGS="haproxy18" && \
99
yum install -y $INSTALL_PKGS && \

images/router/nginx/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# The standard name for this image is openshift/origin-nginx-router
55
#
6-
FROM openshift/origin-control-plane
6+
FROM openshift/origin-cli
77

88
ENV NGINX_VERSION 1.13.12-1.el7_4.ngx
99

origin.spec

+6-11
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,12 @@ for cmd in \
298298
openshift-git-clone \
299299
openshift-manage-dockerfile \
300300
openshift-extract-image-content \
301-
kubectl
302-
do
303-
ln -s oc %{buildroot}%{_bindir}/$cmd
304-
done
305-
306-
for cmd in \
307301
openshift-f5-router \
308302
openshift-recycle \
309-
openshift-router
303+
openshift-router \
304+
kubectl
310305
do
311-
ln -s openshift %{buildroot}%{_bindir}/$cmd
306+
ln -s oc %{buildroot}%{_bindir}/$cmd
312307
done
313308

314309
install -d -m 0755 %{buildroot}%{_sysconfdir}/origin/{master,node}
@@ -368,9 +363,6 @@ chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
368363
%doc README.md
369364
%license LICENSE
370365
%{_bindir}/openshift
371-
%{_bindir}/openshift-f5-router
372-
%{_bindir}/openshift-recycle
373-
%{_bindir}/openshift-router
374366
%{_sharedstatedir}/origin
375367
%{_sysconfdir}/bash_completion.d/openshift
376368
%defattr(-,root,root,0700)
@@ -424,6 +416,9 @@ chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
424416
%{_bindir}/openshift-git-clone
425417
%{_bindir}/openshift-extract-image-content
426418
%{_bindir}/openshift-manage-dockerfile
419+
%{_bindir}/openshift-f5-router
420+
%{_bindir}/openshift-recycle
421+
%{_bindir}/openshift-router
427422
%{_sysconfdir}/bash_completion.d/oc
428423
%{_mandir}/man1/oc*
429424

pkg/cmd/openshift/openshift.go

-12
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import (
1616
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
1717

1818
"github.com/openshift/origin/pkg/cmd/flagtypes"
19-
irouter "github.com/openshift/origin/pkg/cmd/infra/router"
20-
"github.com/openshift/origin/pkg/cmd/recycle"
2119
"github.com/openshift/origin/pkg/cmd/server/start"
2220
"github.com/openshift/origin/pkg/cmd/templates"
2321
cmdutil "github.com/openshift/origin/pkg/cmd/util"
@@ -40,23 +38,13 @@ var (
4038
func CommandFor(basename string, stopCh <-chan struct{}) *cobra.Command {
4139
var cmd *cobra.Command
4240

43-
out := os.Stdout
44-
4541
// Make case-insensitive and strip executable suffix if present
4642
if runtime.GOOS == "windows" {
4743
basename = strings.ToLower(basename)
4844
basename = strings.TrimSuffix(basename, ".exe")
4945
}
5046

5147
switch basename {
52-
case "openshift-router":
53-
cmd = irouter.NewCommandTemplateRouter(basename)
54-
case "openshift-f5-router":
55-
cmd = irouter.NewCommandF5Router(basename)
56-
case "openshift-recycle":
57-
cmd = recycle.NewCommandRecycle(basename, out)
58-
case "origin":
59-
cmd = NewCommandOpenShift(basename, stopCh)
6048
default:
6149
cmd = NewCommandOpenShift("openshift", stopCh)
6250
}

pkg/oc/cli/cli.go

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"github.com/openshift/origin/pkg/cmd/flagtypes"
1919
"github.com/openshift/origin/pkg/cmd/infra/builder"
2020
"github.com/openshift/origin/pkg/cmd/infra/deployer"
21+
irouter "github.com/openshift/origin/pkg/cmd/infra/router"
22+
"github.com/openshift/origin/pkg/cmd/recycle"
2123
"github.com/openshift/origin/pkg/cmd/templates"
2224
"github.com/openshift/origin/pkg/cmd/util/term"
2325
"github.com/openshift/origin/pkg/oc/admin"
@@ -330,6 +332,12 @@ func CommandFor(basename string) *cobra.Command {
330332
cmd = builder.NewCommandManageDockerfile(basename)
331333
case "openshift-extract-image-content":
332334
cmd = builder.NewCommandExtractImageContent(basename)
335+
case "openshift-router":
336+
cmd = irouter.NewCommandTemplateRouter(basename)
337+
case "openshift-f5-router":
338+
cmd = irouter.NewCommandF5Router(basename)
339+
case "openshift-recycle":
340+
cmd = recycle.NewCommandRecycle(basename, out)
333341
default:
334342
// we only need this change for `oc`. `kubectl` should behave as close to `kubectl` as we can
335343
resource.OAPIToGroupified = legacygroupification.OAPIToGroupified

0 commit comments

Comments
 (0)