k8s/io/kubernetes/pkg/api/validation.ValidatePodTemplateSpec 示例代码

2022-03-03

以下示例是关于golang中包含validation.ValidatePodTemplateSpec用法的示例代码,想了解validation.ValidatePodTemplateSpec的具体用法?validation.ValidatePodTemplateSpec怎么用?validation.ValidatePodTemplateSpec使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
validation.go开发语言: Go项目名称: kubernetes代码行数: 938
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例2:
validation.go开发语言: Go项目名称: amygdala代码行数: 854
204
205	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
206	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
467
468	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
469	if spec.Template.Spec.RestartPolicy != api.RestartPolicyOnFailure &&
730		}
731		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
732		if replicas > 1 {
示例3:
validation.go开发语言: Go项目名称: abhgupta代码行数: 922
122
123	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
124	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
612		}
613		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
614		if replicas > 1 {
示例4:
validation.go开发语言: Go项目名称: ddysher代码行数: 948
121
122	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
123	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
624		}
625		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
626		if replicas > 1 {
示例5:
validation.go开发语言: Go项目名称: detiber代码行数: 1005
170
171	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
172	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
681		}
682		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
683		if replicas > 1 {
示例6:
validation.go开发语言: Go项目名称: bparees代码行数: 687
61		// volume mounts in the containers.
62		// allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
63		allErrs = append(allErrs, unversionedvalidation.ValidateLabels(template.Labels, fldPath.Child("labels"))...)
322
323	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
324	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
673		}
674		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
675		if replicas > 1 {
示例7:
validation.go开发语言: Go项目名称: byxorna代码行数: 687
61		// volume mounts in the containers.
62		// allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
63		allErrs = append(allErrs, unversionedvalidation.ValidateLabels(template.Labels, fldPath.Child("labels"))...)
322
323	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
324	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
673		}
674		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
675		if replicas > 1 {
示例8:
validation.go开发语言: Go项目名称: csrwng代码行数: 671
61		// volume mounts in the containers.
62		// allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
63		allErrs = append(allErrs, unversionedvalidation.ValidateLabels(template.Labels, fldPath.Child("labels"))...)
321
322	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
323	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
657		}
658		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
659		if replicas > 1 {
示例9:
validation.go开发语言: Go项目名称: cjcullen代码行数: 839
131
132	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
133	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
541		}
542		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
543		if replicas > 1 {
示例10:
validation.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 825
129
130	allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...)
131	// Daemons typically run on more than one node, so mark Read-Write persistent disks as invalid.
533		}
534		allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
535		if replicas > 1 {

本文地址:https://www.itbaoku.cn/snippets/415902.html