mirror of
https://github.com/rancher/types.git
synced 2025-09-25 12:21:24 +00:00
Adding ProjectNetworkPolicy type
This commit is contained in:
committed by
Darren Shepherd
parent
1815a97836
commit
1d7c5be407
23
apis/management.cattle.io/v3/network_policy_types.go
Normal file
23
apis/management.cattle.io/v3/network_policy_types.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type ProjectNetworkPolicySpec struct {
|
||||
ProjectName string `json:"projectName,omitempty" norman:"required,type=reference[project]"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type ProjectNetworkPolicyStatus struct {
|
||||
}
|
||||
|
||||
type ProjectNetworkPolicy struct {
|
||||
types.Namespaced
|
||||
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ProjectNetworkPolicySpec `json:"spec"`
|
||||
Status *ProjectNetworkPolicyStatus `json:"status"`
|
||||
}
|
@@ -29,6 +29,7 @@ var (
|
||||
Init(tokens).
|
||||
Init(schemaTypes).
|
||||
Init(userTypes).
|
||||
Init(projectNetworkPolicyTypes).
|
||||
Init(logTypes).
|
||||
Init(globalTypes).
|
||||
Init(rkeTypes).
|
||||
@@ -263,6 +264,14 @@ func userTypes(schema *types.Schemas) *types.Schemas {
|
||||
})
|
||||
}
|
||||
|
||||
func projectNetworkPolicyTypes(schema *types.Schemas) *types.Schemas {
|
||||
return schema.
|
||||
MustImportAndCustomize(&Version, v3.ProjectNetworkPolicy{}, func(schema *types.Schema) {
|
||||
schema.CollectionMethods = []string{http.MethodGet}
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
})
|
||||
}
|
||||
|
||||
func logTypes(schema *types.Schemas) *types.Schemas {
|
||||
return schema.
|
||||
AddMapperForType(&Version, &v3.ClusterLogging{},
|
||||
|
Reference in New Issue
Block a user