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

2022-03-03

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

示例1:
nodecontroller_test.go开发语言: Go项目名称: kubernetes代码行数: 970
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:
factory_test.go开发语言: Go项目名称: kubernetes代码行数: 362
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*/
示例3:
nodecontroller_test.go开发语言: Go项目名称: ddysher代码行数: 2321
144	healthyNodeNewStatus := v1.NodeStatus{
145		Conditions: []v1.NodeCondition{
146			{
188						Status: v1.NodeStatus{
189							Conditions: []v1.NodeCondition{
190								{
224						Status: v1.NodeStatus{
225							Conditions: []v1.NodeCondition{
226								{
258						Status: v1.NodeStatus{
259							Conditions: []v1.NodeCondition{
260								{
278						Status: v1.NodeStatus{
279							Conditions: []v1.NodeCondition{
280								{
示例4:
nodecontroller_test.go开发语言: Go项目名称: detiber代码行数: 2266
140	healthyNodeNewStatus := v1.NodeStatus{
141		Conditions: []v1.NodeCondition{
142			{
184						Status: v1.NodeStatus{
185							Conditions: []v1.NodeCondition{
186								{
218						Status: v1.NodeStatus{
219							Conditions: []v1.NodeCondition{
220								{
238						Status: v1.NodeStatus{
239							Conditions: []v1.NodeCondition{
240								{
254			newNodeStatus: v1.NodeStatus{
255				Conditions: []v1.NodeCondition{
256					{
示例5:
node_lifecycle_controller_test.go开发语言: Go项目名称: abhgupta代码行数: 2407
159	healthyNodeNewStatus := v1.NodeStatus{
160		Conditions: []v1.NodeCondition{
161			{
203						Status: v1.NodeStatus{
204							Conditions: []v1.NodeCondition{
205								{
239						Status: v1.NodeStatus{
240							Conditions: []v1.NodeCondition{
241								{
273						Status: v1.NodeStatus{
274							Conditions: []v1.NodeCondition{
275								{
293						Status: v1.NodeStatus{
294							Conditions: []v1.NodeCondition{
295								{
示例6:
nodecontroller.go开发语言: Go项目名称: kubernetes代码行数: 417
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*/
示例7:
nodecontroller_test.go开发语言: Go项目名称: amygdala代码行数: 1188
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:
resource_printer_test.go开发语言: Go项目名称: kubernetes代码行数: 592
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*/
示例9:
dynamic_kubelet_config_test.go开发语言: Go项目名称: abhgupta代码行数: 495
40	configSource   *apiv1.NodeConfigSource
41	expectConfigOK *apiv1.NodeCondition
42	expectConfig   *kubeletconfig.KubeletConfiguration
87					Name:      originalConfigMap.Name}},
88				expectConfigOK: &apiv1.NodeCondition{Type: apiv1.NodeConfigOK, Status: apiv1.ConditionTrue,
89					Message: fmt.Sprintf(status.CurRemoteMessageFmt, configMapAPIPath(originalConfigMap)),
127						configSource: nil,
128						expectConfigOK: &apiv1.NodeCondition{Type: apiv1.NodeConfigOK, Status: apiv1.ConditionTrue,
129							Message: status.CurLocalMessage,
137						configSource: &apiv1.NodeConfigSource{ConfigMapRef: nil},
138						expectConfigOK: &apiv1.NodeCondition{Type: apiv1.NodeConfigOK, Status: apiv1.ConditionFalse,
139							Message: "",
150							Name: "bar"}}, // missing Namespace
151						expectConfigOK: &apiv1.NodeCondition{Type: apiv1.NodeConfigOK, Status: apiv1.ConditionFalse,
152							Message: "",
示例10:
nodecontroller.go开发语言: Go项目名称: ddysher代码行数: 1125
175	nodeExistsInCloudProvider  func(types.NodeName) (bool, error)
176	computeZoneStateFunc       func(nodeConditions []*v1.NodeCondition) (int, zoneState)
177	enterPartialDisruptionFunc func(nodeNum int) float32
566
567	zoneToNodeConditions := map[string][]*v1.NodeCondition{}
568	for i := range nodes {
569		var gracePeriod time.Duration
570		var observedReadyCondition v1.NodeCondition
571		var currentReadyCondition *v1.NodeCondition
710
711func (nc *NodeController) handleDisruption(zoneToNodeConditions map[string][]*v1.NodeCondition, nodes []*v1.Node) {
712	newZoneStates := map[string]zoneState{}
837// which given node is entitled, state of current and last observed Ready Condition, and an error if it occurred.
838func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.NodeCondition, *v1.NodeCondition, error) {
839	var err error

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