k8s/io/kubernetes/pkg/api.DownwardAPIVolumeFile 示例代码

2022-03-03

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

示例1:
downwardapi_test.go开发语言: Go项目名称: amygdala代码行数: 691
114			DownwardAPI: &api.DownwardAPIVolumeSource{
115				Items: []api.DownwardAPIVolumeFile{
116					{Path: "labels", FieldRef: api.ObjectFieldSelector{
178			DownwardAPI: &api.DownwardAPIVolumeSource{
179				Items: []api.DownwardAPIVolumeFile{
180					{Path: "annotations", FieldRef: api.ObjectFieldSelector{
241			DownwardAPI: &api.DownwardAPIVolumeSource{
242				Items: []api.DownwardAPIVolumeFile{
243					{Path: "name_file_name", FieldRef: api.ObjectFieldSelector{
304			DownwardAPI: &api.DownwardAPIVolumeSource{
305				Items: []api.DownwardAPIVolumeFile{
306					{Path: "namespace_file_name", FieldRef: api.ObjectFieldSelector{
382			DownwardAPI: &api.DownwardAPIVolumeSource{
383				Items: []api.DownwardAPIVolumeFile{
384					{Path: "labels", FieldRef: api.ObjectFieldSelector{
示例2:
conversion_generated.go开发语言: Go项目名称: amygdala代码行数: 6785
576
577func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error {
578	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
579		defaulting.(func(*api.DownwardAPIVolumeFile))(in)
580	}
587
588func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error {
589	return autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in, out, s)
3880
3881func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
3882	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
3891
3892func Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
3893	return autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in, out, s)
示例3:
validation_test.go开发语言: Go项目名称: amygdala代码行数: 5291
567		{Name: "cephfs", VolumeSource: api.VolumeSource{CephFS: &api.CephFSVolumeSource{Monitors: []string{"foo"}}}},
568		{Name: "downwardapi", VolumeSource: api.VolumeSource{DownwardAPI: &api.DownwardAPIVolumeSource{Items: []api.DownwardAPIVolumeFile{
569			{Path: "labels", FieldRef: api.ObjectFieldSelector{
616	absPath := api.VolumeSource{GitRepo: &api.GitRepoVolumeSource{Repository: "foo", Directory: "/abstarget"}}
617	emptyPathName := api.VolumeSource{DownwardAPI: &api.DownwardAPIVolumeSource{Items: []api.DownwardAPIVolumeFile{{Path: "",
618		FieldRef: api.ObjectFieldSelector{
621	}}
622	absolutePathName := api.VolumeSource{DownwardAPI: &api.DownwardAPIVolumeSource{Items: []api.DownwardAPIVolumeFile{{Path: "/absolutepath",
623		FieldRef: api.ObjectFieldSelector{
626	}}
627	dotDotInPath := api.VolumeSource{DownwardAPI: &api.DownwardAPIVolumeSource{Items: []api.DownwardAPIVolumeFile{{Path: "../../passwd",
628		FieldRef: api.ObjectFieldSelector{
631	}}
632	dotDotPathName := api.VolumeSource{DownwardAPI: &api.DownwardAPIVolumeSource{Items: []api.DownwardAPIVolumeFile{{Path: "..badFileName",
633		FieldRef: api.ObjectFieldSelector{
示例4:
conversion_generated.go开发语言: Go项目名称: amygdala代码行数: 3065
292
293func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *v1.DownwardAPIVolumeFile, s conversion.Scope) error {
294	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
295		defaulting.(func(*api.DownwardAPIVolumeFile))(in)
296	}
303
304func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *v1.DownwardAPIVolumeFile, s conversion.Scope) error {
305	return autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in, out, s)
1590
1591func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *v1.DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
1592	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
1601
1602func Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *v1.DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
1603	return autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in, out, s)
示例5:
conversion_generated.go开发语言: Go项目名称: amygdala代码行数: 5330
292
293func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *v1.DownwardAPIVolumeFile, s conversion.Scope) error {
294	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
295		defaulting.(func(*api.DownwardAPIVolumeFile))(in)
296	}
303
304func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *v1.DownwardAPIVolumeFile, s conversion.Scope) error {
305	return autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in, out, s)
1652
1653func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *v1.DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
1654	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
1663
1664func Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *v1.DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
1665	return autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in, out, s)
示例6:
zz_generated.conversion.go开发语言: Go项目名称: cjcullen代码行数: 4348
1016
1017func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
1018	out.Path = in.Path
1024
1025func Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
1026	return autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in, out, s)
1028
1029func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error {
1030	out.Path = in.Path
1036
1037func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error {
1038	return autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in, out, s)
1041func autoConvert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *DownwardAPIVolumeSource, out *api.DownwardAPIVolumeSource, s conversion.Scope) error {
1042	out.Items = *(*[]api.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items))
1043	out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode))
示例7:
downwardapi_test.go开发语言: Go项目名称: cjcullen代码行数: 837
111				DefaultMode: &defaultMode,
112				Items: []api.DownwardAPIVolumeFile{
113					{Path: "labels", FieldRef: &api.ObjectFieldSelector{
177				DefaultMode: &defaultMode,
178				Items: []api.DownwardAPIVolumeFile{
179					{Path: "annotations", FieldRef: &api.ObjectFieldSelector{
242				DefaultMode: &defaultMode,
243				Items: []api.DownwardAPIVolumeFile{
244					{Path: "name_file_name", FieldRef: &api.ObjectFieldSelector{
307				DefaultMode: &defaultMode,
308				Items: []api.DownwardAPIVolumeFile{
309					{Path: "namespace_file_name", FieldRef: &api.ObjectFieldSelector{
387				DefaultMode: &defaultMode,
388				Items: []api.DownwardAPIVolumeFile{
389					{Path: "labels", FieldRef: &api.ObjectFieldSelector{
示例8:
downwardapi_test.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 837
111				DefaultMode: &defaultMode,
112				Items: []api.DownwardAPIVolumeFile{
113					{Path: "labels", FieldRef: &api.ObjectFieldSelector{
177				DefaultMode: &defaultMode,
178				Items: []api.DownwardAPIVolumeFile{
179					{Path: "annotations", FieldRef: &api.ObjectFieldSelector{
242				DefaultMode: &defaultMode,
243				Items: []api.DownwardAPIVolumeFile{
244					{Path: "name_file_name", FieldRef: &api.ObjectFieldSelector{
307				DefaultMode: &defaultMode,
308				Items: []api.DownwardAPIVolumeFile{
309					{Path: "namespace_file_name", FieldRef: &api.ObjectFieldSelector{
387				DefaultMode: &defaultMode,
388				Items: []api.DownwardAPIVolumeFile{
389					{Path: "labels", FieldRef: &api.ObjectFieldSelector{
示例9:
validation_test.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 7787
1584					DownwardAPI: &api.DownwardAPIVolumeSource{
1585						Items: []api.DownwardAPIVolumeFile{
1586							{
1691					DownwardAPI: &api.DownwardAPIVolumeSource{
1692						Items: []api.DownwardAPIVolumeFile{{
1693							Mode: newInt32(0644),
1709					DownwardAPI: &api.DownwardAPIVolumeSource{
1710						Items: []api.DownwardAPIVolumeFile{{
1711							Mode: newInt32(01000),
1729					DownwardAPI: &api.DownwardAPIVolumeSource{
1730						Items: []api.DownwardAPIVolumeFile{{
1731							Mode: newInt32(-1),
1749					DownwardAPI: &api.DownwardAPIVolumeSource{
1750						Items: []api.DownwardAPIVolumeFile{{
1751							Path: "",
示例10:
downwardapi_volume.go开发语言: Go项目名称: amygdala代码行数: 233
190						DownwardAPI: &api.DownwardAPIVolumeSource{
191							Items: []api.DownwardAPIVolumeFile{
192								{
212	if len(labels) > 0 {
213		pod.Spec.Volumes[0].DownwardAPI.Items = append(pod.Spec.Volumes[0].DownwardAPI.Items, api.DownwardAPIVolumeFile{
214			Path: "labels",
222	if len(annotations) > 0 {
223		pod.Spec.Volumes[0].DownwardAPI.Items = append(pod.Spec.Volumes[0].DownwardAPI.Items, api.DownwardAPIVolumeFile{
224			Path: "annotations",

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