fake_manager.go 1.3 KB

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