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

2022-03-03

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

示例1:
replication_controller_utils_test.go开发语言: Go项目名称: abhgupta代码行数: 184
52
53	status = func() *v1.ReplicationControllerStatus {
54		return &v1.ReplicationControllerStatus{
65
66		status     v1.ReplicationControllerStatus
67		condType   v1.ReplicationControllerConditionType
103
104		status *v1.ReplicationControllerStatus
105		cond   v1.ReplicationControllerCondition
106
107		expectedStatus *v1.ReplicationControllerStatus
108	}{
111
112			status: &v1.ReplicationControllerStatus{},
113			cond:   condReplicaFailure(),
示例2:
types.go开发语言: Go项目名称: kubernetes代码行数: 1387
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:
types.go开发语言: Go项目名称: kubernetes代码行数: 1294
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*/
示例4:
types.go开发语言: Go项目名称: kubernetes代码行数: 924
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*/
示例5:
replication_controller_utils_test.go开发语言: Go项目名称: bparees代码行数: 184
52
53	status = func() *v1.ReplicationControllerStatus {
54		return &v1.ReplicationControllerStatus{
65
66		status     v1.ReplicationControllerStatus
67		condType   v1.ReplicationControllerConditionType
103
104		status *v1.ReplicationControllerStatus
105		cond   v1.ReplicationControllerCondition
106
107		expectedStatus *v1.ReplicationControllerStatus
108	}{
111
112			status: &v1.ReplicationControllerStatus{},
113			cond:   condReplicaFailure(),
示例6:
replication_controller_utils_test.go开发语言: Go项目名称: byxorna代码行数: 184
52
53	status = func() *v1.ReplicationControllerStatus {
54		return &v1.ReplicationControllerStatus{
65
66		status     v1.ReplicationControllerStatus
67		condType   v1.ReplicationControllerConditionType
103
104		status *v1.ReplicationControllerStatus
105		cond   v1.ReplicationControllerCondition
106
107		expectedStatus *v1.ReplicationControllerStatus
108	}{
111
112			status: &v1.ReplicationControllerStatus{},
113			cond:   condReplicaFailure(),
示例7:
replication_controller_utils_test.go开发语言: Go项目名称: csrwng代码行数: 184
52
53	status = func() *v1.ReplicationControllerStatus {
54		return &v1.ReplicationControllerStatus{
65
66		status     v1.ReplicationControllerStatus
67		condType   v1.ReplicationControllerConditionType
103
104		status *v1.ReplicationControllerStatus
105		cond   v1.ReplicationControllerCondition
106
107		expectedStatus *v1.ReplicationControllerStatus
108	}{
111
112			status: &v1.ReplicationControllerStatus{},
113			cond:   condReplicaFailure(),
示例8:
replication_controller_test.go开发语言: Go项目名称: ddysher代码行数: 1695
308	rcInformer.Informer().GetIndexer().Add(rc)
309	rc.Status = v1.ReplicationControllerStatus{Replicas: int32(activePods), ReadyReplicas: int32(activePods), AvailableReplicas: int32(activePods)}
310	newPodList(podInformer.Informer().GetIndexer(), activePods, v1.PodRunning, rc, "pod")
348	rcInformer.Informer().GetIndexer().Add(rc)
349	rc.Status = v1.ReplicationControllerStatus{Replicas: 2, FullyLabeledReplicas: 6, ReadyReplicas: 2, AvailableReplicas: 2, ObservedGeneration: 0}
350	rc.Generation = 1
369	// 3. Every update to the status should include the Generation of the spec.
370	rc.Status = v1.ReplicationControllerStatus{Replicas: 4, ReadyReplicas: 4, AvailableReplicas: 4, ObservedGeneration: 1}
371
715	rcInformer.Informer().GetIndexer().Add(rc)
716	rc.Status = v1.ReplicationControllerStatus{Replicas: 2}
717	newPodList(podInformer.Informer().GetIndexer(), 1, v1.PodRunning, rc, "pod")
742	numReplicas := int32(10)
743	status := v1.ReplicationControllerStatus{Replicas: numReplicas}
744	updateReplicationControllerStatus(fakeRCClient, *rc, status)
示例9:
replication_controller_utils.go开发语言: Go项目名称: ddysher代码行数: 186
33// updateReplicationControllerStatus attempts to update the Status.Replicas of the given controller, with a single GET/PUT retry.
34func updateReplicationControllerStatus(c v1core.ReplicationControllerInterface, rc v1.ReplicationController, newStatus v1.ReplicationControllerStatus) (*v1.ReplicationController, error) {
35	// This is the steady state. It happens when the rc doesn't have any expectations, since
94
95func calculateStatus(rc *v1.ReplicationController, filteredPods []*v1.Pod, manageReplicasErr error) v1.ReplicationControllerStatus {
96	newStatus := rc.Status
150// GetCondition returns a replication controller condition with the provided type if it exists.
151func GetCondition(status v1.ReplicationControllerStatus, condType v1.ReplicationControllerConditionType) *v1.ReplicationControllerCondition {
152	for i := range status.Conditions {
161// SetCondition adds/replaces the given condition in the replication controller status.
162func SetCondition(status *v1.ReplicationControllerStatus, condition v1.ReplicationControllerCondition) {
163	currentCond := GetCondition(*status, condition.Type)
171// RemoveCondition removes the condition with the provided type from the replication controller status.
172func RemoveCondition(status *v1.ReplicationControllerStatus, condType v1.ReplicationControllerConditionType) {
173	status.Conditions = filterOutCondition(status.Conditions, condType)
示例10:
generated.pb.go开发语言: Go项目名称: ddysher代码行数: 41924
1086	proto.RegisterType((*ReplicationControllerSpec)(nil), "k8s.io.api.core.v1.ReplicationControllerSpec")
1087	proto.RegisterType((*ReplicationControllerStatus)(nil), "k8s.io.api.core.v1.ReplicationControllerStatus")
1088	proto.RegisterType((*ResourceFieldSelector)(nil), "k8s.io.api.core.v1.ResourceFieldSelector")

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