fake_manager.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. Copyright 2016 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 secret
  14. import v1 "k8s.io/api/core/v1"
  15. // fakeManager implements Manager interface for testing purposes.
  16. // simple operations to apiserver.
  17. type fakeManager struct {
  18. }
  19. // NewFakeManager creates empty/fake secret manager
  20. func NewFakeManager() Manager {
  21. return &fakeManager{}
  22. }
  23. // GetSecret returns a nil secret for testing
  24. func (s *fakeManager) GetSecret(namespace, name string) (*v1.Secret, error) {
  25. return nil, nil
  26. }
  27. // RegisterPod implements the RegisterPod method for testing purposes.
  28. func (s *fakeManager) RegisterPod(pod *v1.Pod) {
  29. }
  30. // UnregisterPod implements the UnregisterPod method for testing purposes.
  31. func (s *fakeManager) UnregisterPod(pod *v1.Pod) {
  32. }