types.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. Copyright © 2025 ESO Maintainer Team
  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. https://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 v1
  14. // SecretKeySelector is a reference to a specific 'key' within a Secret resource.
  15. // In some instances, `key` is a required field.
  16. type SecretKeySelector struct {
  17. // The name of the Secret resource being referred to.
  18. // +kubebuilder:validation:MinLength:=1
  19. // +kubebuilder:validation:MaxLength:=253
  20. // +kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  21. Name string `json:"name,omitempty"`
  22. // The namespace of the Secret resource being referred to.
  23. // Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
  24. // +optional
  25. // +kubebuilder:validation:MinLength:=1
  26. // +kubebuilder:validation:MaxLength:=63
  27. // +kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  28. Namespace *string `json:"namespace,omitempty"`
  29. // A key in the referenced Secret.
  30. // Some instances of this field may be defaulted, in others it may be required.
  31. // +optional
  32. // +kubebuilder:validation:MinLength:=1
  33. // +kubebuilder:validation:MaxLength:=253
  34. // +kubebuilder:validation:Pattern:=^[-._a-zA-Z0-9]+$
  35. Key string `json:"key,omitempty"`
  36. }
  37. // ServiceAccountSelector is a reference to a ServiceAccount resource.
  38. type ServiceAccountSelector struct {
  39. // The name of the ServiceAccount resource being referred to.
  40. // +kubebuilder:validation:MinLength:=1
  41. // +kubebuilder:validation:MaxLength:=253
  42. // +kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  43. Name string `json:"name"`
  44. // Namespace of the resource being referred to.
  45. // Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
  46. // +optional
  47. // +kubebuilder:validation:MinLength:=1
  48. // +kubebuilder:validation:MaxLength:=63
  49. // +kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  50. Namespace *string `json:"namespace,omitempty"`
  51. // Audience specifies the `aud` claim for the service account token
  52. // If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
  53. // then this audiences will be appended to the list
  54. // +optional
  55. Audiences []string `json:"audiences,omitempty"`
  56. }