Skip to content

Commit 3018938

Browse files
committed
remove openshift cli and friends
1 parent 1f270ca commit 3018938

24 files changed

+38
-121
lines changed

contrib/vagrant/provision-util.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ os::provision::install-cmds() {
5757
local deployed_root=$1
5858

5959
local output_path="$(os::build::get-bin-output-path "${deployed_root}")"
60-
cp ${output_path}/{openshift,oc,osadm} /usr/bin
60+
cp ${output_path}/{openshift,oc} /usr/bin
6161
}
6262

6363
os::provision::add-to-hosts-file() {
@@ -102,7 +102,7 @@ os::provision::init-certs() {
102102
pushd "${config_root}" > /dev/null
103103

104104
# Master certs
105-
/usr/bin/openshift admin ca create-master-certs \
105+
/usr/bin/oc adm ca create-master-certs \
106106
--overwrite=false \
107107
--cert-dir="${cert_dir}" \
108108
--master="https://${master_ip}:8443" \
@@ -112,7 +112,7 @@ os::provision::init-certs() {
112112
for (( i=0; i < ${#node_names[@]}; i++ )); do
113113
local name=${node_names[$i]}
114114
local ip=${node_ips[$i]}
115-
/usr/bin/openshift admin create-node-config \
115+
/usr/bin/oc adm create-node-config \
116116
--node-dir="${server_config_dir}/node-${name}" \
117117
--node="${name}" \
118118
--hostnames="${name},${ip}" \
@@ -386,7 +386,7 @@ os::provision::disable-node() {
386386
os::provision::wait-for-condition "${msg}" "${condition}"
387387

388388
echo "Disabling scheduling for node ${node_name}"
389-
"$(OS_ROOT="${origin_root}" os::util::find::built_binary osadm)" --config="${config}" \
389+
"$(OS_ROOT="${origin_root}" os::util::find::built_binary oc)" adm --config="${config}" \
390390
manage-node "${node_name}" --schedulable=false > /dev/null
391391
}
392392

examples/data-population/limits.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LIMIT=$(dirname "${BASH_SOURCE}")/limit.yaml
1414

1515
for ((i=1; i <=$NUM_PROJECTS; i++))
1616
do
17-
openshift cli create -f $LIMIT --namespace=${PROJECT_NAME_PREFIX}${i}
17+
oc create -f $LIMIT --namespace=${PROJECT_NAME_PREFIX}${i}
1818
done
1919

2020
echo "Done"

examples/data-population/quotas.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ QUOTA=$(dirname "${BASH_SOURCE}")/quota.yaml
1414

1515
for ((i=1; i <=$NUM_PROJECTS; i++))
1616
do
17-
openshift cli create -f $QUOTA --namespace=${PROJECT_NAME_PREFIX}${i}
17+
oc create -f $QUOTA --namespace=${PROJECT_NAME_PREFIX}${i}
1818
done
1919

2020
echo "Done"

examples/data-population/services.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SERVICE=$(dirname "${BASH_SOURCE}")/service.yaml
1515

1616
for ((i=1; i <=$NUM_PROJECTS; i++))
1717
do
18-
openshift cli create -f $SERVICE --namespace=${PROJECT_NAME_PREFIX}${i}
18+
oc create -f $SERVICE --namespace=${PROJECT_NAME_PREFIX}${i}
1919
done
2020

2121
echo "Done"

examples/data-population/users.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for ((i=1; i <=$NUM_USERS; i++))
1111
do
1212
USERNAME=${USER_NAME_PREFIX}${i}
1313
USERCONFIG=/tmp/${USERNAME}.config
14-
openshift cli config view --minify --raw -o yaml > ${USERCONFIG}
14+
oc config view --minify --raw -o yaml > ${USERCONFIG}
1515
KUBECONFIG=${USERCONFIG} oc login --username=$USERNAME --password=whocares
1616
done
1717

hack/lib/build/binaries.sh

-6
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,6 @@ function os::build::place_bins() {
347347
if [[ $platform == "windows/amd64" ]]; then
348348
suffix=".exe"
349349
fi
350-
for linkname in "${OPENSHIFT_BINARY_COPY[@]}"; do
351-
local src="${release_binpath}/openshift${suffix}"
352-
if [[ -f "${src}" ]]; then
353-
ln "${release_binpath}/openshift${suffix}" "${release_binpath}/${linkname}${suffix}"
354-
fi
355-
done
356350
for linkname in "${OC_BINARY_COPY[@]}"; do
357351
local src="${release_binpath}/oc${suffix}"
358352
if [[ -f "${src}" ]]; then

hack/lib/constants.sh

-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ readonly OPENSHIFT_BINARY_SYMLINKS=(
7272
openshift-manage-dockerfile
7373
openshift-extract-image-content
7474
origin
75-
osc
76-
oadm
77-
osadm
78-
)
79-
readonly OPENSHIFT_BINARY_COPY=(
80-
oadm
8175
)
8276
readonly OC_BINARY_COPY=(
8377
kubectl

hack/lib/start.sh

+5-9
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ readonly -f os::start::configure_server
6161
function os::start::internal::create_master_certs() {
6262
local version="${1:-}"
6363
local openshift_volumes=( "${MASTER_CONFIG_DIR}" )
64-
local openshift_executable
65-
openshift_executable="$(os::start::internal::openshift_executable "${version}")"
6664

6765
os::log::debug "Creating certificates for the OpenShift server"
68-
${openshift_executable} admin ca create-master-certs \
66+
oc adm ca create-master-certs \
6967
--overwrite=false \
7068
--master="${MASTER_ADDR}" \
7169
--cert-dir="${MASTER_CONFIG_DIR}" \
@@ -89,11 +87,9 @@ readonly -f os::start::internal::create_master_certs
8987
function os::start::internal::configure_node() {
9088
local version="${1:-}"
9189
local openshift_volumes=( "${MASTER_CONFIG_DIR}" "${NODE_CONFIG_DIR}" )
92-
local openshift_executable
93-
openshift_executable="$(os::start::internal::openshift_executable "${version}")"
9490

9591
os::log::debug "Creating node configuration for the OpenShift server"
96-
${openshift_executable} admin create-node-config \
92+
oc adm create-node-config \
9793
--node-dir="${NODE_CONFIG_DIR}" \
9894
--node="${KUBELET_HOST}" \
9995
--hostnames="${KUBELET_HOST}" \
@@ -602,9 +598,9 @@ function os::start::router() {
602598
cat "${MASTER_CONFIG_DIR}/router.crt" \
603599
"${MASTER_CONFIG_DIR}/router.key" \
604600
"${MASTER_CONFIG_DIR}/ca.crt" > "${MASTER_CONFIG_DIR}/router.pem"
605-
openshift admin router --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --service-account=router --default-cert="${MASTER_CONFIG_DIR}/router.pem"
601+
oc adm router --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --service-account=router --default-cert="${MASTER_CONFIG_DIR}/router.pem"
606602
else
607-
openshift admin router --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --service-account=router
603+
oc adm router --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --service-account=router
608604
fi
609605

610606
# Set the SYN eater to make router reloads more robust
@@ -631,7 +627,7 @@ function os::start::registry() {
631627
os::log::debug "Installing the registry"
632628
# For testing purposes, ensure the quota objects are always up to date in the registry by
633629
# disabling project cache.
634-
openshift admin registry --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --enforce-quota -o json | \
630+
oc adm registry --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --enforce-quota -o json | \
635631
oc env --config="${ADMIN_KUBECONFIG}" -f - --output json "REGISTRY_MIDDLEWARE_REPOSITORY_OPENSHIFT_PROJECTCACHETTL=0" | \
636632
oc create --config="${ADMIN_KUBECONFIG}" -f -
637633
}

hack/lib/util/docs.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,13 @@ function os::util::gen-docs() {
102102
generate_documentation "${OUTPUT_DIR}"
103103
generate_manual_pages "${MAN_OUTPUT_DIR}" "oc"
104104
generate_manual_pages "${MAN_OUTPUT_DIR}" "openshift"
105-
generate_manual_pages "${MAN_OUTPUT_DIR}" "oadm"
106105
}
107106
readonly -f os::util::gen-docs
108107

109108
# os::util::set-man-placeholder puts a placeholder for every generated manpage.
110109
function os::util::set-man-placeholder() {
111110
MAN_OUTPUT_DIR="$1"
112-
declare -a generated_files=( "${1}/.files_generated_oadm=${1}/.files_generated_oadm"
113-
"${1}/.files_generated_oc=${1}/.files_generated_oc"
111+
declare -a generated_files=( "${1}/.files_generated_oc=${1}/.files_generated_oc"
114112
"${1}/.files_generated_openshift=${1}/.files_generated_openshift" )
115113

116114
# remove all of the old manpages; we don't want to check them in.

hack/update-generated-completions.sh

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ function os::build::gen-completions() {
1616
# generate the new files
1717
${OS_OUTPUT_BINPATH}/${platform}/oc completion ${shell} > $tmpdir/oc
1818
${OS_OUTPUT_BINPATH}/${platform}/openshift completion ${shell} > $tmpdir/openshift
19-
${OS_OUTPUT_BINPATH}/${platform}/oadm completion ${shell} > $tmpdir/oadm
2019
# create the list of generated files
2120
ls "${tmpdir}" | LC_ALL=C sort > "${tmpdir}/.files_generated"
2221

images/dind/master/openshift-disable-master-node.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function disable-node() {
2222
os::util::wait-for-condition "${msg}" "${condition}"
2323

2424
echo "Disabling scheduling for node ${node_name}"
25-
/usr/local/bin/osadm --config="${config}" manage-node "${node_name}" --schedulable=false > /dev/null
25+
/usr/local/bin/oc adm --config="${config}" manage-node "${node_name}" --schedulable=false > /dev/null
2626
}
2727

2828
disable-node /data/openshift.local.config/master/admin.kubeconfig "$(hostname)-node"

images/dind/master/openshift-generate-master-config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function ensure-master-config() {
2222
local name
2323
name="$(hostname)"
2424

25-
/usr/local/bin/openshift admin ca create-master-certs \
25+
/usr/local/bin/oc adm ca create-master-certs \
2626
--overwrite=false \
2727
--cert-dir="${master_path}" \
2828
--master="https://${ip_addr}:8443" \

images/dind/master/ovn-kubernetes-master-setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function ovn-kubernetes-master-setup() {
3636
# Create the service account for OVN stuff
3737
if ! /usr/local/bin/oc --config="${kube_config}" get serviceaccount ovn >/dev/null 2>&1; then
3838
/usr/local/bin/oc --config="${kube_config}" create serviceaccount ovn
39-
/usr/local/bin/oadm --config="${kube_config}" policy add-cluster-role-to-user cluster-admin -z ovn
39+
/usr/local/bin/oc adm --config="${kube_config}" policy add-cluster-role-to-user cluster-admin -z ovn
4040
# rhbz#1383707: need to add ovn SA to anyuid SCC to allow pod annotation updates
41-
/usr/local/bin/oadm --config="${kube_config}" policy add-scc-to-user anyuid -z ovn
41+
/usr/local/bin/oc adm --config="${kube_config}" policy add-scc-to-user anyuid -z ovn
4242
fi
4343

4444
/usr/local/bin/oc --config="${kube_config}" sa get-token ovn > ${config_dir}/ovn.token

images/dind/node/openshift-generate-node-config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ensure-node-config() {
4646
# concurrent execution since the file passed to --signer-serial
4747
# needs to be incremented by each invocation.
4848
(flock 200;
49-
/usr/local/bin/openshift admin create-node-config \
49+
/usr/local/bin/oc adm create-node-config \
5050
--node-dir="${node_config_path}" \
5151
--node="${host}" \
5252
--master="${master_host}" \

origin.spec

+1-5
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ install -d -m 0755 %{buildroot}%{_unitdir}
321321
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
322322

323323
for cmd in \
324-
oadm \
325324
openshift-deploy \
326325
openshift-docker-build \
327326
openshift-sti-build \
@@ -378,7 +377,7 @@ install -p -m 0644 contrib/systemd/openshift-sdn-ovs.conf %{buildroot}%{_unitdir
378377

379378
# Install bash completions
380379
install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d/
381-
for bin in oadm oc openshift
380+
for bin in oc openshift
382381
do
383382
echo "+++ INSTALLING BASH COMPLETIONS FOR ${bin} "
384383
%{buildroot}%{_bindir}/${bin} completion bash > %{buildroot}%{_sysconfdir}/bash_completion.d/${bin}
@@ -416,7 +415,6 @@ install -p -m 755 contrib/migration/* %{buildroot}%{_datadir}/%{name}/migration/
416415
%license LICENSE
417416
%{_bindir}/openshift
418417
%{_bindir}/hyperkube
419-
%{_bindir}/oadm
420418
%{_bindir}/openshift-deploy
421419
%{_bindir}/openshift-f5-router
422420
%{_bindir}/openshift-recycle
@@ -428,13 +426,11 @@ install -p -m 755 contrib/migration/* %{buildroot}%{_datadir}/%{name}/migration/
428426
%{_bindir}/openshift-manage-dockerfile
429427
%{_bindir}/origin
430428
%{_sharedstatedir}/origin
431-
%{_sysconfdir}/bash_completion.d/oadm
432429
%{_sysconfdir}/bash_completion.d/openshift
433430
%defattr(-,root,root,0700)
434431
%dir %config(noreplace) %{_sysconfdir}/origin
435432
%ghost %dir %config(noreplace) %{_sysconfdir}/origin
436433
%ghost %config(noreplace) %{_sysconfdir}/origin/.config_managed
437-
%{_mandir}/man1/oadm*
438434
%{_mandir}/man1/openshift*
439435

440436
%pre

pkg/cmd/openshift/openshift.go

+2-9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
diagnostics "github.com/openshift/origin/pkg/oc/admin/diagnostics"
2626
sync "github.com/openshift/origin/pkg/oc/admin/groups/sync/cli"
2727
"github.com/openshift/origin/pkg/oc/admin/validate"
28-
"github.com/openshift/origin/pkg/oc/cli"
2928
"github.com/openshift/origin/pkg/oc/cli/cmd"
3029
"github.com/openshift/origin/pkg/oc/experimental/buildchain"
3130
configcmd "github.com/openshift/origin/pkg/oc/experimental/config"
@@ -48,7 +47,7 @@ var (
4847
func CommandFor(basename string) *cobra.Command {
4948
var cmd *cobra.Command
5049

51-
in, out, errout := os.Stdin, os.Stdout, os.Stderr
50+
out := os.Stdout
5251

5352
// Make case-insensitive and strip executable suffix if present
5453
if runtime.GOOS == "windows" {
@@ -75,10 +74,6 @@ func CommandFor(basename string) *cobra.Command {
7574
cmd = builder.NewCommandManageDockerfile(basename)
7675
case "openshift-extract-image-content":
7776
cmd = builder.NewCommandExtractImageContent(basename)
78-
case "oc", "osc":
79-
cmd = cli.NewCommandCLI(basename, basename, in, out, errout)
80-
case "oadm", "osadm":
81-
cmd = admin.NewCommandAdmin(basename, basename, in, out, errout)
8277
case "origin":
8378
cmd = NewCommandOpenShift(basename)
8479
default:
@@ -95,7 +90,7 @@ func CommandFor(basename string) *cobra.Command {
9590

9691
// NewCommandOpenShift creates the standard OpenShift command
9792
func NewCommandOpenShift(name string) *cobra.Command {
98-
in, out, errout := os.Stdin, os.Stdout, os.Stderr
93+
out, errout := os.Stdout, os.Stderr
9994

10095
root := &cobra.Command{
10196
Use: name,
@@ -108,8 +103,6 @@ func NewCommandOpenShift(name string) *cobra.Command {
108103

109104
startAllInOne, _ := start.NewCommandStartAllInOne(name, out, errout)
110105
root.AddCommand(startAllInOne)
111-
root.AddCommand(admin.NewCommandAdmin("admin", name+" admin", in, out, errout))
112-
root.AddCommand(cli.NewCommandCLI("cli", name+" cli", in, out, errout))
113106
root.AddCommand(newExperimentalCommand("ex", name+" ex"))
114107
root.AddCommand(newCompletionCommand("completion", name+" completion"))
115108
root.AddCommand(cmd.NewCmdVersion(name, f, out, cmd.VersionOptions{PrintEtcdVersion: true, IsServer: true}))

test/cmd/admin.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ os::test::junit::declare_suite_end
4545

4646
os::test::junit::declare_suite_start "cmd/admin/manage-node"
4747
# Test admin manage-node operations
48-
os::cmd::expect_success_and_text 'openshift admin manage-node --help' 'Manage nodes'
48+
os::cmd::expect_success_and_text 'oc adm manage-node --help' 'Manage nodes'
4949

5050
# create a node object to mess with
5151
os::cmd::expect_success "echo 'apiVersion: v1

test/cmd/basicresources.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,20 @@ os::cmd::expect_success_and_not_text "curl -k '${API_SCHEME}://${API_HOST}:${API
4242

4343
# variants I know I have to worry about
4444
# 1. oc (kube and openshift resources)
45-
# 2. oadm and oc adm (kube and openshift resources)
46-
# 3 openshift cli (kube and openshift resources)
45+
# 2. oc adm (kube and openshift resources)
4746

4847
# example User-Agent: oc/v1.2.0 (linux/amd64) kubernetes/bc4550d
4948
os::cmd::expect_success_and_text 'oc get pods --loglevel=7 2>&1 | grep -A4 "pods" | grep User-Agent' "oc/${kube_git_regex} .* kubernetes/"
5049
# example User-Agent: oc/v1.2.0 (linux/amd64) kubernetes/bc4550d
5150
os::cmd::expect_success_and_text 'oc get dc --loglevel=7 2>&1 | grep -A4 "deploymentconfig" | grep User-Agent' "oc/${kube_git_regex} .* kubernetes/"
52-
# this is probably broken and should be `oadm/<oc version>... openshift/...`
53-
os::cmd::expect_success_and_text 'oadm policy reconcile-sccs --loglevel=7 2>&1 | grep -A4 "securitycontextconstraints" | grep User-Agent' "oadm/${kube_git_regex} .* kubernetes/"
5451
# example User-Agent: oc/v1.1.3 (linux/amd64) openshift/b348c2f
5552
os::cmd::expect_success_and_text 'oc adm policy who-can get pods --loglevel=7 2>&1 | grep -A4 "localresourceaccessreviews" | grep User-Agent' "oc/${kube_git_regex} .* kubernetes/"
56-
# example User-Agent: openshift/v1.2.0 (linux/amd64) kubernetes/bc4550d
57-
# this is probably broken and should be `oc/<oc version>... kubernetes/...`
58-
os::cmd::expect_success_and_text 'openshift cli get pods --loglevel=7 2>&1 | grep -A4 "pods" | grep User-Agent' "openshift/${kube_git_regex} .* kubernetes/"
59-
# example User-Agent: openshift/v1.2.0 (linux/amd64) kubernetes/bc4550d
60-
os::cmd::expect_success_and_text 'openshift cli get dc --loglevel=7 2>&1 | grep -A4 "deploymentconfig" | grep User-Agent' "openshift/${kube_git_regex} .* kubernetes/"
6153
echo "version reporting: ok"
6254
os::test::junit::declare_suite_end
6355

6456
os::test::junit::declare_suite_start "cmd/basicresources/status"
65-
os::cmd::expect_success_and_text 'openshift cli status -h' 'openshift cli describe buildConfig'
6657
os::cmd::expect_success_and_text 'oc status -h' 'oc describe buildConfig'
6758
os::cmd::expect_success_and_text 'oc status' 'oc new-app'
68-
os::cmd::expect_success_and_text 'openshift cli status' 'openshift cli new-app'
6959
echo "status help output: ok"
7060
os::test::junit::declare_suite_end
7161

test/cmd/completions.sh

-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ os::test::junit::declare_suite_start "cmd/completions"
88
# test completion command help
99
os::cmd::expect_success_and_text "oc completion -h" "prints shell code"
1010
os::cmd::expect_success_and_text "openshift completion -h" "prints shell code"
11-
os::cmd::expect_success_and_text "oadm completion -h" "prints shell code"
1211
# test completion command output
1312
os::cmd::expect_failure_and_text "oc completion" "Shell not specified."
1413
os::cmd::expect_success "oc completion bash"
@@ -19,11 +18,6 @@ os::cmd::expect_failure_and_text "openshift completion" "Shell not specified."
1918
os::cmd::expect_success "openshift completion bash"
2019
os::cmd::expect_success "openshift completion zsh"
2120
os::cmd::expect_failure_and_text "openshift completion test_shell" 'Unsupported shell type "test_shell"'
22-
# test completion command for oadm
23-
os::cmd::expect_failure_and_text "oadm completion" "Shell not specified."
24-
os::cmd::expect_success "oadm completion bash"
25-
os::cmd::expect_success "oadm completion zsh"
26-
os::cmd::expect_failure_and_text "oadm completion test_shell" 'Unsupported shell type "test_shell"'
2721
echo "oc completion: ok"
2822

2923
os::test::junit::declare_suite_end

0 commit comments

Comments
 (0)