Merge lp://staging/~danilo/landscape-charm/api-endpoint into lp://staging/~landscape/landscape-charm/trunk

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: 319
Merged at revision: 316
Proposed branch: lp://staging/~danilo/landscape-charm/api-endpoint
Merge into: lp://staging/~landscape/landscape-charm/trunk
Diff against target: 56 lines (+16/-5)
2 files modified
lib/tests/test_templates.py (+6/-0)
templates/service.conf (+10/-5)
To merge this branch: bzr merge lp://staging/~danilo/landscape-charm/api-endpoint
Reviewer Review Type Date Requested Status
🤖 Landscape Builder test results Approve
Free Ekanayaka (community) Approve
Adam Collard (community) Approve
Review via email: mp+262332@code.staging.launchpad.net

Commit message

Change API and package-upload root-urls to use the haproxy IP

This will ensure we are using the right base URL for the API endpoint on the /settings page.

However, the full URL will still be incorrect: "/api/" needs to be appended to it: we need to fix that in the landscape codebase.

Description of the change

Change API and package-upload root-urls to use the haproxy IP

This will ensure we are using the right base URL for the API endpoint on the /settings page.

However, the full URL will still be incorrect: "/api/" needs to be appended to it: I've fix that in the landscape codebase.

The API messages seem encrypted containing bits of the root-url, so it's not enough to append "/api/" to it: the API stops working. I've tested that with

  landscape-api --uri=https://haproxy-ip/api/ --key ".." --secret "..." --ssl-ca-file ./selfsigned_ca.crt get-roles

(selfsigned_ca.crt comes from haproxy-unit:/var/lib/haproxy/selfsigned_ca.crt)

To deploy the charm, grab landscape.yaml from https://pastebin.canonical.com/133442/ and deploy with

  juju-deployer -vdW -w90 -c landscape.yaml landscape

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make ci-test
Result: Success
Revno: 319
Branch: lp:~danilo/landscape-charm/api-endpoint
Jenkins: https://ci.lscape.net/job/latch-test/1480/

review: Approve (test results)
Revision history for this message
Adam Collard (adam-collard) wrote :

Looks good! +1

review: Approve
Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Could we add an integration test?

The best would be to add a public URL like:

https://<landscape-server>/get-api-client

that can be used to download the specific Landscape API python client version for that server. This could be then be used by the charm integration tests to proof the API.

We'll need something like this for system tests too.

review: Approve
Revision history for this message
Данило Шеган (danilo) wrote :

@Free: sure we could. Let's do that as a separate branch, though.

Thanks for reviews!

Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make ci-test
Result: Success
Revno: 319
Branch: lp:~danilo/landscape-charm/api-endpoint
Jenkins: https://ci.lscape.net/job/latch-test/1508/

review: Approve (test results)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches