types.go 2.6 KB

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