diff --git a/.gitignore b/.gitignore index 3544ff580b7..000ff7fcbea 100644 --- a/.gitignore +++ b/.gitignore @@ -81,8 +81,9 @@ com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties -# Ignore generator binary output file +# Ignore generator binary output file and vendor directory kubernetes-model-generator/openapi/generator/generator +kubernetes-model-generator/openapi/generator/vendor kubernetes-model-generator/*/generate extensions/*/generator/generate diff --git a/Makefile b/Makefile index b56cdd85a6a..8d2634551b5 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,11 @@ # MAVEN_OPTIONS ?= +OPENAPI_DIR=./kubernetes-model-generator/openapi +OPENAPI_GENERATOR_DIR=$(OPENAPI_DIR)/generator +OPENAPI_GENERATOR_BINARY_NAME=generator +OPENAPI_GENERATOR_BINARY=$(OPENAPI_GENERATOR_DIR)/$(OPENAPI_GENERATOR_BINARY_NAME) +OPENAPI_SCHEMAS_DIR=$(OPENAPI_DIR)/schemas .PHONY: clean-java clean-java: @@ -25,8 +30,9 @@ clean: clean-java .PHONY: generate-openapi generate-openapi: - cd kubernetes-model-generator/openapi/generator && go build - ./kubernetes-model-generator/openapi/generator/generator ./kubernetes-model-generator/openapi/schemas + cd $(OPENAPI_GENERATOR_DIR) && go build -o $(OPENAPI_GENERATOR_BINARY_NAME) ./cmd + $(OPENAPI_GENERATOR_BINARY) reflection $(OPENAPI_SCHEMAS_DIR) + $(OPENAPI_GENERATOR_BINARY) open-api $(OPENAPI_SCHEMAS_DIR) .PHONY: generate-openapi-classes generate-openapi-classes: diff --git a/kubernetes-model-generator/openapi/generator/README.md b/kubernetes-model-generator/openapi/generator/README.md index 66b77f2bb82..abe6887bce3 100644 --- a/kubernetes-model-generator/openapi/generator/README.md +++ b/kubernetes-model-generator/openapi/generator/README.md @@ -22,7 +22,7 @@ Many of these types are used for WebHooks. ## Usage ```shell -./generator $pathToTargetDirectory +./generator reflection $pathToTargetDirectory ``` ## Additional notes and resources diff --git a/kubernetes-model-generator/openapi/generator/cmd/main.go b/kubernetes-model-generator/openapi/generator/cmd/main.go new file mode 100644 index 00000000000..d32be8ff7a1 --- /dev/null +++ b/kubernetes-model-generator/openapi/generator/cmd/main.go @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package main + +import ( + "flag" + "fmt" + "os" +) + +func main() { + defer func() { + if r := recover(); r != nil { + fmt.Println("Error:", r) + os.Exit(1) + } + }() + flag.Parse() + if err := rootCmd.Execute(); err != nil { + panic(err) + } +} diff --git a/kubernetes-model-generator/openapi/generator/cmd/openapi.go b/kubernetes-model-generator/openapi/generator/cmd/openapi.go new file mode 100644 index 00000000000..69d1db56e4f --- /dev/null +++ b/kubernetes-model-generator/openapi/generator/cmd/openapi.go @@ -0,0 +1,32 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package main + +import "github.com/spf13/cobra" + +var openApi = &cobra.Command{ + Use: "open-api [targetDirectory]", + Short: "Generate OpenAPI definitions from OpenAPI/Swagger schema definitions in codegen and openapi-gen zz_generated files", + Run: openApiRun, +} + +func init() { + rootCmd.AddCommand(openApi) +} + +var openApiRun = func(cobraCmd *cobra.Command, args []string) { + +} diff --git a/kubernetes-model-generator/openapi/generator/main.go b/kubernetes-model-generator/openapi/generator/cmd/reflection.go similarity index 94% rename from kubernetes-model-generator/openapi/generator/main.go rename to kubernetes-model-generator/openapi/generator/cmd/reflection.go index e41015c9767..205a7d085e8 100644 --- a/kubernetes-model-generator/openapi/generator/main.go +++ b/kubernetes-model-generator/openapi/generator/cmd/reflection.go @@ -21,6 +21,7 @@ import ( openshiftmachinev1 "github.com/openshift/api/machine/v1" openshiftmachinev1alpha1 "github.com/openshift/api/machine/v1alpha1" openshiftsecurityv1 "github.com/openshift/api/security/v1" + "github.com/spf13/cobra" admissionV1 "k8s.io/api/admission/v1" admissionV1Beta1 "k8s.io/api/admission/v1beta1" admissionregistrationV1 "k8s.io/api/admissionregistration/v1" @@ -40,39 +41,21 @@ import ( "time" ) -type ApiVersion struct { - List bool - GroupVersion string - Plural string - Namespaced bool +var reflection = &cobra.Command{ + Use: "reflection [targetDirectory]", + Short: "Generate OpenAPI definitions from Go type reflection", + Args: cobra.MaximumNArgs(1), + Run: reflectionRun, } -type Schema struct { - Types []reflect.Type - Name string - Paths map[reflect.Type]ApiVersion +func init() { + rootCmd.AddCommand(reflection) } -var mappingOverrides = map[reflect.Type]string{ - reflect.TypeOf(kustomize.ObjectMeta{}): "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", -} - -func NewTypeSchema(types []reflect.Type, name string) Schema { - return Schema{types, name, make(map[reflect.Type]ApiVersion)} -} - -func NewPathSchema(paths map[reflect.Type]ApiVersion, name string) Schema { - schema := Schema{make([]reflect.Type, 0), name, paths} - for t := range paths { - schema.Types = append(schema.Types, t) - } - return schema -} - -func main() { +var reflectionRun = func(cmd *cobra.Command, args []string) { var targetDirectory string - if len(os.Args) > 1 { - targetDirectory = os.Args[1] + if len(args) > 0 { + targetDirectory = args[0] } else { targetDirectory = "." } diff --git a/kubernetes-model-generator/openapi/generator/cmd/root.go b/kubernetes-model-generator/openapi/generator/cmd/root.go new file mode 100644 index 00000000000..c4af03f2737 --- /dev/null +++ b/kubernetes-model-generator/openapi/generator/cmd/root.go @@ -0,0 +1,23 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package main + +import "github.com/spf13/cobra" + +var rootCmd = &cobra.Command{ + Use: "generator", + Short: "Kubernetes and OpenShift model generator", +} diff --git a/kubernetes-model-generator/openapi/generator/cmd/schema.go b/kubernetes-model-generator/openapi/generator/cmd/schema.go new file mode 100644 index 00000000000..474a365c67d --- /dev/null +++ b/kubernetes-model-generator/openapi/generator/cmd/schema.go @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package main + +import ( + "reflect" + kustomize "sigs.k8s.io/kustomize/api/types" +) + +type ApiVersion struct { + List bool + GroupVersion string + Plural string + Namespaced bool +} + +type Schema struct { + Types []reflect.Type + Name string + Paths map[reflect.Type]ApiVersion +} + +var mappingOverrides = map[reflect.Type]string{ + reflect.TypeOf(kustomize.ObjectMeta{}): "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", +} + +func NewTypeSchema(types []reflect.Type, name string) Schema { + return Schema{types, name, make(map[reflect.Type]ApiVersion)} +} + +func NewPathSchema(paths map[reflect.Type]ApiVersion, name string) Schema { + schema := Schema{make([]reflect.Type, 0), name, paths} + for t := range paths { + schema.Types = append(schema.Types, t) + } + return schema +} diff --git a/kubernetes-model-generator/openapi/generator/go.mod b/kubernetes-model-generator/openapi/generator/go.mod index a172a21dfdc..78d3ff272f1 100644 --- a/kubernetes-model-generator/openapi/generator/go.mod +++ b/kubernetes-model-generator/openapi/generator/go.mod @@ -1,10 +1,13 @@ module github.com/fabric8io/kubernetes-client/kubernetes-model-generator/openapi/generator -go 1.22.0 +go 1.23 + +toolchain go1.23.1 require ( github.com/getkin/kin-openapi v0.125.0 - github.com/openshift/api v0.0.0-20240911192208-3e5de946111c + // Match lastest commit in the version branch (e.g. release-4.17) + github.com/openshift/api v0.0.0-20240912201240-0a8800162826 k8s.io/api v0.30.2 k8s.io/apiextensions-apiserver v0.30.2 k8s.io/apimachinery v0.30.2 @@ -25,6 +28,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -33,6 +37,8 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/kubernetes-model-generator/openapi/generator/go.sum b/kubernetes-model-generator/openapi/generator/go.sum index a7f147b817b..192e78bf81e 100644 --- a/kubernetes-model-generator/openapi/generator/go.sum +++ b/kubernetes-model-generator/openapi/generator/go.sum @@ -1,3 +1,4 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -32,6 +33,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -55,8 +58,8 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/openshift/api v0.0.0-20240911192208-3e5de946111c h1:46hH/7XmmaPmeJWTyrzh8TRB6I7TCwzJdxxWeyK8blM= -github.com/openshift/api v0.0.0-20240911192208-3e5de946111c/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM= +github.com/openshift/api v0.0.0-20240912201240-0a8800162826 h1:A8D9SN/hJUwAbdO0rPCVTqmuBOctdgurr53gK701SYo= +github.com/openshift/api v0.0.0-20240912201240-0a8800162826/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -64,6 +67,9 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/kubernetes-model-generator/openapi/maven-plugin/src/main/java/io/fabric8/kubernetes/schema/generator/schema/SchemaUtils.java b/kubernetes-model-generator/openapi/maven-plugin/src/main/java/io/fabric8/kubernetes/schema/generator/schema/SchemaUtils.java index a049acf5056..6be6aa8f588 100644 --- a/kubernetes-model-generator/openapi/maven-plugin/src/main/java/io/fabric8/kubernetes/schema/generator/schema/SchemaUtils.java +++ b/kubernetes-model-generator/openapi/maven-plugin/src/main/java/io/fabric8/kubernetes/schema/generator/schema/SchemaUtils.java @@ -130,6 +130,7 @@ public class SchemaUtils { TYPE_MAP.put("int32", "Integer"); TYPE_MAP.put("integer", "Integer"); TYPE_MAP.put("int64", "Long"); + TYPE_MAP.put("float", "Float"); TYPE_MAP.put("double", "Double"); TYPE_MAP.put("number", "Number"); TYPE_MAP.put("object", OBJECT_PRIMITIVE); diff --git a/kubernetes-model-generator/openapi/schemas/openshift-security.json b/kubernetes-model-generator/openapi/schemas/openshift-security.json index b448137d001..2d740f1cdf1 100644 --- a/kubernetes-model-generator/openapi/schemas/openshift-security.json +++ b/kubernetes-model-generator/openapi/schemas/openshift-security.json @@ -1 +1 @@ -{"components":{"schemas":{"com.github.openshift.api.security.v1.AllowedFlexVolume":{"properties":{"driver":{"type":"string"}},"type":"object"},"com.github.openshift.api.security.v1.FSGroupStrategyOptions":{"properties":{"ranges":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.IDRange"},"type":"array"},"type":{"type":"string"}},"type":"object"},"com.github.openshift.api.security.v1.IDRange":{"properties":{"max":{"format":"int64","type":"integer"},"min":{"format":"int64","type":"integer"}},"type":"object"},"com.github.openshift.api.security.v1.RunAsUserStrategyOptions":{"properties":{"type":{"type":"string"},"uid":{"format":"int64","type":"integer"},"uidRangeMax":{"format":"int64","type":"integer"},"uidRangeMin":{"format":"int64","type":"integer"}},"type":"object"},"com.github.openshift.api.security.v1.SELinuxContextStrategyOptions":{"properties":{"seLinuxOptions":{"$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"type":{"type":"string"}},"type":"object"},"com.github.openshift.api.security.v1.SecurityContextConstraints":{"properties":{"allowHostDirVolumePlugin":{"type":"boolean"},"allowHostIPC":{"type":"boolean"},"allowHostNetwork":{"type":"boolean"},"allowHostPID":{"type":"boolean"},"allowHostPorts":{"type":"boolean"},"allowPrivilegeEscalation":{"type":"boolean"},"allowPrivilegedContainer":{"type":"boolean"},"allowedCapabilities":{"items":{"type":"string"},"type":"array"},"allowedFlexVolumes":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.AllowedFlexVolume"},"type":"array"},"allowedUnsafeSysctls":{"items":{"type":"string"},"type":"array"},"apiVersion":{"type":"string"},"defaultAddCapabilities":{"items":{"type":"string"},"type":"array"},"defaultAllowPrivilegeEscalation":{"type":"boolean"},"forbiddenSysctls":{"items":{"type":"string"},"type":"array"},"fsGroup":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.FSGroupStrategyOptions"},"groups":{"items":{"type":"string"},"type":"array"},"kind":{"type":"string"},"metadata":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"priority":{"format":"int32","type":"integer"},"readOnlyRootFilesystem":{"type":"boolean"},"requiredDropCapabilities":{"items":{"type":"string"},"type":"array"},"runAsUser":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.RunAsUserStrategyOptions"},"seLinuxContext":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SELinuxContextStrategyOptions"},"seccompProfiles":{"items":{"type":"string"},"type":"array"},"supplementalGroups":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SupplementalGroupsStrategyOptions"},"userNamespaceLevel":{"type":"string"},"users":{"items":{"type":"string"},"type":"array"},"volumes":{"items":{"type":"string"},"type":"array"}},"type":"object"},"com.github.openshift.api.security.v1.SecurityContextConstraintsList":{"properties":{"apiVersion":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SecurityContextConstraints"},"type":"array"},"kind":{"type":"string"},"metadata":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"type":"object"},"com.github.openshift.api.security.v1.SupplementalGroupsStrategyOptions":{"properties":{"ranges":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.IDRange"},"type":"array"},"type":{"type":"string"}},"type":"object"},"io.k8s.api.core.v1.SELinuxOptions":{"properties":{"level":{"type":"string"},"role":{"type":"string"},"type":{"type":"string"},"user":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"properties":{"-":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"properties":{"continue":{"type":"string"},"remainingItemCount":{"format":"int64","type":"integer"},"resourceVersion":{"type":"string"},"selfLink":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"properties":{"apiVersion":{"type":"string"},"fieldsType":{"type":"string"},"fieldsV1":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"type":"string"},"operation":{"type":"string"},"subresource":{"type":"string"},"time":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"properties":{"annotations":{"additionalProperties":{"type":"string"},"type":"object"},"creationTimestamp":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"format":"int64","type":"integer"},"deletionTimestamp":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"items":{"type":"string"},"type":"array"},"generateName":{"type":"string"},"generation":{"format":"int64","type":"integer"},"labels":{"additionalProperties":{"type":"string"},"type":"object"},"managedFields":{"items":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"},"type":"array"},"name":{"type":"string"},"namespace":{"type":"string"},"ownerReferences":{"items":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"type":"array"},"resourceVersion":{"type":"string"},"selfLink":{"type":"string"},"uid":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"properties":{"apiVersion":{"type":"string"},"blockOwnerDeletion":{"type":"boolean"},"controller":{"type":"boolean"},"kind":{"type":"string"},"name":{"type":"string"},"uid":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"properties":{"Time":{"type":"string"}},"type":"object"}}},"info":{"title":"openshift-security","version":"0.0.0"},"openapi":"3.0.0","paths":{"/apis/security.openshift.io/v1/securitycontextconstraints":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SecurityContextConstraintsList"}}},"description":"OK"},"default":{"description":""}},"x-kubernetes-group-version-kind":{"group":"security.openshift.io","kind":"SecurityContextConstraintsList","version":"v1"}}},"/apis/security.openshift.io/v1/securitycontextconstraints/{name}":{"get":{"parameters":[{"in":"path","name":"name","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SecurityContextConstraints"}}},"description":"OK"},"default":{"description":""}},"x-kubernetes-group-version-kind":{"group":"security.openshift.io","kind":"SecurityContextConstraints","version":"v1"}}}}} \ No newline at end of file +{"components":{"schemas":{"com.github.openshift.api.security.v1.AllowedFlexVolume":{"properties":{"driver":{"type":"string"}},"type":"object"},"com.github.openshift.api.security.v1.FSGroupStrategyOptions":{"properties":{"ranges":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.IDRange"},"type":"array"},"type":{"type":"string"}},"type":"object"},"com.github.openshift.api.security.v1.IDRange":{"properties":{"max":{"format":"int64","type":"integer"},"min":{"format":"int64","type":"integer"}},"type":"object"},"com.github.openshift.api.security.v1.RunAsUserStrategyOptions":{"properties":{"type":{"type":"string"},"uid":{"format":"int64","type":"integer"},"uidRangeMax":{"format":"int64","type":"integer"},"uidRangeMin":{"format":"int64","type":"integer"}},"type":"object"},"com.github.openshift.api.security.v1.SELinuxContextStrategyOptions":{"properties":{"seLinuxOptions":{"$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"type":{"type":"string"}},"type":"object"},"com.github.openshift.api.security.v1.SecurityContextConstraints":{"properties":{"allowHostDirVolumePlugin":{"type":"boolean"},"allowHostIPC":{"type":"boolean"},"allowHostNetwork":{"type":"boolean"},"allowHostPID":{"type":"boolean"},"allowHostPorts":{"type":"boolean"},"allowPrivilegeEscalation":{"type":"boolean"},"allowPrivilegedContainer":{"type":"boolean"},"allowedCapabilities":{"items":{"type":"string"},"type":"array"},"allowedFlexVolumes":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.AllowedFlexVolume"},"type":"array"},"allowedUnsafeSysctls":{"items":{"type":"string"},"type":"array"},"apiVersion":{"type":"string"},"defaultAddCapabilities":{"items":{"type":"string"},"type":"array"},"defaultAllowPrivilegeEscalation":{"type":"boolean"},"forbiddenSysctls":{"items":{"type":"string"},"type":"array"},"fsGroup":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.FSGroupStrategyOptions"},"groups":{"items":{"type":"string"},"type":"array"},"kind":{"type":"string"},"metadata":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"priority":{"format":"int32","type":"integer"},"readOnlyRootFilesystem":{"type":"boolean"},"requiredDropCapabilities":{"items":{"type":"string"},"type":"array"},"runAsUser":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.RunAsUserStrategyOptions"},"seLinuxContext":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SELinuxContextStrategyOptions"},"seccompProfiles":{"items":{"type":"string"},"type":"array"},"supplementalGroups":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SupplementalGroupsStrategyOptions"},"users":{"items":{"type":"string"},"type":"array"},"volumes":{"items":{"type":"string"},"type":"array"}},"type":"object"},"com.github.openshift.api.security.v1.SecurityContextConstraintsList":{"properties":{"apiVersion":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SecurityContextConstraints"},"type":"array"},"kind":{"type":"string"},"metadata":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"type":"object"},"com.github.openshift.api.security.v1.SupplementalGroupsStrategyOptions":{"properties":{"ranges":{"items":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.IDRange"},"type":"array"},"type":{"type":"string"}},"type":"object"},"io.k8s.api.core.v1.SELinuxOptions":{"properties":{"level":{"type":"string"},"role":{"type":"string"},"type":{"type":"string"},"user":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"properties":{"-":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"properties":{"continue":{"type":"string"},"remainingItemCount":{"format":"int64","type":"integer"},"resourceVersion":{"type":"string"},"selfLink":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"properties":{"apiVersion":{"type":"string"},"fieldsType":{"type":"string"},"fieldsV1":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"type":"string"},"operation":{"type":"string"},"subresource":{"type":"string"},"time":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"properties":{"annotations":{"additionalProperties":{"type":"string"},"type":"object"},"creationTimestamp":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"format":"int64","type":"integer"},"deletionTimestamp":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"items":{"type":"string"},"type":"array"},"generateName":{"type":"string"},"generation":{"format":"int64","type":"integer"},"labels":{"additionalProperties":{"type":"string"},"type":"object"},"managedFields":{"items":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"},"type":"array"},"name":{"type":"string"},"namespace":{"type":"string"},"ownerReferences":{"items":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"type":"array"},"resourceVersion":{"type":"string"},"selfLink":{"type":"string"},"uid":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"properties":{"apiVersion":{"type":"string"},"blockOwnerDeletion":{"type":"boolean"},"controller":{"type":"boolean"},"kind":{"type":"string"},"name":{"type":"string"},"uid":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"properties":{"Time":{"type":"string"}},"type":"object"}}},"info":{"title":"openshift-security","version":"0.0.0"},"openapi":"3.0.0","paths":{"/apis/security.openshift.io/v1/securitycontextconstraints":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SecurityContextConstraintsList"}}},"description":"OK"},"default":{"description":""}},"x-kubernetes-group-version-kind":{"group":"security.openshift.io","kind":"SecurityContextConstraintsList","version":"v1"}}},"/apis/security.openshift.io/v1/securitycontextconstraints/{name}":{"get":{"parameters":[{"in":"path","name":"name","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/com.github.openshift.api.security.v1.SecurityContextConstraints"}}},"description":"OK"},"default":{"description":""}},"x-kubernetes-group-version-kind":{"group":"security.openshift.io","kind":"SecurityContextConstraints","version":"v1"}}}}} \ No newline at end of file diff --git a/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/SecurityContextConstraints.java b/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/SecurityContextConstraints.java index 8028370ca26..d448349ab8e 100644 --- a/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/SecurityContextConstraints.java +++ b/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/SecurityContextConstraints.java @@ -62,7 +62,6 @@ "seLinuxContext", "seccompProfiles", "supplementalGroups", - "userNamespaceLevel", "users", "volumes" }) @@ -160,8 +159,6 @@ public class SecurityContextConstraints implements Editable seccompProfiles = new ArrayList<>(); @JsonProperty("supplementalGroups") private SupplementalGroupsStrategyOptions supplementalGroups; - @JsonProperty("userNamespaceLevel") - private String userNamespaceLevel; @JsonProperty("users") @JsonInclude(JsonInclude.Include.NON_EMPTY) private List users = new ArrayList<>(); @@ -178,7 +175,7 @@ public class SecurityContextConstraints implements Editable allowedCapabilities, List allowedFlexVolumes, List allowedUnsafeSysctls, String apiVersion, List defaultAddCapabilities, Boolean defaultAllowPrivilegeEscalation, List forbiddenSysctls, FSGroupStrategyOptions fsGroup, List groups, String kind, ObjectMeta metadata, Integer priority, Boolean readOnlyRootFilesystem, List requiredDropCapabilities, RunAsUserStrategyOptions runAsUser, SELinuxContextStrategyOptions seLinuxContext, List seccompProfiles, SupplementalGroupsStrategyOptions supplementalGroups, String userNamespaceLevel, List users, List volumes) { + public SecurityContextConstraints(Boolean allowHostDirVolumePlugin, Boolean allowHostIPC, Boolean allowHostNetwork, Boolean allowHostPID, Boolean allowHostPorts, Boolean allowPrivilegeEscalation, Boolean allowPrivilegedContainer, List allowedCapabilities, List allowedFlexVolumes, List allowedUnsafeSysctls, String apiVersion, List defaultAddCapabilities, Boolean defaultAllowPrivilegeEscalation, List forbiddenSysctls, FSGroupStrategyOptions fsGroup, List groups, String kind, ObjectMeta metadata, Integer priority, Boolean readOnlyRootFilesystem, List requiredDropCapabilities, RunAsUserStrategyOptions runAsUser, SELinuxContextStrategyOptions seLinuxContext, List seccompProfiles, SupplementalGroupsStrategyOptions supplementalGroups, List users, List volumes) { super(); this.allowHostDirVolumePlugin = allowHostDirVolumePlugin; this.allowHostIPC = allowHostIPC; @@ -205,7 +202,6 @@ public SecurityContextConstraints(Boolean allowHostDirVolumePlugin, Boolean allo this.seLinuxContext = seLinuxContext; this.seccompProfiles = seccompProfiles; this.supplementalGroups = supplementalGroups; - this.userNamespaceLevel = userNamespaceLevel; this.users = users; this.volumes = volumes; } @@ -488,16 +484,6 @@ public void setSupplementalGroups(SupplementalGroupsStrategyOptions supplemental this.supplementalGroups = supplementalGroups; } - @JsonProperty("userNamespaceLevel") - public String getUserNamespaceLevel() { - return userNamespaceLevel; - } - - @JsonProperty("userNamespaceLevel") - public void setUserNamespaceLevel(String userNamespaceLevel) { - this.userNamespaceLevel = userNamespaceLevel; - } - @JsonProperty("users") @JsonInclude(JsonInclude.Include.NON_EMPTY) public List getUsers() {