Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #232 from hrishin/issue-229-validation
Browse files Browse the repository at this point in the history
Issue 229 validation
  • Loading branch information
hrishin authored Nov 2, 2017
2 parents 2fac84b + b9d12ef commit 049172a
Show file tree
Hide file tree
Showing 7 changed files with 49,879 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build: gobuild
gobuild:
CGO_ENABLED=0 GO15VENDOREXPERIMENT=1 go build -a ./cmd/generate/generate.go
./generate > kubernetes-model/src/main/resources/schema/kube-schema.json
./generate validation > kubernetes-model/src/main/resources/schema/validation-schema.json

vendoring:
hack/glide-update.sh
9 changes: 9 additions & 0 deletions cmd/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import (
watch "k8s.io/kubernetes/pkg/watch/json"

"github.com/fabric8io/kubernetes-model/pkg/schemagen"
//"os"
"os"
)

type Schema struct {
Expand Down Expand Up @@ -91,7 +93,9 @@ type Schema struct {
ImageList imageapi.ImageList
ImageStreamList imageapi.ImageStreamList
ImageStreamTagList imageapi.ImageStreamTagList
DeploymentConfig deployapi.DeploymentConfig
DeploymentConfigList deployapi.DeploymentConfigList
Route routeapi.Route
RouteList routeapi.RouteList
ComponentStatusList kapi.ComponentStatusList
ContainerStatus kapi.ContainerStatus
Expand Down Expand Up @@ -217,6 +221,11 @@ func main() {
return
}

args := os.Args[1:]
if len(args) < 1 || args[0] != "validation" {
schema.Resources = nil
}

b, err := json.Marshal(&schema)
if err != nil {
log.Fatal(err)
Expand Down
8 changes: 8 additions & 0 deletions kubernetes-model/src/main/resources/schema/kube-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13617,6 +13617,10 @@
"$ref": "#/definitions/kubernetes_extensions_Deployment",
"javaType": "io.fabric8.kubernetes.api.model.extensions.Deployment"
},
"DeploymentConfig": {
"$ref": "#/definitions/os_deploy_DeploymentConfig",
"javaType": "io.fabric8.openshift.api.model.DeploymentConfig"
},
"DeploymentConfigList": {
"$ref": "#/definitions/os_deploy_DeploymentConfigList",
"javaType": "io.fabric8.openshift.api.model.DeploymentConfigList"
Expand Down Expand Up @@ -13873,6 +13877,10 @@
"$ref": "#/definitions/k8s_io_apimachinery_RootPaths",
"javaType": "io.fabric8.kubernetes.api.model.RootPaths"
},
"Route": {
"$ref": "#/definitions/os_route_Route",
"javaType": "io.fabric8.openshift.api.model.Route"
},
"RouteList": {
"$ref": "#/definitions/os_route_RouteList",
"javaType": "io.fabric8.openshift.api.model.RouteList"
Expand Down
Loading

0 comments on commit 049172a

Please sign in to comment.