generator_fake.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. package v1alpha1
  13. import (
  14. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  15. )
  16. // FakeSpec contains the static data.
  17. type FakeSpec struct {
  18. // Used to select the correct ESO controller (think: ingress.ingressClassName)
  19. // The ESO controller is instantiated with a specific controller name and filters VDS based on this property
  20. // +optional
  21. Controller string `json:"controller,omitempty"`
  22. // Data defines the static data returned
  23. // by this generator.
  24. Data map[string]string `json:"data,omitempty"`
  25. }
  26. // Fake generator is used for testing. It lets you define
  27. // a static set of credentials that is always returned.
  28. // +kubebuilder:object:root=true
  29. // +kubebuilder:storageversion
  30. // +kubebuilder:subresource:status
  31. // +kubebuilder:metadata:labels="external-secrets.io/component=controller"
  32. // +kubebuilder:resource:scope=Namespaced,categories={external-secrets, external-secrets-generators},shortName=fake
  33. type Fake struct {
  34. metav1.TypeMeta `json:",inline"`
  35. metav1.ObjectMeta `json:"metadata,omitempty"`
  36. Spec FakeSpec `json:"spec,omitempty"`
  37. }
  38. // +kubebuilder:object:root=true
  39. // FakeList contains a list of ExternalSecret resources.
  40. type FakeList struct {
  41. metav1.TypeMeta `json:",inline"`
  42. metav1.ListMeta `json:"metadata,omitempty"`
  43. Items []Fake `json:"items"`
  44. }