未验证 提交 f8d3b227 编写于 作者: R runzexia

add network crd doc gen

Signed-off-by: Nrunzexia <runzexia@yunify.com>
上级 34ddd349
......@@ -44,24 +44,4 @@ 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/servicemesh/v1alpha2,DestinationRuleSpecTemplate,ObjectMeta
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyCondition,LastProbeTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyCondition,LastTransitionTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyCondition,Message
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyCondition,Reason
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyCondition,Status
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyCondition,Type
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyStatus,CompletionTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyStatus,Conditions
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,ServicePolicyStatus,StartTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyCondition,LastProbeTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyCondition,LastTransitionTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyCondition,Message
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyCondition,Reason
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyCondition,Status
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyCondition,Type
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategySpec,GovernorVersion
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategySpec,PrincipalVersion
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyStatus,CompletionTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyStatus,Conditions
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2,StrategyStatus,StartTime
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/network/v1alpha1,WorkspaceNetworkPolicyEgressRule,To
此差异已折叠。
......@@ -24,6 +24,7 @@ import (
// 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
// AddToSchemes may be used to add all resources defined in the project to a Scheme
var AddToSchemes runtime.SchemeBuilder
......
package crdinstall
import (
k8sruntime "k8s.io/apimachinery/pkg/runtime"
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
)
func Install(scheme *k8sruntime.Scheme) {
urlruntime.Must(networkv1alpha1.AddToScheme(scheme))
urlruntime.Must(scheme.SetVersionPriority(networkv1alpha1.SchemeGroupVersion))
}
此差异已折叠。
......@@ -21,6 +21,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
ResourceKindWorkspaceNetworkPolicy = "WorkspaceNetworkPolicy"
ResourceSingularWorkspaceNetworkPolicy = "workspacenetworkpolicy"
ResourcePluralWorkspaceNetworkPolicy = "workspacenetworkpolicies"
)
// WorkspaceNetworkPolicySpec defines the desired state of WorkspaceNetworkPolicy
type WorkspaceNetworkPolicySpec struct {
// Workspace specify the name of ws to apply this workspace network policy
......
......@@ -27,7 +27,7 @@ import (
const (
ResourceKindStrategy = "Strategy"
ResourceSingularStrategy = "strategy"
ResourceSingularStrategy = "strategy"
ResourcePluralStrategy = "strategies"
)
......
......@@ -17,6 +17,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kube-openapi/pkg/common"
networkinstall "kubesphere.io/kubesphere/pkg/apis/network/crdinstall"
networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
servicemeshinstall "kubesphere.io/kubesphere/pkg/apis/servicemesh/crdinstall"
tenantinstall "kubesphere.io/kubesphere/pkg/apis/tenant/crdinstall"
tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1"
......@@ -42,6 +44,7 @@ func main() {
servicemeshinstall.Install(Scheme)
tenantinstall.Install(Scheme)
networkinstall.Install(Scheme)
mapper := meta.NewDefaultRESTMapper(nil)
......@@ -69,6 +72,10 @@ func main() {
s2iv1alpha1.SchemeGroupVersion.WithResource(s2iv1alpha1.ResourcePluralS2iRun),
s2iv1alpha1.SchemeGroupVersion.WithResource(s2iv1alpha1.ResourceSingularS2iRun), meta.RESTScopeRoot)
mapper.AddSpecific(networkv1alpha1.SchemeGroupVersion.WithKind(networkv1alpha1.ResourceKindWorkspaceNetworkPolicy),
networkv1alpha1.SchemeGroupVersion.WithResource(networkv1alpha1.ResourcePluralWorkspaceNetworkPolicy),
networkv1alpha1.SchemeGroupVersion.WithResource(networkv1alpha1.ResourceSingularWorkspaceNetworkPolicy), meta.RESTScopeRoot)
spec, err := lib.RenderOpenAPISpec(lib.Config{
Scheme: Scheme,
Codecs: Codecs,
......@@ -89,6 +96,7 @@ func main() {
servicemeshv1alpha2.GetOpenAPIDefinitions,
tenantv1alpha1.GetOpenAPIDefinitions,
s2iv1alpha1.GetOpenAPIDefinitions,
networkv1alpha1.GetOpenAPIDefinitions,
},
Resources: []schema.GroupVersionResource{
//TODO(runzexia) At present, the document generation requires the openapi structure of the go language,
......@@ -100,6 +108,7 @@ func main() {
s2iv1alpha1.SchemeGroupVersion.WithResource(s2iv1alpha1.ResourcePluralS2iRun),
s2iv1alpha1.SchemeGroupVersion.WithResource(s2iv1alpha1.ResourcePluralS2iBuilderTemplate),
s2iv1alpha1.SchemeGroupVersion.WithResource(s2iv1alpha1.ResourcePluralS2iBuilder),
networkv1alpha1.SchemeGroupVersion.WithResource(networkv1alpha1.ResourcePluralWorkspaceNetworkPolicy),
},
Mapper: mapper,
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册