Merge pull request #697 from runzexia/refine-openapi-gen
do not genereate unused structs
This commit is contained in:
11
Makefile
11
Makefile
@@ -76,9 +76,18 @@ deploy: manifests
|
||||
# generate will generate crds' deepcopy & go openapi structs
|
||||
# Futher more about go:genreate . https://blog.golang.org/generate
|
||||
generate:
|
||||
GO111MODULE=on go install -mod=vendor k8s.io/code-generator/cmd/deepcopy-gen
|
||||
go generate ./pkg/... ./cmd/...
|
||||
|
||||
deepcopy:
|
||||
GO111MODULE=on go install -mod=vendor k8s.io/code-generator/cmd/deepcopy-gen
|
||||
${GOPATH}/bin/deepcopy-gen -i kubesphere.io/kubesphere/pkg/apis/... -h ./hack/boilerplate.go.txt -O zz_generated.deepcopy
|
||||
|
||||
openapi:
|
||||
go run ./vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ./vendor/k8s.io/apimachinery/pkg/apis/meta/v1,./pkg/apis/tenant/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1 -h ./hack/boilerplate.go.txt --report-filename ./api/api-rules/violation_exceptions.list
|
||||
go run ./vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ./vendor/k8s.io/apimachinery/pkg/apis/meta/v1,./pkg/apis/servicemesh/v1alpha2 -p kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2 -h ./hack/boilerplate.go.txt --report-filename ./api/api-rules/violation_exceptions.list
|
||||
go run ./vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ./vendor/k8s.io/api/networking/v1,./vendor/k8s.io/apimachinery/pkg/apis/meta/v1,./pkg/apis/network/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/network/v1alpha1 -h ./hack/boilerplate.go.txt --report-filename ./api/api-rules/violation_exceptions.list
|
||||
go run ./vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ./vendor/k8s.io/apimachinery/pkg/apis/meta/v1,./pkg/apis/devops/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1 -h ./hack/boilerplate.go.txt --report-filename ./api/api-rules/violation_exceptions.list
|
||||
go run ./tools/cmd/crd-doc-gen/main.go
|
||||
# Build the docker image
|
||||
docker-build: all
|
||||
docker build . -t ${IMG}
|
||||
|
||||
@@ -1,36 +1,3 @@
|
||||
API rule violation: names_match,./devops/v1alpha1,S2iBinarySpec,MD5
|
||||
API rule violation: names_match,k8s.io/api/core/v1,AzureDiskVolumeSource,DataDiskURI
|
||||
API rule violation: names_match,k8s.io/api/core/v1,ContainerStatus,LastTerminationState
|
||||
API rule violation: names_match,k8s.io/api/core/v1,DaemonEndpoint,Port
|
||||
API rule violation: names_match,k8s.io/api/core/v1,Event,ReportingController
|
||||
API rule violation: names_match,k8s.io/api/core/v1,FCVolumeSource,WWIDs
|
||||
API rule violation: names_match,k8s.io/api/core/v1,GlusterfsPersistentVolumeSource,EndpointsName
|
||||
API rule violation: names_match,k8s.io/api/core/v1,GlusterfsVolumeSource,EndpointsName
|
||||
API rule violation: names_match,k8s.io/api/core/v1,ISCSIPersistentVolumeSource,DiscoveryCHAPAuth
|
||||
API rule violation: names_match,k8s.io/api/core/v1,ISCSIPersistentVolumeSource,SessionCHAPAuth
|
||||
API rule violation: names_match,k8s.io/api/core/v1,ISCSIVolumeSource,DiscoveryCHAPAuth
|
||||
API rule violation: names_match,k8s.io/api/core/v1,ISCSIVolumeSource,SessionCHAPAuth
|
||||
API rule violation: names_match,k8s.io/api/core/v1,NodeResources,Capacity
|
||||
API rule violation: names_match,k8s.io/api/core/v1,NodeSpec,DoNotUse_ExternalID
|
||||
API rule violation: names_match,k8s.io/api/core/v1,PersistentVolumeSource,CephFS
|
||||
API rule violation: names_match,k8s.io/api/core/v1,PersistentVolumeSource,StorageOS
|
||||
API rule violation: names_match,k8s.io/api/core/v1,PodSpec,DeprecatedServiceAccount
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDPersistentVolumeSource,CephMonitors
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDPersistentVolumeSource,RBDImage
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDPersistentVolumeSource,RBDPool
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDPersistentVolumeSource,RadosUser
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,CephMonitors
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RBDImage
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RBDPool
|
||||
API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RadosUser
|
||||
API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,CephFS
|
||||
API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,StorageOS
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/api/resource,Quantity,Format
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/api/resource,Quantity,d
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/api/resource,Quantity,i
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/api/resource,Quantity,s
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/api/resource,int64Amount,scale
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/api/resource,int64Amount,value
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,APIResourceList,APIResources
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Duration,Duration
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Object
|
||||
@@ -38,10 +5,4 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEve
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,MicroTime,Time
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,StatusCause,Type
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,RawExtension,Raw
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,Raw
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,IntVal
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,StrVal
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,Type
|
||||
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1,S2iBinarySpec,MD5
|
||||
|
||||
@@ -5480,6 +5480,81 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.S2iBuildResult": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"commandPull": {
|
||||
"description": "Command for pull image.",
|
||||
"type": "string"
|
||||
},
|
||||
"imageCreated": {
|
||||
"description": "Image created time.",
|
||||
"type": "string"
|
||||
},
|
||||
"imageID": {
|
||||
"description": "Image ID.",
|
||||
"type": "string"
|
||||
},
|
||||
"imageName": {
|
||||
"description": "ImageName is the name of artifact",
|
||||
"type": "string"
|
||||
},
|
||||
"imageRepoTags": {
|
||||
"description": "image tags.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"imageSize": {
|
||||
"description": "The size in bytes of the image",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.S2iBuildSource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"binaryName": {
|
||||
"description": "Binary file Name",
|
||||
"type": "string"
|
||||
},
|
||||
"binarySize": {
|
||||
"description": "Binary file Size",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"builderImage": {
|
||||
"description": "// BuilderImage describes which image is used for building the result images.",
|
||||
"type": "string"
|
||||
},
|
||||
"commitID": {
|
||||
"description": "CommitID represents an arbitrary extended object reference in Git as SHA-1",
|
||||
"type": "string"
|
||||
},
|
||||
"committerEmail": {
|
||||
"description": "CommitterEmail contains the e-mail of the committer",
|
||||
"type": "string"
|
||||
},
|
||||
"committerName": {
|
||||
"description": "CommitterName contains the name of the committer",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description is a result image description label. The default is no description.",
|
||||
"type": "string"
|
||||
},
|
||||
"revisionId": {
|
||||
"description": "The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit",
|
||||
"type": "string"
|
||||
},
|
||||
"sourceUrl": {
|
||||
"description": "SourceURL is url of the codes such as https://github.com/a/b.git",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.S2iBuilder": {
|
||||
"description": "S2iBuilder is the Schema for the s2ibuilders API",
|
||||
"type": "object",
|
||||
@@ -5866,6 +5941,10 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"outputBuildResult": {
|
||||
"description": "Whether output build result to status.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"outputImageName": {
|
||||
"description": "OutputImageName is a result image name without tag, default is latest. tag will append to ImageName in the end",
|
||||
"type": "string"
|
||||
@@ -6064,10 +6143,6 @@
|
||||
"description": "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"
|
||||
},
|
||||
"imageName": {
|
||||
"description": "ImageName is the name of artifact",
|
||||
"type": "string"
|
||||
},
|
||||
"kubernetesJobName": {
|
||||
"description": "KubernetesJobName is the job name in k8s",
|
||||
"type": "string"
|
||||
@@ -6080,6 +6155,14 @@
|
||||
"description": "RunState indicates whether this job is done or failed",
|
||||
"type": "string"
|
||||
},
|
||||
"s2iBuildResult": {
|
||||
"description": "S2i build result info.",
|
||||
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.S2iBuildResult"
|
||||
},
|
||||
"s2iBuildSource": {
|
||||
"description": "S2i build source info.",
|
||||
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.S2iBuildSource"
|
||||
},
|
||||
"startTime": {
|
||||
"description": "StartTime represent when this run began",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"
|
||||
@@ -6126,6 +6209,7 @@
|
||||
},
|
||||
"io.k8s.api.core.v1.LocalObjectReference": {
|
||||
"description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
|
||||
@@ -6804,6 +6888,7 @@
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.runtime.RawExtension": {
|
||||
"description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"Raw"
|
||||
],
|
||||
|
||||
@@ -42,7 +42,6 @@ func init() {
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
|
||||
cfg, err := k8s.Config()
|
||||
if err != nil {
|
||||
klog.Error(err, "failed to build kubeconfig")
|
||||
|
||||
@@ -21,15 +21,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// Generate openapi for apis
|
||||
//go:generate go run ../../vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ../../vendor/k8s.io/api/core/v1,../../vendor/k8s.io/apimachinery/pkg/apis/meta/v1,../../vendor/k8s.io/apimachinery/pkg/api/resource,../../vendor/k8s.io/apimachinery/pkg/runtime,../../vendor/k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,./tenant/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1 -h ../../hack/boilerplate.go.txt --report-filename ../../api/api-rules/violation_exceptions.list
|
||||
//go:generate go run ../../vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ../../vendor/k8s.io/api/core/v1,../../vendor/k8s.io/apimachinery/pkg/apis/meta/v1,../../vendor/k8s.io/apimachinery/pkg/api/resource,../../vendor/k8s.io/apimachinery/pkg/runtime,../../vendor/k8s.io/apimachinery/pkg/util/intstr,../../vendor/github.com/knative/pkg/apis/istio/v1alpha3,k8s.io/apimachinery/pkg/version,./servicemesh/v1alpha2 -p kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2 -h ../../hack/boilerplate.go.txt --report-filename ../../api/api-rules/violation_exceptions.list
|
||||
//go:generate go run ../../vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ../../vendor/k8s.io/api/core/v1,../../vendor/k8s.io/apimachinery/pkg/apis/meta/v1,../../vendor/k8s.io/apimachinery/pkg/api/resource,../../vendor/k8s.io/api/networking/v1,../../vendor/k8s.io/apimachinery/pkg/runtime,../../vendor/k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,./network/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/network/v1alpha1 -h ../../hack/boilerplate.go.txt --report-filename ../../api/api-rules/violation_exceptions.list
|
||||
//go:generate go run ../../vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ../../vendor/k8s.io/api/core/v1,../../vendor/k8s.io/apimachinery/pkg/apis/meta/v1,../../vendor/k8s.io/apimachinery/pkg/api/resource,../../vendor/k8s.io/api/networking/v1,../../vendor/k8s.io/apimachinery/pkg/runtime,../../vendor/k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,./devops/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1 -h ../../hack/boilerplate.go.txt --report-filename ../../api/api-rules/violation_exceptions.list
|
||||
|
||||
// Generate deepcopy for apis
|
||||
|
||||
//go:generate ${GOPATH}/bin/deepcopy-gen -i kubesphere.io/kubesphere/pkg/apis/... -h ../../hack/boilerplate.go.txt -O zz_generated.deepcopy
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
var AddToSchemes runtime.SchemeBuilder
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -630,7 +630,7 @@ The last one is encrypted info, such as the password of the username-password ty
|
||||
Doc("Download S2iBinary file").
|
||||
Param(webservice.PathParameter("namespace", "the name of namespaces")).
|
||||
Param(webservice.PathParameter("s2ibinary", "the name of s2ibinary")).
|
||||
Param(webservice.PathParameter("file","the name of binary file")).
|
||||
Param(webservice.PathParameter("file", "the name of binary file")).
|
||||
Returns(http.StatusOK, RespOK, nil))
|
||||
|
||||
// TODO are not used in this version. will be added in 2.1.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user