Skip to content

Commit

Permalink
Small revisions based on feedback
Browse files Browse the repository at this point in the history
- Removed unnecessary sleep timers
- Added 'OPENSHIFT_{var_name}_VERIFY' switch for tls verification
- Pinned openshift-acct-mgt to current version
  • Loading branch information
knikolla committed Jun 6, 2022
1 parent 793576f commit 45895c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 8 additions & 3 deletions ci/microshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
set -xe

export ACCT_MGT_VERSION="e955158dc9fbd2a7aa68a8818fb7018315141d2b"

sudo apt-get update && sudo apt-get upgrade -y

if [[ ! "${CI}" == "true" ]]; then
Expand All @@ -18,18 +20,21 @@ sudo docker run -d --rm --name microshift --privileged \

sudo docker run -d --name registry --network host registry:2

sleep 30

curl -O "https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz"
sudo tar -xf openshift-client-linux.tar.gz -C /usr/local/bin oc kubectl

mkdir ~/.kube
sudo docker cp microshift:/var/lib/microshift/resources/kubeadmin/kubeconfig ~/.kube/config
oc get all

while ! oc get all -h; do
echo "Waiting on Microshift"
sleep 5
done

# Install OpenShift Account Management
git clone https://github.com/cci-moc/openshift-acct-mgt.git ~/openshift-acct-mgt
cd ~/openshift-acct-mgt
git checkout "$ACCT_MGT_VERSION"
sudo docker build . -t "localhost:5000/cci-moc/openshift-acct-mgt:latest"
sudo docker push "localhost:5000/cci-moc/openshift-acct-mgt:latest"

Expand Down
6 changes: 5 additions & 1 deletion src/coldfront_plugin_openstack/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def session(self):
session = requests.session()
if username and password:
session.auth = HTTPBasicAuth(username, password)
if os.environ.get('FUNCTIONAL_TESTS', '') == 'True':

functional_tests = os.environ.get('FUNCTIONAL_TESTS', '').lower()
verify = os.getenv(f'OPENSHIFT_{var_name}_VERIFY', '').lower()
if functional_tests == 'true' or verify == 'false':
session.verify = False

return session

@staticmethod
Expand Down

0 comments on commit 45895c2

Please sign in to comment.