generators.external-secrets.io_gitlabdeploytokens.yaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. apiVersion: apiextensions.k8s.io/v1
  2. kind: CustomResourceDefinition
  3. metadata:
  4. annotations:
  5. controller-gen.kubebuilder.io/version: v0.19.0
  6. labels:
  7. external-secrets.io/component: controller
  8. name: gitlabdeploytokens.generators.external-secrets.io
  9. spec:
  10. group: generators.external-secrets.io
  11. names:
  12. categories:
  13. - external-secrets
  14. - external-secrets-generators
  15. kind: GitlabDeployToken
  16. listKind: GitlabDeployTokenList
  17. plural: gitlabdeploytokens
  18. singular: gitlabdeploytoken
  19. scope: Namespaced
  20. versions:
  21. - name: v1alpha1
  22. schema:
  23. openAPIV3Schema:
  24. description: GitlabDeployToken generates a GitLab deploy token.
  25. properties:
  26. apiVersion:
  27. description: |-
  28. APIVersion defines the versioned schema of this representation of an object.
  29. Servers should convert recognized schemas to the latest internal value, and
  30. may reject unrecognized values.
  31. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  32. type: string
  33. kind:
  34. description: |-
  35. Kind is a string value representing the REST resource this object represents.
  36. Servers may infer this from the endpoint the client submits requests to.
  37. Cannot be updated.
  38. In CamelCase.
  39. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  40. type: string
  41. metadata:
  42. type: object
  43. spec:
  44. description: GitlabDeployTokenSpec defines the desired state to generate
  45. a GitLab deploy token.
  46. properties:
  47. auth:
  48. description: Auth configures how ESO authenticates with the GitLab
  49. API.
  50. properties:
  51. token:
  52. description: |-
  53. Token references a secret containing a GitLab access token (personal, group, or
  54. project) with the api scope and at least the Maintainer role on the target.
  55. properties:
  56. secretRef:
  57. description: |-
  58. SecretKeySelector is a reference to a specific 'key' within a Secret resource.
  59. In some instances, `key` is a required field.
  60. properties:
  61. key:
  62. description: |-
  63. A key in the referenced Secret.
  64. Some instances of this field may be defaulted, in others it may be required.
  65. maxLength: 253
  66. minLength: 1
  67. pattern: ^[-._a-zA-Z0-9]+$
  68. type: string
  69. name:
  70. description: The name of the Secret resource being referred
  71. to.
  72. maxLength: 253
  73. minLength: 1
  74. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  75. type: string
  76. namespace:
  77. description: |-
  78. The namespace of the Secret resource being referred to.
  79. Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
  80. maxLength: 63
  81. minLength: 1
  82. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  83. type: string
  84. type: object
  85. required:
  86. - secretRef
  87. type: object
  88. required:
  89. - token
  90. type: object
  91. expiresAt:
  92. description: |-
  93. ExpiresAt is an optional expiry for the deploy token. If omitted the token does
  94. not expire on the GitLab side and is revoked only when the generator state is
  95. cleaned up (on regeneration or when the consuming ExternalSecret is deleted).
  96. format: date-time
  97. type: string
  98. groupID:
  99. description: |-
  100. GroupID is the numeric ID or unescaped path (e.g. parent/group) of the group to
  101. create the deploy token in. The generator URL-escapes paths before calling the
  102. GitLab API, so do not pre-encode. Mutually exclusive with projectID.
  103. minLength: 1
  104. type: string
  105. name:
  106. description: Name of the deploy token.
  107. minLength: 1
  108. type: string
  109. projectID:
  110. description: |-
  111. ProjectID is the numeric ID or unescaped path (e.g. group/project) of the
  112. project to create the deploy token in. The generator URL-escapes paths before
  113. calling the GitLab API, so do not pre-encode. Mutually exclusive with groupID.
  114. minLength: 1
  115. type: string
  116. scopes:
  117. description: Scopes granted to the deploy token. At least one scope
  118. is required.
  119. items:
  120. description: GitlabDeployTokenScope is a scope that can be granted
  121. to a GitLab deploy token.
  122. enum:
  123. - read_repository
  124. - read_registry
  125. - write_registry
  126. - read_package_registry
  127. - write_package_registry
  128. - read_virtual_registry
  129. - write_virtual_registry
  130. type: string
  131. minItems: 1
  132. type: array
  133. url:
  134. description: URL configures the GitLab instance URL. Defaults to https://gitlab.com.
  135. type: string
  136. username:
  137. description: |-
  138. Username is an optional username for the deploy token. GitLab defaults it to
  139. gitlab+deploy-token-{n} when omitted.
  140. type: string
  141. required:
  142. - auth
  143. - name
  144. - scopes
  145. type: object
  146. x-kubernetes-validations:
  147. - message: exactly one of projectID or groupID must be set
  148. rule: has(self.projectID) != has(self.groupID)
  149. type: object
  150. served: true
  151. storage: true
  152. subresources:
  153. status: {}