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

Updated apiVersion for SecurityContextConstraints #274

Merged
merged 2 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kubernetes-model/src/main/resources/schema/kube-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13177,7 +13177,7 @@
"apiVersion": {
"type": "string",
"description": "",
"default": "security.openshift.io/v1",
"default": "v1",
"required": true
},
"defaultAddCapabilities": {
Expand Down Expand Up @@ -13276,7 +13276,7 @@
"apiVersion": {
"type": "string",
"description": "",
"default": "security.openshift.io/v1",
"default": "v1",
"required": true
},
"items": {
Expand Down
9 changes: 8 additions & 1 deletion pkg/schemagen/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,14 @@ func (g *schemaGenerator) getStructProperties(t reflect.Type) map[string]JSONPro
if strings.HasPrefix(path, "github.com/openshift/origin/pkg/") {
groupPostfix = ".openshift.io"
}
apiVersion = apiGroup + groupPostfix + "/" + apiVersion

//Added a special case for SecurityContextConstraints and SecurityContextConstraintsList
//Because its fetching "security.openshift.io/v1"
//and "v1" is working with kubernetes-client

if t.Name() != "SecurityContextConstraints" && t.Name() != "SecurityContextConstraintsList" {
apiVersion = apiGroup + groupPostfix + "/" + apiVersion
}
}
v = JSONPropertyDescriptor{
JSONDescriptor: &JSONDescriptor{
Expand Down