auth

Paddy 2015-07-18 Parent:fc68085eb40d

180:4b68bac597b7 Go to Latest

auth/replication-controllers/authd.json

Update client to detect errors. The client doesn't treat non-200 responses as errors automatically, so we need to detect when the response.Errors property is set, and use that to return an error. To avoid the boilerplate and an extensive error system, I just wrapped them in an httpErrors type that implements the error interface. That way the errors can be returned, and callers can type-cast and interrogate them. I also updated the GetLogin function to return an auth.ErrLoginNotFound error when the httpErrors response indicates that's the reason the request failed.

History
paddy@176 1 {
paddy@176 2 "kind":"ReplicationController",
paddy@176 3 "apiVersion":"v1",
paddy@176 4 "metadata":{
paddy@176 5 "name": "ducky-authd",
paddy@176 6 "labels": {
paddy@176 7 "name": "authd",
paddy@176 8 "context": "ducky",
paddy@176 9 "repo": "secondbit--authd",
paddy@176 10 "role": "auth"
paddy@176 11 }
paddy@176 12 },
paddy@176 13 "spec":{
paddy@176 14 "replicas":1,
paddy@176 15 "selector":{
paddy@176 16 "context": "ducky",
paddy@176 17 "name":"authd",
paddy@176 18 "repo": "secondbit--authd",
paddy@176 19 "role": "auth"
paddy@176 20 },
paddy@176 21 "template":{
paddy@176 22 "metadata":{
paddy@176 23 "labels":{
paddy@176 24 "context": "ducky",
paddy@176 25 "name":"authd",
paddy@176 26 "repo": "secondbit--authd",
paddy@176 27 "role": "auth"
paddy@176 28 }
paddy@176 29 },
paddy@176 30 "spec":{
paddy@176 31 "volumes": [
paddy@176 32 {
paddy@176 33 "name": "jwt-volume",
paddy@176 34 "secret": {
paddy@176 35 "secretName": "jwt"
paddy@176 36 }
paddy@176 37 }
paddy@176 38 ],
paddy@176 39 "containers":[
paddy@176 40 {
paddy@176 41 "name":"ducky-authd",
paddy@176 42 "image": "secondbit/authd:latest",
paddy@176 43 "volumeMounts": [
paddy@176 44 {
paddy@176 45 "name": "jwt-volume",
paddy@176 46 "readOnly": true,
paddy@176 47 "mountPath": "/private/kubernetes/jwt"
paddy@176 48 }
paddy@176 49 ],
paddy@176 50 "ports":[
paddy@176 51 {
paddy@176 52 "name": "http",
paddy@176 53 "containerPort":9000
paddy@176 54 }
paddy@176 55 ]
paddy@176 56 }
paddy@176 57 ]
paddy@176 58 }
paddy@176 59 }
paddy@176 60 }
paddy@176 61 }