本文整理汇总了Golang中github.com/openshift/origin/pkg/authorization/api.ClusterPolicy类的典型用法代码示例。如果您正苦于以下问题:Golang ClusterPolicy类的具体用法?Golang ClusterPolicy怎么用?Golang ClusterPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ClusterPolicy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: autoConvert_v1_ClusterPolicy_To_api_ClusterPolicy
func autoConvert_v1_ClusterPolicy_To_api_ClusterPolicy(in *ClusterPolicy, out *api.ClusterPolicy, s conversion.Scope) error {
if err := api_v1.Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.LastModified = in.LastModified
if err := Convert_v1_NamedClusterRoles_To_api_ClusterRolesByName(&in.Roles, &out.Roles, s); err != nil {
return err
}
return nil
}
开发者ID:xgwang-zte,项目名称:origin,代码行数:10,代码来源:zz_generated.conversion.go
示例2: addClusterPolicy
func addClusterPolicy(policies map[string]map[string]authorizationapi.ClusterPolicy, policy authorizationapi.ClusterPolicy) {
resourceVersion += 1
policy.ResourceVersion = fmt.Sprintf("%d", resourceVersion)
namespacedClusterPolicies, ok := policies[policy.Namespace]
if !ok {
namespacedClusterPolicies = make(map[string]authorizationapi.ClusterPolicy)
policies[policy.Namespace] = namespacedClusterPolicies
}
namespacedClusterPolicies[policy.Name] = policy
}
开发者ID:Xmagicer,项目名称:origin,代码行数:12,代码来源:clusterpolicy.go
示例3: convert_v1_ClusterPolicy_To_api_ClusterPolicy
// and now the globals
func convert_v1_ClusterPolicy_To_api_ClusterPolicy(in *ClusterPolicy, out *newer.ClusterPolicy, s conversion.Scope) error {
out.LastModified = in.LastModified
out.Roles = make(map[string]*newer.ClusterRole)
return s.DefaultConvert(in, out, conversion.IgnoreMissingFields)
}
开发者ID:ncantor,项目名称:origin,代码行数:6,代码来源:conversion.go
注:本文中的github.com/openshift/origin/pkg/authorization/api.ClusterPolicy类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论