1 /* 2 Copyright 2015 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package testing 18 19 import ( 20 v1 "k8s.io/api/core/v1" 21 "k8s.io/apimachinery/pkg/types" 22 "k8s.io/apimachinery/pkg/util/sets" 23 ) 24 25 // FakeManager simulates a prober.Manager for testing. 26 type FakeManager struct{} 27 28 // Unused methods below. 29 30 // AddPod simulates adding a Pod. 31 func (FakeManager) AddPod(_ *v1.Pod) {} 32 33 // RemovePod simulates removing a Pod. 34 func (FakeManager) RemovePod(_ *v1.Pod) {} 35 36 // Simulated stopping liveness and startup probes. 37 func (FakeManager) StopLivenessAndStartup(_ *v1.Pod) {} 38 39 // CleanupPods simulates cleaning up Pods. 40 func (FakeManager) CleanupPods(_ map[types.UID]sets.Empty) {} 41 42 // Start simulates start syncing the probe status 43 func (FakeManager) Start() {} 44 45 // UpdatePodStatus simulates updating the Pod Status. 46 func (FakeManager) UpdatePodStatus(_ *v1.Pod, podStatus *v1.PodStatus) { 47 for i := range podStatus.ContainerStatuses { 48 podStatus.ContainerStatuses[i].Ready = true 49 } 50 } 51