Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

Mobile app crd #32

Merged
merged 11 commits into from
Aug 3, 2018
Merged

Mobile app crd #32

merged 11 commits into from
Aug 3, 2018

Conversation

wei-lee
Copy link
Contributor

@wei-lee wei-lee commented Aug 1, 2018

What

The PR adds the MobileClient CRD and the basic structure for the endpoints to CRUDL mobile clients. As part of this, the operator-sdk is introduced to make it easier to interact with the CRD.

Why

In order to allow developers to manage the mobile clients, we need the endpoints on the backend and save the data somewhere. As described in the overview doc, we are using CRD to store the mobile client data.

Tasks

  • Add CRD
  • Implement the service to store mobile clients data
  • Implement the endpoints
  • Add tests

Verify

  1. Make sure you lcoal oc cluster is up and running and login as admin user
  2. Create the CRD by running oc create -f ./deploy/crd.yaml
  3. Make sure set the KUBERNETES_CONFIG and NAMESPACE env var, and start the service
  4. Now you can use curl to try the endpoints:
     # create
     curl -X POST http://localhost:4000/api/mobileclients --header "Content-Type: application/json" -d'{"name":"example1","clientType":"cordova","appIdentifier":"test2-updated.aerogear.org"}'
     # list
     curl http://localhost:4000/api/mobileclients
     # read
     curl http://localhost:4000/api/mobileclients/example1
     # update
     curl -X POST http://localhost:4000/api/mobileclients/example1 --header "Content-Type: application/json" -d'{"appIdentifier":"test2-updated.aerogear.org"}'
     # delete
     curl -X DELETE http://localhost:4000/api/mobileclients/example1
    

@coveralls
Copy link

coveralls commented Aug 3, 2018

Pull Request Test Coverage Report for Build 277

  • 91 of 178 (51.12%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-4.09%) to 70.297%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/web/router.go 12 13 92.31%
pkg/mobile/serviceInstances.go 10 12 83.33%
pkg/web/mobileClientsHandler.go 69 105 65.71%
pkg/mobile/mobileClient.go 0 48 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/web/router.go 1 94.44%
Totals Coverage Status
Change from base Build 263: -4.09%
Covered Lines: 213
Relevant Lines: 303

💛 - Coveralls

@wei-lee wei-lee changed the title [WIP] Mobile app crd Mobile app crd Aug 3, 2018
Copy link
Member

@StephenCoady StephenCoady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the knowledge to code review this but I have had a look anyway and nothing sticks out. I also verified that all endpoints work as expected.

Copy link
Contributor

@sedroche sedroche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wei-lee wei-lee merged commit 55a868c into master Aug 3, 2018
@wei-lee wei-lee deleted the mobile-app-crd branch August 3, 2018 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants