Skip to content

Commit

Permalink
basic data structure in place, "name" property implemented for all re…
Browse files Browse the repository at this point in the history
…sources, node data fully implemented
  • Loading branch information
jackfrancis committed Jul 14, 2016
1 parent b613535 commit 2c73dff
Show file tree
Hide file tree
Showing 28 changed files with 1,344 additions and 245 deletions.
136 changes: 136 additions & 0 deletions api/swagger-spec/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,149 @@ definitions:
type: array
items:
$ref: "#/definitions/componentVersion"
daemonSet:
type: object
required:
- name
properties:
name:
type: string
deployment:
type: object
required:
- name
properties:
name:
type: string
nodeSpec:
type: object
properties:
podCIDR:
type: string
externalID:
type: string
providerID:
type: string
unschedulable:
type: boolean
nodeStatus:
type: object
properties:
capacity:
type: object
allocatable:
type: object
phase:
type: string
conditions:
type: object
addresses:
type: object
daemonEndpoints:
type: object
nodeInfo:
type: object
images:
type: object
volumesInUse:
type: array
volumesAttached:
type: object
node:
type: object
required:
- name
properties:
name:
type: string
selfLink:
type: string
uid:
type: string
resourceVersion:
type: string
generation:
type: integer
format: int64
labels:
type: object
spec:
$ref: "#/definitions/nodeSpec"
status:
$ref: "#/definitions/nodeStatus"
pod:
type: object
required:
- name
properties:
name:
type: string
replicaSet:
type: object
required:
- name
properties:
name:
type: string
replicationController:
type: object
required:
- name
properties:
name:
type: string
service:
type: object
required:
- name
properties:
name:
type: string
namespace:
type: object
properties:
name:
type: string
daemonSets:
type: array
items:
$ref: "#/definitions/daemonSet"
deployments:
type: array
items:
$ref: "#/definitions/deployment"
pods:
type: array
items:
$ref: "#/definitions/pod"
replicaSets:
type: array
items:
$ref: "#/definitions/replicaSet"
replicationControllers:
type: array
items:
$ref: "#/definitions/replicationController"
services:
type: array
items:
$ref: "#/definitions/service"
doctorInfo:
type: object
required:
- cluster
- nodes
properties:
cluster:
$ref: "#/definitions/cluster"
nodes:
type: array
items:
$ref: "#/definitions/node"
namespaces:
type: array
items:
$ref: "#/definitions/namespace"
componentVersion:
type: object
properties:
Expand Down
10 changes: 9 additions & 1 deletion boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ func main() {
}
secretInterface := kubeClient.Secrets(config.Spec.DeisNamespace)
rcInterface := kubeClient.ReplicationControllers(config.Spec.DeisNamespace)
nodeInterface := kubeClient.Nodes()
podInterface := kubeClient.Pods(config.Spec.DeisNamespace)
replicaSetInterface := kubeClient.ExtensionsClient.ReplicaSets(config.Spec.DeisNamespace)
daemonSetInterface := kubeClient.ExtensionsClient.DaemonSets(config.Spec.DeisNamespace)
deploymentInterface := kubeClient.ExtensionsClient.Deployments(config.Spec.DeisNamespace)
serviceInterface := kubeClient.Services(config.Spec.DeisNamespace)
clusterID := data.NewClusterIDFromPersistentStorage(secretInterface)
installedDeisData := data.NewInstalledDeisData(rcInterface)
availableVersion := data.NewAvailableVersionsFromAPI(
Expand Down Expand Up @@ -54,7 +60,9 @@ func main() {
defer close(ch)

// Get a new router, with handler functions
r := handlers.RegisterRoutes(mux.NewRouter(), secretInterface, rcInterface, availableVersion)
r := handlers.RegisterRoutes(mux.NewRouter(), availableVersion, daemonSetInterface,
deploymentInterface, nodeInterface, podInterface, rcInterface, replicaSetInterface,
secretInterface, serviceInterface)
// Bind to a port and pass our router in
hostStr := fmt.Sprintf(":%s", config.Spec.Port)
log.Printf("Serving on %s", hostStr)
Expand Down
1 change: 1 addition & 0 deletions boot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func newServer(apiClient *apiclient.WorkflowManager) *httptest.Server {
r.Handle("/id", idHdl)
docHdl := handlers.DoctorHandler(
mocks.InstalledMockData{},
mocks.RunningK8sMockData{}, // TODO: mock k8s node data
&mocks.ClusterIDMockData{},
mocks.LatestMockData{},
data.NewFakeKubeSecretGetterCreator(nil, nil),
Expand Down
2 changes: 1 addition & 1 deletion data/available_component_versions.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package data

import (
"github.com/arschles/kubeapp/api/rc"
"github.com/deis/kubeapp/api/rc"
"github.com/deis/workflow-manager/pkg/swagger/models"
)

Expand Down
2 changes: 1 addition & 1 deletion data/available_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package data
import (
"sync"

"github.com/arschles/kubeapp/api/rc"
"github.com/deis/kubeapp/api/rc"
"github.com/deis/workflow-manager/config"
apiclient "github.com/deis/workflow-manager/pkg/swagger/client"
"github.com/deis/workflow-manager/pkg/swagger/client/operations"
Expand Down
Loading

0 comments on commit 2c73dff

Please sign in to comment.