Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

missing auth_url field in client_config template #13

Closed
marcoverl opened this issue Dec 6, 2019 · 10 comments
Closed

missing auth_url field in client_config template #13

marcoverl opened this issue Dec 6, 2019 · 10 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@marcoverl
Copy link

Hello,
you should add the possibility to process the auth_url field from the config file, in order to enable deployments on those clouds where keystone server is not equal to host, e.g. like:
$ curl -v -k -H 'Content-type: text/yaml' -H 'Authorization: id = im; type = InfrastructureManager; token = '${ACCESS_TOKEN}'; \nid = ost; type = OpenStack; host = cloud-areapd.pd.infn.it; auth_version = 3.x_password; username = someuser@infn.it; password = ###; tenant = CLOUD-CERTIFICATION; domain = default; service_region = regionOne; auth_url = https://keystone-cv.pd.infn.it:443' -i -X POST https://im-dodas.cloud.cnaf.infn.it/infrastructures --data-binary "@cluster_on_cloudveneto.yaml"

@dciangot dciangot self-assigned this Dec 6, 2019
@dciangot dciangot added the bug Something isn't working label Dec 6, 2019
@dciangot
Copy link
Contributor

dciangot commented Dec 6, 2019

Ok, right. Should be easy to fix. Working on it.

@dciangot dciangot added this to the v0.3.0 milestone Dec 6, 2019
@dciangot
Copy link
Contributor

dciangot commented Dec 6, 2019

@marcoverl Can you give a try to v0.3.0-rc1? Should work now or at least putting it into the header.
Let me know!

wget https://github.com/Cloud-PG/dodas-go-client/releases/download/v0.3.0-rc1/dodas.zip
unzip dodas.zip
cp dodas /usr/local/bin

@marcoverl
Copy link
Author

it is quite strange: i obtain:
$ dodas create Kubernetes.yaml
Using config file: /home/verlato/.dodas.yaml
validate called
Template OK
Template: Kubernetes.yaml
Submitting request to : https://im-dodas.cloud.cnaf.infn.it:8800/infrastructures
ERROR:
Error Creating Inf.: Could not find specified endpoint

but when doing the same with the dodas client i build from my forked version with the same your changes it works:
$ dodas-go-client/dodas create Kubernetes.yaml
Using config file: /home/verlato/.dodas.yaml
validate called
Template OK
Template: Kubernetes.yaml
Submitting request to : https://im-dodas.cloud.cnaf.infn.it:8800/infrastructures
InfrastructureID: f0cb514c-1842-11ea-89f5-0242c0a8d003

The config file is:
$ cat /home/verlato/.dodas.yaml
cloud:
id: os
type: OpenStack
host: cloud-areapd.pd.infn.it
auth_url: https://keystone-cv.pd.infn.it
# e.g. host: http://openstack.fisica.unipg.it:5000/
username: verlato@infn.it
password: ###
tenant: GRID-CERTIFICATION
auth_version: 3.x_password
domain: default
im:
id: im
type: InfrastructureManager
host: https://im-dodas.cloud.cnaf.infn.it:8800/infrastructures
token: eyJraWQiO....

@dciangot
Copy link
Contributor

dciangot commented Dec 6, 2019

so the fix is ok, but no the binary? I could have done a mess with the upload :/

@marcoverl
Copy link
Author

yes, please check the binary, i did my build from https://github.com/marcoverl/dodas-go-client/tree/fix-authurl

@dciangot
Copy link
Contributor

dciangot commented Dec 6, 2019

That should be correctly updated now. Waiting for you green light before closing this and creating the PR for the next release.

@marcoverl
Copy link
Author

I have the same error. I've downloaded the https://github.com/Cloud-PG/dodas-go-client/archive/v0.3.0-rc1.tar.gz and did the make build on my centos7 and got the same error too.
It seems that the order in which AuthUrl and AuthVersion are written in the code does matter, because simply putting:
AuthUrl string yaml:"auth_url"
AuthVersion string yaml:"auth_version"
in root.go and
"AuthUrl": "auth_url",
"AuthVersion": "auth_version",
in create.go in this order made the rebuilt binary work.
Does it make sense?

@dciangot
Copy link
Contributor

dciangot commented Dec 7, 2019

mmm, I can't say why, but it's not a problem to put it like that.
So, hopefully this should work now: v0.3.0-rc2

Sorry for this many tries, but I don't have an endpoint on my side with different auth_url to test this.

@marcoverl
Copy link
Author

ok, it works now.
You can test with your endpoints too, because now setting auth_url is mandatory, otherwise you get the error message:
Error Creating Inf.: OpenStack instance must have auth_url set

@dciangot
Copy link
Contributor

Oh, I didn't know that. Btw, including now this into a PR vs master and closing. Feel free to reopen if anything is missing.

dciangot added a commit that referenced this issue Dec 11, 2019
Auth url now included in config parameters #13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants