projectatomic / atomicapp

[UNMAINTAINED] This is the reference implementation of the Nulecule container application Specification: Atomic App
102 stars 71 forks source link

Fixes connecting issues with OpenShift #761

Closed cdrage closed 8 years ago

cdrage commented 8 years ago

Due to https://github.com/openshift/origin/commit/b7b6c01bc7d7c7592cce263da07a727e3758bd4b which prevents the usage of the token via URL within OpenShift, the token MUST be passed via the headers 'Authorization' parameter on HTTP requests.

This commit adds the bearer token in order to fix an issue connecting to OpenShift Origin 1.3

cdrage commented 8 years ago

WIP [DO NOT MERGE] testing this against the CI

DONE

cdrage commented 8 years ago

dotests

dustymabe commented 8 years ago

code mostly LGTM.. a few questions though:

1 - Can you test with the oc new-app functionality (link) - I assume it still works fine, but just want to make sure 1 - Can you test to make sure it still works with old versions of openshift - i.e. the one in the CDK?

cdrage commented 8 years ago

@dustymabe

  1. oc new-app works (albit it takes a while for it to install.. is this normal?
  2. 1.1.0 works
cdrage commented 8 years ago

1.1.0 proof:

DEBUG  :: - providers/openshift.py :: url: https://localhost:8443/api/v1/namespaces/foo/services/etherpad-svc?access_token=WtmKC8yQHieeWDTRwl45nMDifD_nHkRiL-9RyNcebFU
INFO   :: - providers/openshift.py :: Successfully deleted.
Waiting for oc po/svc/rc to finish terminating...
NAME             READY     STATUS        RESTARTS   AGE
etherpad-55kml   1/1       Terminating   0          3s
mariadb          1/1       Terminating   0          3s
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
oc po/svc/rc terminated!
make clean
make[1]: Entering directory '/home/wikus/dropbox/dev/adb-tests/cdrage-atomicapp-ci/functional-tests'
rm -rf build answers.conf
make[1]: Leaving directory '/home/wikus/dropbox/dev/adb-tests/cdrage-atomicapp-ci/functional-tests'
./providers/openshift.sh stop
cdrage commented 8 years ago

oc new-app (just used 'lol' as the docker image name since wanted to try a random name for no conflicts)

adb-tests/cdrage-atomicapp-ci/functional-tests  master ✗                                                                                                                                                                                             21d ⚑ ◒  
▶ oc new-app lol --grant-install-rights
--> Installing application from "lol:latest"
    * Found Docker image c6869c5 (17 minutes old) from  for "lol:latest"
    * Install will run in pod lol-install
    * The pod has access to your current session token via environment variable TOKEN_ENV_VAR.
      If you cancel the install, you should delete the pod or log out of your session.
--> WARNING: The pod requires access to your current session token to install this image. Only
      grant access to images whose source you trust. The image will be able to perform any
      action you can take on the cluster.
--> Installing ...
cdrage commented 8 years ago

dotests

dustymabe commented 8 years ago

ok LGTM merge away