bridge: switch OSC from container to local install

Currently "openstack" command on bridge doesn't work, because we need
cinder client pinned to an older version for RAX support.  The
upstream container uses the latest versions of everything and it fails
to parse the "volume_api_version: 2" pin for RAX in the config file.

In general, the version of openstackclient we can probably most likely
rely on to work is the one from the launch-node virtualenv.  It also
means we just have one place to manage a broadly-compatible version,
instead of trying to manage versions in separate containers, etc.

This converts the /usr/local/bin/openstack command from calling into
the container, to calling into the launch venv.

Change-Id: I604d5c17268a8219d51d432ba21feeb2e752a693
This commit is contained in:
Ian Wienand 2022-11-25 10:15:13 +11:00 committed by Dr. Jens Harbott
parent f40c52b01a
commit 9e2d9f6aef
6 changed files with 16 additions and 31 deletions

View File

@ -9,3 +9,14 @@
name: 'file:///home/zuul/src/opendev.org/opendev/system-config/launch'
virtualenv: '/usr/launcher-venv'
# Admins use openstackclient on the bastion host to deal with cloud
# issues. The best version to use is the one from launch node, as
# whatever workarounds we need to talk to all clouds should be in that
# environment. For convenience link this version globally
- name: Link openstack client globally
file:
src: /usr/launcher-venv/bin/openstack
dest: /usr/local/bin/openstack
owner: root
group: root
state: link

View File

@ -1 +0,0 @@
An ansible role to install openstackclient container and helper script

View File

@ -1,20 +0,0 @@
#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
exec docker run -it --rm \
-v/etc/openstack:/etc/openstack \
docker.io/osclient/python-openstackclient \
openstack $@

View File

@ -1,8 +0,0 @@
- name: Add helper script
become: yes
copy:
dest: /usr/local/bin/openstack
group: root
mode: 0755
owner: root
src: openstack

View File

@ -12,8 +12,6 @@
- name: Install openshift/kubectl
when: ansible_architecture != 'aarch64'
block:
- include_role:
name: install-osc-container
- include_role:
name: install-kubectl
- include_role:

View File

@ -112,3 +112,8 @@ def test_launch_node_venv(host):
launch = host.run('/usr/launcher-venv/bin/launch-node --help')
assert 'usage: launch-node' in launch.stdout
assert launch.rc == 0
def test_osc_binary(host):
osc = host.run('/usr/launcher-venv/bin/openstack --version')
assert 'openstack' in osc.stdout
assert osc.rc == 0