Skip to content

Commit 29484db

Browse files
Merge pull request #20011 from smarterclayton/deployer
Move deployer and build binaries into oc
2 parents 089af20 + d0c7303 commit 29484db

File tree

13 files changed

+65
-65
lines changed

13 files changed

+65
-65
lines changed

hack/import-restrictions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,11 @@
465465
"github.com/openshift/origin/pkg/bulk",
466466
"github.com/openshift/origin/pkg/client/config",
467467
"github.com/openshift/origin/pkg/cmd/flagtypes",
468+
"github.com/openshift/origin/pkg/cmd/infra/builder",
469+
"github.com/openshift/origin/pkg/cmd/infra/deployer",
470+
"github.com/openshift/origin/pkg/cmd/infra/router",
468471
"github.com/openshift/origin/pkg/cmd/openshift-operators/generated/clientset/versioned",
472+
"github.com/openshift/origin/pkg/cmd/recycle",
469473
"github.com/openshift/origin/pkg/cmd/server/admin",
470474
"github.com/openshift/origin/pkg/cmd/server/apis/config",
471475
"github.com/openshift/origin/pkg/cmd/server/apis/config/install",

hack/lib/build/binaries.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,16 @@ readonly -f os::build::release_sha
407407
function os::build::make_openshift_binary_symlinks() {
408408
platform=$(os::build::host_platform)
409409
if [[ -f "${OS_OUTPUT_BINPATH}/${platform}/openshift" ]]; then
410-
for linkname in "${OPENSHIFT_BINARY_SYMLINKS[@]}"; do
411-
ln -sf openshift "${OS_OUTPUT_BINPATH}/${platform}/${linkname}"
412-
done
410+
if [[ -n "${OPENSHIFT_BINARY_SYMLINKS-}" ]]; then
411+
for linkname in "${OPENSHIFT_BINARY_SYMLINKS[@]}"; do
412+
ln -sf openshift "${OS_OUTPUT_BINPATH}/${platform}/${linkname}"
413+
done
414+
fi
413415
fi
414416
if [[ -f "${OS_OUTPUT_BINPATH}/${platform}/oc" ]]; then
417+
for linkname in "${OC_BINARY_SYMLINKS[@]}"; do
418+
ln -sf oc "${OS_OUTPUT_BINPATH}/${platform}/${linkname}"
419+
done
415420
for linkname in "${OC_BINARY_COPY[@]}"; do
416421
ln -sf oc "${OS_OUTPUT_BINPATH}/${platform}/${linkname}"
417422
done

hack/lib/constants.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ 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
68+
)
69+
readonly OC_BINARY_SYMLINKS=(
6970
openshift-deploy
70-
openshift-recycle
7171
openshift-sti-build
7272
openshift-docker-build
7373
openshift-git-clone
7474
openshift-manage-dockerfile
7575
openshift-extract-image-content
76-
origin
76+
openshift-router
77+
openshift-recycle
7778
)
7879
readonly OC_BINARY_COPY=(
7980
kubectl
@@ -381,18 +382,18 @@ function os::build::images() {
381382
for i in `jobs -p`; do wait $i; done
382383

383384
# images that depend on "${tag_prefix}-cli"
384-
( os::build::image "${tag_prefix}-tests" images/tests ) &
385-
( os::build::image "${tag_prefix}-control-plane" images/origin ) &
385+
( os::build::image "${tag_prefix}-tests" images/tests ) &
386+
( os::build::image "${tag_prefix}-control-plane" images/origin ) &
387+
( os::build::image "${tag_prefix}-deployer" images/deployer ) &
388+
( 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 ) &
386392

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

389395
# images that depend on "${tag_prefix}-control-plane"
390-
( os::build::image "${tag_prefix}-haproxy-router" images/router/haproxy ) &
391-
( os::build::image "${tag_prefix}-deployer" images/deployer ) &
392-
( os::build::image "${tag_prefix}-recycler" images/recycler ) &
393-
( os::build::image "${tag_prefix}-docker-builder" images/builder/docker/docker-builder ) &
394-
( os::build::image "${tag_prefix}-f5-router" images/router/f5 ) &
395-
( os::build::image "${tag_prefix}-node" images/node ) &
396+
( os::build::image "${tag_prefix}-node" images/node ) &
396397

397398
for i in `jobs -p`; do wait $i; done
398399
}

images/builder/docker/docker-builder/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# The standard name for this image is openshift/origin-docker-builder
1212
#
13-
FROM openshift/origin-control-plane
13+
FROM openshift/origin-cli
1414

1515
RUN INSTALL_PKGS=" \
1616
which tar wget hostname sysvinit-tools util-linux \

images/deployer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# The standard name for this image is openshift/origin-deployer
1212
#
13-
FROM openshift/origin-control-plane
13+
FROM openshift/origin-cli
1414

1515
LABEL io.k8s.display-name="OpenShift Origin Deployer" \
1616
io.k8s.description="This is a component of OpenShift Origin and executes the user deployment process to roll out new containers. It may be used as a base image for building your own custom deployer image." \

images/recycler/Dockerfile

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,12 @@ for cmd in \
300300
openshift-extract-image-content \
301301
openshift-f5-router \
302302
openshift-recycle \
303-
openshift-router
303+
openshift-router \
304+
kubectl
304305
do
305-
ln -s openshift %{buildroot}%{_bindir}/$cmd
306+
ln -s oc %{buildroot}%{_bindir}/$cmd
306307
done
307308

308-
ln -s oc %{buildroot}%{_bindir}/kubectl
309-
310309
install -d -m 0755 %{buildroot}%{_sysconfdir}/origin/{master,node}
311310

312311
# different service for origin vs aos
@@ -364,15 +363,6 @@ chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
364363
%doc README.md
365364
%license LICENSE
366365
%{_bindir}/openshift
367-
%{_bindir}/openshift-deploy
368-
%{_bindir}/openshift-f5-router
369-
%{_bindir}/openshift-recycle
370-
%{_bindir}/openshift-router
371-
%{_bindir}/openshift-docker-build
372-
%{_bindir}/openshift-sti-build
373-
%{_bindir}/openshift-git-clone
374-
%{_bindir}/openshift-extract-image-content
375-
%{_bindir}/openshift-manage-dockerfile
376366
%{_sharedstatedir}/origin
377367
%{_sysconfdir}/bash_completion.d/openshift
378368
%defattr(-,root,root,0700)
@@ -420,6 +410,15 @@ chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
420410
%{_bindir}/oc
421411
%{_bindir}/kubectl
422412
%{_bindir}/oadm
413+
%{_bindir}/openshift-deploy
414+
%{_bindir}/openshift-docker-build
415+
%{_bindir}/openshift-sti-build
416+
%{_bindir}/openshift-git-clone
417+
%{_bindir}/openshift-extract-image-content
418+
%{_bindir}/openshift-manage-dockerfile
419+
%{_bindir}/openshift-f5-router
420+
%{_bindir}/openshift-recycle
421+
%{_bindir}/openshift-router
423422
%{_sysconfdir}/bash_completion.d/oc
424423
%{_mandir}/man1/oc*
425424

pkg/cmd/openshift/openshift.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import (
1616
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
1717

1818
"github.com/openshift/origin/pkg/cmd/flagtypes"
19-
"github.com/openshift/origin/pkg/cmd/infra/builder"
20-
"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"
2319
"github.com/openshift/origin/pkg/cmd/server/start"
2420
"github.com/openshift/origin/pkg/cmd/templates"
2521
cmdutil "github.com/openshift/origin/pkg/cmd/util"
@@ -42,35 +38,13 @@ var (
4238
func CommandFor(basename string, stopCh <-chan struct{}) *cobra.Command {
4339
var cmd *cobra.Command
4440

45-
out := os.Stdout
46-
4741
// Make case-insensitive and strip executable suffix if present
4842
if runtime.GOOS == "windows" {
4943
basename = strings.ToLower(basename)
5044
basename = strings.TrimSuffix(basename, ".exe")
5145
}
5246

5347
switch basename {
54-
case "openshift-router":
55-
cmd = irouter.NewCommandTemplateRouter(basename)
56-
case "openshift-f5-router":
57-
cmd = irouter.NewCommandF5Router(basename)
58-
case "openshift-deploy":
59-
cmd = deployer.NewCommandDeployer(basename)
60-
case "openshift-recycle":
61-
cmd = recycle.NewCommandRecycle(basename, out)
62-
case "openshift-sti-build":
63-
cmd = builder.NewCommandS2IBuilder(basename)
64-
case "openshift-docker-build":
65-
cmd = builder.NewCommandDockerBuilder(basename)
66-
case "openshift-git-clone":
67-
cmd = builder.NewCommandGitClone(basename)
68-
case "openshift-manage-dockerfile":
69-
cmd = builder.NewCommandManageDockerfile(basename)
70-
case "openshift-extract-image-content":
71-
cmd = builder.NewCommandExtractImageContent(basename)
72-
case "origin":
73-
cmd = NewCommandOpenShift(basename, stopCh)
7448
default:
7549
cmd = NewCommandOpenShift("openshift", stopCh)
7650
}

pkg/cmd/openshift/openshift_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import (
77
)
88

99
func TestCommandFor(t *testing.T) {
10-
cmd := CommandFor("openshift-router", wait.NeverStop)
11-
if cmd.Use != "openshift-router" {
12-
t.Errorf("expected command to start with prefix: %#v", cmd)
13-
}
14-
15-
cmd = CommandFor("unknown", wait.NeverStop)
10+
cmd := CommandFor("unknown", wait.NeverStop)
1611
if cmd.Use != "openshift" {
1712
t.Errorf("expected command to be openshift: %#v", cmd)
1813
}

pkg/oc/cli/cli.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import (
1616
"k8s.io/kubernetes/pkg/kubectl/resource"
1717

1818
"github.com/openshift/origin/pkg/cmd/flagtypes"
19+
"github.com/openshift/origin/pkg/cmd/infra/builder"
20+
"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"
1923
"github.com/openshift/origin/pkg/cmd/templates"
2024
"github.com/openshift/origin/pkg/cmd/util/term"
2125
"github.com/openshift/origin/pkg/oc/admin"
@@ -316,6 +320,24 @@ func CommandFor(basename string) *cobra.Command {
316320
switch basename {
317321
case "kubectl":
318322
cmd = kubecmd.NewKubectlCommand(kcmdutil.NewFactory(nil), in, out, errout)
323+
case "openshift-deploy":
324+
cmd = deployer.NewCommandDeployer(basename)
325+
case "openshift-sti-build":
326+
cmd = builder.NewCommandS2IBuilder(basename)
327+
case "openshift-docker-build":
328+
cmd = builder.NewCommandDockerBuilder(basename)
329+
case "openshift-git-clone":
330+
cmd = builder.NewCommandGitClone(basename)
331+
case "openshift-manage-dockerfile":
332+
cmd = builder.NewCommandManageDockerfile(basename)
333+
case "openshift-extract-image-content":
334+
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)
319341
default:
320342
// we only need this change for `oc`. `kubectl` should behave as close to `kubectl` as we can
321343
resource.OAPIToGroupified = legacygroupification.OAPIToGroupified

0 commit comments

Comments
 (0)