k8s/io/kubernetes/pkg/api/v1.PodSecurityContext 示例代码

2022-03-03

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

示例1:
accessors_test.go开发语言: Go项目名称: abhgupta代码行数: 726
1/*
2Copyright 2017 The Kubernetes Authors.
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:
admission_test.go开发语言: Go项目名称: abhgupta代码行数: 2413
1/*
2Copyright 2016 The Kubernetes Authors.
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*/
示例3:
conversion_test.go开发语言: Go项目名称: abhgupta代码行数: 599
39			RestartPolicy:   v1.RestartPolicy("bar"),
40			SecurityContext: new(v1.PodSecurityContext),
41		},
287						Spec: v1.PodSpec{
288							SecurityContext: new(v1.PodSecurityContext),
289						},
309						Spec: v1.PodSpec{
310							SecurityContext: new(v1.PodSecurityContext),
311						},
360					Spec: v1.PodSpec{
361						SecurityContext: new(v1.PodSecurityContext),
362					},
384					Spec: v1.PodSpec{
385						SecurityContext: new(v1.PodSecurityContext),
386					},
示例4:
conversion_test.go开发语言: Go项目名称: abhgupta代码行数: 652
41			RestartPolicy:   v1.RestartPolicy("bar"),
42			SecurityContext: new(v1.PodSecurityContext),
43		},
289						Spec: v1.PodSpec{
290							SecurityContext: new(v1.PodSecurityContext),
291						},
311						Spec: v1.PodSpec{
312							SecurityContext: new(v1.PodSecurityContext),
313						},
413					Spec: v1.PodSpec{
414						SecurityContext: new(v1.PodSecurityContext),
415					},
437					Spec: v1.PodSpec{
438						SecurityContext: new(v1.PodSecurityContext),
439					},
示例5:
accessors.go开发语言: Go项目名称: abhgupta代码行数: 407
1/*
2Copyright 2017 The Kubernetes Authors.
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*/
示例6:
provider_test.go开发语言: Go项目名称: detiber代码行数: 334
35		name     string
36		podSc    *v1.PodSecurityContext
37		sc       *v1.SecurityContext
55			name: "pod.Spec.SecurityContext.RunAsUser set",
56			podSc: &v1.PodSecurityContext{
57				RunAsUser: &userID,
64			name: "container.SecurityContext.RunAsUser overrides pod.Spec.SecurityContext.RunAsUser",
65			podSc: &v1.PodSecurityContext{
66				RunAsUser: &userID,
117		name     string
118		podSc    *v1.PodSecurityContext
119		sc       *v1.SecurityContext
147			name: "pod.Spec.SecurityContext.SELinuxOptions",
148			podSc: &v1.PodSecurityContext{
149				SELinuxOptions: inputSELinuxOptions(),
示例7:
provider_test.go开发语言: Go项目名称: amygdala代码行数: 316
1/*
2Copyright 2014 The Kubernetes Authors 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*/
示例8:
admission_test.go开发语言: Go项目名称: ddysher代码行数: 179
1/*
2Copyright 2014 The Kubernetes Authors.
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*/
示例9:
admission_test.go开发语言: Go项目名称: detiber代码行数: 179
1/*
2Copyright 2014 The Kubernetes Authors.
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*/
示例10:
admission_test.go开发语言: Go项目名称: abhgupta代码行数: 179
1/*
2Copyright 2014 The Kubernetes Authors.
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*/

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