Documentation ¶
Index ¶
- Constants
- Variables
- func ComparableToGroup(group Comparable) *model.Group
- func ComparableToGroups(groups []Comparable) []model.Group
- func ComparableToRule(rule Comparable) *model.Rule
- func ComparableToRules(rules []Comparable) []model.Rule
- func ComparableToSecurityPolicy(sp Comparable) *model.SecurityPolicy
- func ComparableToShare(share Comparable) *model.Share
- func ComparableToShares(shares []Comparable) []model.Share
- type Comparable
- func GroupsPtrToComparable(groups []*model.Group) []Comparable
- func GroupsToComparable(groups []model.Group) []Comparable
- func RulesPtrToComparable(rules []*model.Rule) []Comparable
- func RulesToComparable(rules []model.Rule) []Comparable
- func SecurityPolicyPtrToComparable(sp *model.SecurityPolicy) Comparable
- func SecurityPolicyToComparable(sp model.SecurityPolicy) Comparable
- func SharesPtrToComparable(shares []*model.Share) []Comparable
- func SharesToComparable(shares []model.Share) []Comparable
- type Group
- type GroupStore
- type ProjectShare
- type Rule
- type RuleStore
- type SecurityPolicy
- type SecurityPolicyService
- func (service *SecurityPolicyService) BuildNetworkPolicyAllowPolicyID(uid string) string
- func (service *SecurityPolicyService) BuildNetworkPolicyAllowPolicyName(uid string) string
- func (service *SecurityPolicyService) BuildNetworkPolicyIsolationPolicyID(uid string) string
- func (service *SecurityPolicyService) BuildNetworkPolicyIsolationPolicyName(uid string) string
- func (service *SecurityPolicyService) Cleanup(ctx context.Context) error
- func (service *SecurityPolicyService) CreateOrUpdateSecurityPolicy(obj interface{}) error
- func (service *SecurityPolicyService) DeleteSecurityPolicy(obj interface{}, isVpcCleanup bool, createdFor string) error
- func (service *SecurityPolicyService) ListNetworkPolicyID() sets.Set[string]
- func (service *SecurityPolicyService) ListSecurityPolicyID() sets.Set[string]
- func (service *SecurityPolicyService) ResolveNamespace(lbs *meta1.LabelSelector) (*v1.NamespaceList, error)
- func (service *SecurityPolicyService) WrapHierarchySecurityPolicy(sp *model.SecurityPolicy, gs []model.Group) (*model.Infra, error)
- func (service *SecurityPolicyService) WrapHierarchyVpcSecurityPolicy(sp *model.SecurityPolicy, gs []model.Group, ...) (*model.OrgRoot, error)
- type SecurityPolicyStore
- type Share
- type ShareStore
Constants ¶
Variables ¶
var ( String = common.String Int64 = common.Int64 )
var ( MarkedForDelete = true EnforceRevisionCheckParam = false ResourceTypeSecurityPolicy = common.ResourceTypeSecurityPolicy ResourceTypeRule = common.ResourceTypeRule ResourceTypeGroup = common.ResourceTypeGroup NewConverter = common.NewConverter )
Functions ¶
func ComparableToGroup ¶
func ComparableToGroup(group Comparable) *model.Group
func ComparableToGroups ¶
func ComparableToGroups(groups []Comparable) []model.Group
func ComparableToRule ¶
func ComparableToRule(rule Comparable) *model.Rule
func ComparableToRules ¶
func ComparableToRules(rules []Comparable) []model.Rule
func ComparableToSecurityPolicy ¶
func ComparableToSecurityPolicy(sp Comparable) *model.SecurityPolicy
func ComparableToShare ¶
func ComparableToShare(share Comparable) *model.Share
func ComparableToShares ¶
func ComparableToShares(shares []Comparable) []model.Share
Types ¶
type Comparable ¶
type Comparable = common.Comparable
func GroupsPtrToComparable ¶
func GroupsPtrToComparable(groups []*model.Group) []Comparable
func GroupsToComparable ¶
func GroupsToComparable(groups []model.Group) []Comparable
func RulesPtrToComparable ¶
func RulesPtrToComparable(rules []*model.Rule) []Comparable
func RulesToComparable ¶
func RulesToComparable(rules []model.Rule) []Comparable
func SecurityPolicyPtrToComparable ¶
func SecurityPolicyPtrToComparable(sp *model.SecurityPolicy) Comparable
func SecurityPolicyToComparable ¶
func SecurityPolicyToComparable(sp model.SecurityPolicy) Comparable
func SharesPtrToComparable ¶
func SharesPtrToComparable(shares []*model.Share) []Comparable
func SharesToComparable ¶
func SharesToComparable(shares []model.Share) []Comparable
type GroupStore ¶
type GroupStore struct {
common.ResourceStore
}
GroupStore is a store for groups referenced by security policy or rule
func (*GroupStore) Apply ¶
func (groupStore *GroupStore) Apply(i interface{}) error
func (*GroupStore) GetByIndex ¶
func (groupStore *GroupStore) GetByIndex(key string, value string) []*model.Group
type ProjectShare ¶
type ProjectShare struct {
// contains filtered or unexported fields
}
type RuleStore ¶
type RuleStore struct {
common.ResourceStore
}
RuleStore is a store for rules of security policy
type SecurityPolicy ¶
type SecurityPolicy model.SecurityPolicy
func (*SecurityPolicy) Key ¶
func (sp *SecurityPolicy) Key() string
func (*SecurityPolicy) Value ¶
func (sp *SecurityPolicy) Value() data.DataValue
type SecurityPolicyService ¶
func GetSecurityService ¶
func GetSecurityService(service common.Service, vpcService common.VPCServiceProvider) *SecurityPolicyService
GetSecurityService get singleton SecurityPolicyService instance, networkpolicy/securitypolicy controller share the same instance.
func InitializeSecurityPolicy ¶
func InitializeSecurityPolicy(service common.Service, vpcService common.VPCServiceProvider) (*SecurityPolicyService, error)
InitializeSecurityPolicy sync NSX resources
func (*SecurityPolicyService) BuildNetworkPolicyAllowPolicyID ¶
func (service *SecurityPolicyService) BuildNetworkPolicyAllowPolicyID(uid string) string
func (*SecurityPolicyService) BuildNetworkPolicyAllowPolicyName ¶
func (service *SecurityPolicyService) BuildNetworkPolicyAllowPolicyName(uid string) string
func (*SecurityPolicyService) BuildNetworkPolicyIsolationPolicyID ¶
func (service *SecurityPolicyService) BuildNetworkPolicyIsolationPolicyID(uid string) string
func (*SecurityPolicyService) BuildNetworkPolicyIsolationPolicyName ¶
func (service *SecurityPolicyService) BuildNetworkPolicyIsolationPolicyName(uid string) string
func (*SecurityPolicyService) Cleanup ¶
func (service *SecurityPolicyService) Cleanup(ctx context.Context) error
func (*SecurityPolicyService) CreateOrUpdateSecurityPolicy ¶
func (service *SecurityPolicyService) CreateOrUpdateSecurityPolicy(obj interface{}) error
func (*SecurityPolicyService) DeleteSecurityPolicy ¶
func (service *SecurityPolicyService) DeleteSecurityPolicy(obj interface{}, isVpcCleanup bool, createdFor string) error
func (*SecurityPolicyService) ListNetworkPolicyID ¶
func (service *SecurityPolicyService) ListNetworkPolicyID() sets.Set[string]
func (*SecurityPolicyService) ListSecurityPolicyID ¶
func (service *SecurityPolicyService) ListSecurityPolicyID() sets.Set[string]
func (*SecurityPolicyService) ResolveNamespace ¶
func (service *SecurityPolicyService) ResolveNamespace(lbs *meta1.LabelSelector) (*v1.NamespaceList, error)
ResolveNamespace Get namespace name when the rule has namespace selector.
func (*SecurityPolicyService) WrapHierarchySecurityPolicy ¶
func (service *SecurityPolicyService) WrapHierarchySecurityPolicy(sp *model.SecurityPolicy, gs []model.Group) (*model.Infra, error)
WrapHierarchySecurityPolicy wrap the security policy with groups and rules into a hierarchy security policy for InfraClient to patch.
func (*SecurityPolicyService) WrapHierarchyVpcSecurityPolicy ¶
func (service *SecurityPolicyService) WrapHierarchyVpcSecurityPolicy(sp *model.SecurityPolicy, gs []model.Group, projectInfraChildren []*data.StructValue, vpcInfo *common.VPCResourceInfo, ) (*model.OrgRoot, error)
WrapHierarchyVpcSecurityPolicy wrap the security policy with groups and rules in VPC level and associated project infra children including project shares and groups into one hierarchy resource tree for OrgRootClient to patch.
type SecurityPolicyStore ¶
type SecurityPolicyStore struct {
common.ResourceStore
}
SecurityPolicyStore is a store for security policy
func (*SecurityPolicyStore) Apply ¶
func (securityPolicyStore *SecurityPolicyStore) Apply(i interface{}) error
func (*SecurityPolicyStore) GetByIndex ¶
func (securityPolicyStore *SecurityPolicyStore) GetByIndex(key string, value string) []*model.SecurityPolicy
func (*SecurityPolicyStore) GetByKey ¶
func (securityPolicyStore *SecurityPolicyStore) GetByKey(key string) *model.SecurityPolicy
type ShareStore ¶
type ShareStore struct {
}ShareStore is a store for project shares referenced by security policy rule
func (*ShareStore) Apply ¶
func (shareStore *ShareStore) Apply(i interface{}) error
func (*ShareStore) GetByIndex ¶
func (shareStore *ShareStore) GetByIndex(key string, value string) []*model.Share