Skip to content

Commit

Permalink
Move other binaries out of openshift
Browse files Browse the repository at this point in the history
They will live in oc temporarily until they get their own binary.
  • Loading branch information
smarterclayton committed Jun 14, 2018
1 parent 10d8fc9 commit d5fa31f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 32 deletions.
10 changes: 5 additions & 5 deletions hack/lib/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ readonly OS_GOVET_BLACKLIST=(

#If you update this list, be sure to get the images/origin/Dockerfile
readonly OPENSHIFT_BINARY_SYMLINKS=(
openshift-router
openshift-recycle
)
readonly OC_BINARY_SYMLINKS=(
openshift-deploy
Expand All @@ -75,6 +73,8 @@ readonly OC_BINARY_SYMLINKS=(
openshift-git-clone
openshift-manage-dockerfile
openshift-extract-image-content
openshift-router
openshift-recycle
)
readonly OC_BINARY_COPY=(
kubectl
Expand Down Expand Up @@ -386,13 +386,13 @@ function os::build::images() {
( os::build::image "${tag_prefix}-control-plane" images/origin ) &
( os::build::image "${tag_prefix}-deployer" images/deployer ) &
( os::build::image "${tag_prefix}-docker-builder" images/builder/docker/docker-builder ) &
( os::build::image "${tag_prefix}-haproxy-router" images/router/haproxy ) &
( os::build::image "${tag_prefix}-recycler" images/recycler ) &
( os::build::image "${tag_prefix}-f5-router" images/router/f5 ) &

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

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

for i in `jobs -p`; do wait $i; done
Expand Down
2 changes: 1 addition & 1 deletion images/recycler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The standard name for this image is openshift/origin-recycler
#
FROM openshift/origin-control-plane
FROM openshift/origin-cli

LABEL io.k8s.display-name="OpenShift Origin Volume Recycler" \
io.k8s.description="This is a component of OpenShift Origin and is used to prepare persistent volumes for reuse after they are deleted." \
Expand Down
2 changes: 1 addition & 1 deletion images/router/f5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The standard name for this image is openshift/origin-f5-router
#
FROM openshift/origin-control-plane
FROM openshift/origin-cli

LABEL io.k8s.display-name="OpenShift Origin F5 Router" \
io.k8s.description="This is a component of OpenShift Origin and programs a BigIP F5 router to expose services within the cluster." \
Expand Down
2 changes: 1 addition & 1 deletion images/router/haproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The standard name for this image is openshift/origin-haproxy-router
#
FROM openshift/origin-control-plane
FROM openshift/origin-cli

RUN INSTALL_PKGS="haproxy18" && \
yum install -y $INSTALL_PKGS && \
Expand Down
2 changes: 1 addition & 1 deletion images/router/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The standard name for this image is openshift/origin-nginx-router
#
FROM openshift/origin-control-plane
FROM openshift/origin-cli

ENV NGINX_VERSION 1.13.12-1.el7_4.ngx

Expand Down
17 changes: 6 additions & 11 deletions origin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,12 @@ for cmd in \
openshift-git-clone \
openshift-manage-dockerfile \
openshift-extract-image-content \
kubectl
do
ln -s oc %{buildroot}%{_bindir}/$cmd
done

for cmd in \
openshift-f5-router \
openshift-recycle \
openshift-router
openshift-router \
kubectl
do
ln -s openshift %{buildroot}%{_bindir}/$cmd
ln -s oc %{buildroot}%{_bindir}/$cmd
done

install -d -m 0755 %{buildroot}%{_sysconfdir}/origin/{master,node}
Expand Down Expand Up @@ -368,9 +363,6 @@ chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
%doc README.md
%license LICENSE
%{_bindir}/openshift
%{_bindir}/openshift-f5-router
%{_bindir}/openshift-recycle
%{_bindir}/openshift-router
%{_sharedstatedir}/origin
%{_sysconfdir}/bash_completion.d/openshift
%defattr(-,root,root,0700)
Expand Down Expand Up @@ -424,6 +416,9 @@ chmod 0744 $RPM_BUILD_ROOT/usr/sbin/%{name}-docker-excluder
%{_bindir}/openshift-git-clone
%{_bindir}/openshift-extract-image-content
%{_bindir}/openshift-manage-dockerfile
%{_bindir}/openshift-f5-router
%{_bindir}/openshift-recycle
%{_bindir}/openshift-router
%{_sysconfdir}/bash_completion.d/oc
%{_mandir}/man1/oc*

Expand Down
12 changes: 0 additions & 12 deletions pkg/cmd/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"

"github.com/openshift/origin/pkg/cmd/flagtypes"
irouter "github.com/openshift/origin/pkg/cmd/infra/router"
"github.com/openshift/origin/pkg/cmd/recycle"
"github.com/openshift/origin/pkg/cmd/server/start"
"github.com/openshift/origin/pkg/cmd/templates"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
Expand All @@ -40,23 +38,13 @@ var (
func CommandFor(basename string, stopCh <-chan struct{}) *cobra.Command {
var cmd *cobra.Command

out := os.Stdout

// Make case-insensitive and strip executable suffix if present
if runtime.GOOS == "windows" {
basename = strings.ToLower(basename)
basename = strings.TrimSuffix(basename, ".exe")
}

switch basename {
case "openshift-router":
cmd = irouter.NewCommandTemplateRouter(basename)
case "openshift-f5-router":
cmd = irouter.NewCommandF5Router(basename)
case "openshift-recycle":
cmd = recycle.NewCommandRecycle(basename, out)
case "origin":
cmd = NewCommandOpenShift(basename, stopCh)
default:
cmd = NewCommandOpenShift("openshift", stopCh)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/oc/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/openshift/origin/pkg/cmd/flagtypes"
"github.com/openshift/origin/pkg/cmd/infra/builder"
"github.com/openshift/origin/pkg/cmd/infra/deployer"
irouter "github.com/openshift/origin/pkg/cmd/infra/router"
"github.com/openshift/origin/pkg/cmd/recycle"
"github.com/openshift/origin/pkg/cmd/templates"
"github.com/openshift/origin/pkg/cmd/util/term"
"github.com/openshift/origin/pkg/oc/admin"
Expand Down Expand Up @@ -330,6 +332,12 @@ func CommandFor(basename string) *cobra.Command {
cmd = builder.NewCommandManageDockerfile(basename)
case "openshift-extract-image-content":
cmd = builder.NewCommandExtractImageContent(basename)
case "openshift-router":
cmd = irouter.NewCommandTemplateRouter(basename)
case "openshift-f5-router":
cmd = irouter.NewCommandF5Router(basename)
case "openshift-recycle":
cmd = recycle.NewCommandRecycle(basename, out)
default:
// we only need this change for `oc`. `kubectl` should behave as close to `kubectl` as we can
resource.OAPIToGroupified = legacygroupification.OAPIToGroupified
Expand Down

0 comments on commit d5fa31f

Please sign in to comment.