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

2022-03-03

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

示例1:
executor_kubernetes.go开发语言: Go项目名称: gitlab-ci-multi-runner代码行数: 563
322				ConfigMap: &api.ConfigMapVolumeSource{
323					LocalObjectReference: api.LocalObjectReference{
324						Name: volume.Name,
412
413	var imagePullSecrets []api.LocalObjectReference
414	for _, imagePullSecret := range s.Config.Kubernetes.ImagePullSecrets {
415		imagePullSecrets = append(imagePullSecrets, api.LocalObjectReference{Name: imagePullSecret})
416	}
418	if s.credentials != nil {
419		imagePullSecrets = append(imagePullSecrets, api.LocalObjectReference{Name: s.credentials.Name})
420	}
示例2:
executor_kubernetes_test.go开发语言: Go项目名称: gitlab-ci-multi-runner代码行数: 1525
239						ConfigMap: &api.ConfigMapVolumeSource{
240							LocalObjectReference: api.LocalObjectReference{Name: "ConfigMap"},
241							Items:                []api.KeyToPath{{Key: "key_1", Path: "/path/to/key_1"}},
1031			VerifyFn: func(t *testing.T, test testDef, pod *api.Pod) {
1032				secrets := []api.LocalObjectReference{{Name: "job-credentials"}}
1033				assert.Equal(t, secrets, pod.Spec.ImagePullSecrets)
1047			VerifyFn: func(t *testing.T, test testDef, pod *api.Pod) {
1048				secrets := []api.LocalObjectReference{{Name: "docker-registry-credentials"}}
1049				assert.Equal(t, secrets, pod.Spec.ImagePullSecrets)
示例3:
conversion_generated.go开发语言: Go项目名称: amygdala代码行数: 3065
102	out.SecretFile = in.SecretFile
103	// unable to generate simple pointer conversion for api.LocalObjectReference -> v1.LocalObjectReference
104	if in.SecretRef != nil {
452	out.FSType = in.FSType
453	// unable to generate simple pointer conversion for api.LocalObjectReference -> v1.LocalObjectReference
454	if in.SecretRef != nil {
681
682func autoConvert_api_LocalObjectReference_To_v1_LocalObjectReference(in *api.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error {
683	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
684		defaulting.(func(*api.LocalObjectReference))(in)
685	}
689
690func Convert_api_LocalObjectReference_To_v1_LocalObjectReference(in *api.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error {
691	return autoConvert_api_LocalObjectReference_To_v1_LocalObjectReference(in, out, s)
示例4:
conversion_generated.go开发语言: Go项目名称: amygdala代码行数: 5330
102	out.SecretFile = in.SecretFile
103	// unable to generate simple pointer conversion for api.LocalObjectReference -> v1.LocalObjectReference
104	if in.SecretRef != nil {
452	out.FSType = in.FSType
453	// unable to generate simple pointer conversion for api.LocalObjectReference -> v1.LocalObjectReference
454	if in.SecretRef != nil {
743
744func autoConvert_api_LocalObjectReference_To_v1_LocalObjectReference(in *api.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error {
745	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
746		defaulting.(func(*api.LocalObjectReference))(in)
747	}
751
752func Convert_api_LocalObjectReference_To_v1_LocalObjectReference(in *api.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error {
753	return autoConvert_api_LocalObjectReference_To_v1_LocalObjectReference(in, out, s)
示例5:
util_test.go开发语言: Go项目名称: abhgupta代码行数: 340
39					SecretRef: &api.SecretEnvSource{
40						LocalObjectReference: api.LocalObjectReference{
41							Name: "Spec.Containers[*].EnvFrom[*].SecretRef"}}}},
44						SecretKeyRef: &api.SecretKeySelector{
45							LocalObjectReference: api.LocalObjectReference{
46								Name: "Spec.Containers[*].Env[*].ValueFrom.SecretKeyRef"}}}}}}},
47			ImagePullSecrets: []api.LocalObjectReference{{
48				Name: "Spec.ImagePullSecrets"}},
51					SecretRef: &api.SecretEnvSource{
52						LocalObjectReference: api.LocalObjectReference{
53							Name: "Spec.InitContainers[*].EnvFrom[*].SecretRef"}}}},
56						SecretKeyRef: &api.SecretKeySelector{
57							LocalObjectReference: api.LocalObjectReference{
58								Name: "Spec.InitContainers[*].Env[*].ValueFrom.SecretKeyRef"}}}}}}},
示例6:
admission_test.go开发语言: Go项目名称: abhgupta代码行数: 831
94					ConfigMapRef: &api.ConfigMapEnvSource{
95						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
96					},
100					ConfigMapRef: &api.ConfigMapEnvSource{
101						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
102					},
107					ConfigMapRef: &api.ConfigMapEnvSource{
108						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
109					},
113					ConfigMapRef: &api.ConfigMapEnvSource{
114						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
115					},
123					ConfigMapRef: &api.ConfigMapEnvSource{
124						LocalObjectReference: api.LocalObjectReference{Name: "thing"},
125					},
示例7:
zz_generated.conversion.go开发语言: Go项目名称: ddysher代码行数: 5173
584	out.SecretFile = in.SecretFile
585	out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
586	out.ReadOnly = in.ReadOnly
1608	out.FSType = in.FSType
1609	out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
1610	out.ReadOnly = in.ReadOnly
1855	out.SessionCHAPAuth = in.SessionCHAPAuth
1856	out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
1857	return nil
2157
2158func autoConvert_v1_LocalObjectReference_To_api_LocalObjectReference(in *v1.LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error {
2159	out.Name = in.Name
2163// Convert_v1_LocalObjectReference_To_api_LocalObjectReference is an autogenerated conversion function.
2164func Convert_v1_LocalObjectReference_To_api_LocalObjectReference(in *v1.LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error {
2165	return autoConvert_v1_LocalObjectReference_To_api_LocalObjectReference(in, out, s)
示例8:
admission_test.go开发语言: Go项目名称: ddysher代码行数: 789
94					ConfigMapRef: &api.ConfigMapEnvSource{
95						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
96					},
100					ConfigMapRef: &api.ConfigMapEnvSource{
101						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
102					},
107					ConfigMapRef: &api.ConfigMapEnvSource{
108						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
109					},
113					ConfigMapRef: &api.ConfigMapEnvSource{
114						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
115					},
123					ConfigMapRef: &api.ConfigMapEnvSource{
124						LocalObjectReference: api.LocalObjectReference{Name: "thing"},
125					},
示例9:
zz_generated.conversion.go开发语言: Go项目名称: detiber代码行数: 5169
584	out.SecretFile = in.SecretFile
585	out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
586	out.ReadOnly = in.ReadOnly
1608	out.FSType = in.FSType
1609	out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
1610	out.ReadOnly = in.ReadOnly
1855	out.SessionCHAPAuth = in.SessionCHAPAuth
1856	out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
1857	return nil
2157
2158func autoConvert_v1_LocalObjectReference_To_api_LocalObjectReference(in *v1.LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error {
2159	out.Name = in.Name
2163// Convert_v1_LocalObjectReference_To_api_LocalObjectReference is an autogenerated conversion function.
2164func Convert_v1_LocalObjectReference_To_api_LocalObjectReference(in *v1.LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error {
2165	return autoConvert_v1_LocalObjectReference_To_api_LocalObjectReference(in, out, s)
示例10:
admission_test.go开发语言: Go项目名称: detiber代码行数: 721
94					ConfigMapRef: &api.ConfigMapEnvSource{
95						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
96					},
100					ConfigMapRef: &api.ConfigMapEnvSource{
101						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
102					},
107					ConfigMapRef: &api.ConfigMapEnvSource{
108						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
109					},
113					ConfigMapRef: &api.ConfigMapEnvSource{
114						LocalObjectReference: api.LocalObjectReference{Name: "abc"},
115					},
123					ConfigMapRef: &api.ConfigMapEnvSource{
124						LocalObjectReference: api.LocalObjectReference{Name: "thing"},
125					},

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