本文整理汇总了Golang中k8s/io/kubernetes/pkg/api/validation.ValidateObjectMetaUpdate函数的典型用法代码示例。如果您正苦于以下问题:Golang ValidateObjectMetaUpdate函数的具体用法?Golang ValidateObjectMetaUpdate怎么用?Golang ValidateObjectMetaUpdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ValidateObjectMetaUpdate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ValidatePodSecurityPolicyUpdate
// ValidatePodSecurityPolicyUpdate validates a PSP for updates.
func ValidatePodSecurityPolicyUpdate(old *extensions.PodSecurityPolicy, new *extensions.PodSecurityPolicy) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&new.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))...)
allErrs = append(allErrs, ValidatePodSecurityPolicySpecificAnnotations(new.Annotations, field.NewPath("metadata").Child("annotations"))...)
allErrs = append(allErrs, ValidatePodSecurityPolicySpec(&new.Spec, field.NewPath("spec"))...)
return allErrs
}
开发者ID:maisem,项目名称:kubernetes,代码行数:8,代码来源:validation.go
示例2: ValidateImageStreamStatusUpdate
// ValidateImageStreamStatusUpdate tests required fields for an ImageStream status update.
func ValidateImageStreamStatusUpdate(newStream, oldStream *api.ImageStream) fielderrors.ValidationErrorList {
result := fielderrors.ValidationErrorList{}
result = append(result, validation.ValidateObjectMetaUpdate(&newStream.ObjectMeta, &oldStream.ObjectMeta).Prefix("metadata")...)
newStream.Spec.Tags = oldStream.Spec.Tags
newStream.Spec.DockerImageRepository = oldStream.Spec.DockerImageRepository
return result
}
开发者ID:dctse,项目名称:openshift-cucumber,代码行数:8,代码来源:validation.go
示例3: ValidateBuildConfigUpdate
func ValidateBuildConfigUpdate(config *buildapi.BuildConfig, older *buildapi.BuildConfig) fielderrors.ValidationErrorList {
allErrs := fielderrors.ValidationErrorList{}
allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(&config.ObjectMeta, &older.ObjectMeta).Prefix("metadata")...)
allErrs = append(allErrs, ValidateBuildConfig(config)...)
return allErrs
}
开发者ID:urashidmalik,项目名称:origin,代码行数:7,代码来源:validation.go
示例4: ValidateRouteUpdate
func ValidateRouteUpdate(route *routeapi.Route, older *routeapi.Route) fielderrors.ValidationErrorList {
allErrs := fielderrors.ValidationErrorList{}
allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(&route.ObjectMeta, &older.ObjectMeta).Prefix("metadata")...)
allErrs = append(allErrs, ValidateRoute(route)...)
return allErrs
}
开发者ID:dctse,项目名称:openshift-cucumber,代码行数:7,代码来源:validation.go
示例5: ValidateDaemonSetUpdate
// ValidateDaemonSetUpdate tests if required fields in the DaemonSet are set.
func ValidateDaemonSetUpdate(controller, oldController *extensions.DaemonSet) validation.ErrorList {
allErrs := validation.ErrorList{}
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...)
allErrs = append(allErrs, ValidateDaemonSetSpec(&controller.Spec).Prefix("spec")...)
allErrs = append(allErrs, ValidateDaemonSetTemplateUpdate(controller.Spec.Template, oldController.Spec.Template).Prefix("spec.template")...)
return allErrs
}
开发者ID:kimsh92,项目名称:kubernetes,代码行数:8,代码来源:validation.go
示例6: ValidateDaemonSetUpdate
// ValidateDaemonSetUpdate tests if required fields in the DaemonSet are set.
func ValidateDaemonSetUpdate(oldController, controller *experimental.DaemonSet) errs.ValidationErrorList {
allErrs := errs.ValidationErrorList{}
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...)
allErrs = append(allErrs, ValidateDaemonSetSpec(&controller.Spec).Prefix("spec")...)
allErrs = append(allErrs, ValidateDaemonSetTemplateUpdate(oldController.Spec.Template, controller.Spec.Template).Prefix("spec.template")...)
return allErrs
}
开发者ID:liuhewei,项目名称:kubernetes,代码行数:8,代码来源:validation.go
示例7: ValidateReplicaSetStatusUpdate
// ValidateReplicaSetStatusUpdate tests if required fields in the ReplicaSet are set.
func ValidateReplicaSetStatusUpdate(rs, oldRs *extensions.ReplicaSet) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&rs.ObjectMeta, &oldRs.ObjectMeta, field.NewPath("metadata"))...)
allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(rs.Status.Replicas), field.NewPath("status", "replicas"))...)
allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(rs.Status.ObservedGeneration), field.NewPath("status", "observedGeneration"))...)
return allErrs
}
开发者ID:richm,项目名称:origin,代码行数:8,代码来源:validation.go
示例8: ValidateConfigMapUpdate
// ValidateConfigMapUpdate tests if required fields in the ConfigMap are set.
func ValidateConfigMapUpdate(newCfg, oldCfg *extensions.ConfigMap) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&newCfg.ObjectMeta, &oldCfg.ObjectMeta, field.NewPath("metadata"))...)
allErrs = append(allErrs, ValidateConfigMap(newCfg)...)
return allErrs
}
开发者ID:MisaKondo,项目名称:kubernetes,代码行数:8,代码来源:validation.go
示例9: ValidateRouteUpdate
func ValidateRouteUpdate(route *routeapi.Route, older *routeapi.Route) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&route.ObjectMeta, &older.ObjectMeta, field.NewPath("metadata"))
allErrs = append(allErrs, validation.ValidateImmutableField(route.Spec.Host, older.Spec.Host, field.NewPath("spec", "host"))...)
allErrs = append(allErrs, validation.ValidateImmutableField(route.Spec.WildcardPolicy, older.Spec.WildcardPolicy, field.NewPath("spec", "wildcardPolicy"))...)
allErrs = append(allErrs, ValidateRoute(route)...)
return allErrs
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:7,代码来源:validation.go
示例10: ValidateHorizontalPodAutoscalerStatusUpdate
func ValidateHorizontalPodAutoscalerStatusUpdate(controller, oldController *extensions.HorizontalPodAutoscaler) field.ErrorList {
allErrs := apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta, field.NewPath("metadata"))
status := controller.Status
allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.CurrentReplicas), field.NewPath("status", "currentReplicas"))...)
allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.DesiredReplicas), field.NewPath("status", "desiredReplicasa"))...)
return allErrs
}
开发者ID:MisaKondo,项目名称:kubernetes,代码行数:7,代码来源:validation.go
示例11: ValidateImageStreamUpdate
func ValidateImageStreamUpdate(newStream, oldStream *api.ImageStream) fielderrors.ValidationErrorList {
result := fielderrors.ValidationErrorList{}
result = append(result, validation.ValidateObjectMetaUpdate(&newStream.ObjectMeta, &oldStream.ObjectMeta).Prefix("metadata")...)
result = append(result, ValidateImageStream(newStream)...)
return result
}
开发者ID:dctse,项目名称:openshift-cucumber,代码行数:8,代码来源:validation.go
示例12: ValidateRoleBindingRestrictionUpdate
func ValidateRoleBindingRestrictionUpdate(rbr, old *authorizationapi.RoleBindingRestriction) field.ErrorList {
allErrs := ValidateRoleBindingRestriction(rbr)
allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(&rbr.ObjectMeta,
&old.ObjectMeta, field.NewPath("metadata"))...)
return allErrs
}
开发者ID:php-coder,项目名称:origin,代码行数:8,代码来源:validation.go
示例13: ValidateImageUpdate
func ValidateImageUpdate(newImage, oldImage *api.Image) fielderrors.ValidationErrorList {
result := fielderrors.ValidationErrorList{}
result = append(result, validation.ValidateObjectMetaUpdate(&newImage.ObjectMeta, &oldImage.ObjectMeta).Prefix("metadata")...)
result = append(result, ValidateImage(newImage)...)
return result
}
开发者ID:ncantor,项目名称:origin,代码行数:8,代码来源:validation.go
示例14: ValidateNetworkPolicyUpdate
// ValidateNetworkPolicyUpdate tests if an update to a NetworkPolicy is valid.
func ValidateNetworkPolicyUpdate(update, old *extensions.NetworkPolicy) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&update.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))...)
if !reflect.DeepEqual(update.Spec, old.Spec) {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to networkpolicy spec are forbidden."))
}
return allErrs
}
开发者ID:maisem,项目名称:kubernetes,代码行数:9,代码来源:validation.go
示例15: ValidateServiceBrokerUpdate
// ValidateServiceBrokerUpdate tests to make sure a servicebroker update can be applied. Modifies newServiceBroker with immutable fields.
func ValidateServiceBrokerUpdate(newServiceBroker *servicebrokerapi.ServiceBroker, oldServiceBroker *servicebrokerapi.ServiceBroker) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&newServiceBroker.ObjectMeta, &oldServiceBroker.ObjectMeta, field.NewPath("metadata"))
allErrs = append(allErrs, ValidateServiceBroker(newServiceBroker)...)
return allErrs
}
开发者ID:asiainfoLDP,项目名称:datafactory,代码行数:9,代码来源:validation.go
示例16: ValidateClientUpdate
func ValidateClientUpdate(client *api.OAuthClient, oldClient *api.OAuthClient) fielderrors.ValidationErrorList {
allErrs := fielderrors.ValidationErrorList{}
allErrs = append(allErrs, ValidateClient(client)...)
allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(&client.ObjectMeta, &oldClient.ObjectMeta).Prefix("metadata")...)
return allErrs
}
开发者ID:johnmccawley,项目名称:origin,代码行数:8,代码来源:validation.go
示例17: ValidateClusterUpdate
func ValidateClusterUpdate(cluster, oldCluster *federation.Cluster) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&cluster.ObjectMeta, &oldCluster.ObjectMeta, field.NewPath("metadata"))
if cluster.Name != oldCluster.Name {
allErrs = append(allErrs, field.Invalid(field.NewPath("meta", "name"),
cluster.Name+" != "+oldCluster.Name, "cannot change cluster name"))
}
return allErrs
}
开发者ID:CodeJuan,项目名称:kubernetes,代码行数:8,代码来源:validation.go
示例18: ValidateNetNamespaceUpdate
func ValidateNetNamespaceUpdate(obj *sdnapi.NetNamespace, old *sdnapi.NetNamespace) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&obj.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))
if err := sdnapi.ValidVNID(obj.NetID); err != nil {
allErrs = append(allErrs, field.Invalid(field.NewPath("netID"), obj.NetID, err.Error()))
}
return allErrs
}
开发者ID:abhgupta,项目名称:origin,代码行数:8,代码来源:validation.go
示例19: ValidateClientUpdate
func ValidateClientUpdate(client *api.OAuthClient, oldClient *api.OAuthClient) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = append(allErrs, ValidateClient(client)...)
allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(&client.ObjectMeta, &oldClient.ObjectMeta, field.NewPath("metadata"))...)
return allErrs
}
开发者ID:xgwang-zte,项目名称:origin,代码行数:8,代码来源:validation.go
示例20: ValidateBackingServiceUpdate
// ValidateBuildRequest validates a BuildRequest object
func ValidateBackingServiceUpdate(bs *backingserviceapi.BackingService, older *backingserviceapi.BackingService) field.ErrorList {
allErrs := validation.ValidateObjectMetaUpdate(&bs.ObjectMeta, &older.ObjectMeta, field.NewPath("metadata"))
allErrs = append(allErrs, ValidateBackingService(bs)...)
return allErrs
}
开发者ID:asiainfoLDP,项目名称:datafactory,代码行数:9,代码来源:validation.go
注:本文中的k8s/io/kubernetes/pkg/api/validation.ValidateObjectMetaUpdate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论