@@ -142,36 +142,74 @@ definitions:
142
142
type : array
143
143
items :
144
144
anyOf :
145
- - $ref : ' #/definitions/environment-value-from-api-token '
145
+ - $ref : ' #/definitions/environment-value-from'
146
146
147
- # An Image environment from an 'api-token'.
148
- # Roles is an optional list of API token realm roles where, for now,
149
- # we limit the number in the list to a maximum 1.
150
- environment-value-from-api-token :
147
+ # An Image environment from something else.
148
+ environment-value-from :
151
149
type : object
152
150
additionalProperties : false
153
151
properties :
154
152
name :
155
153
$ref : ' #/definitions/env-var-name'
156
154
value-from :
155
+ oneOf :
156
+ - $ref : ' #/definitions/environment-value-from-api-token'
157
+ - $ref : ' #/definitions/environment-value-from-secret'
158
+ required :
159
+ - name
160
+ - value-from
161
+
162
+ # Declaration for value-from 'api-token'.
163
+ # User provides a list of roles (which can be empty).
164
+ # Here, we limit the number of roles to 1.
165
+ environment-value-from-api-token :
166
+ type : object
167
+ additionalProperties : false
168
+ properties :
169
+ api-token :
157
170
type : object
158
171
properties :
159
- api-token :
160
- type : object
161
- properties :
162
- roles :
163
- type : array
164
- items :
165
- type : string
166
- pattern : ' ^[a-z]{1,}[a-z-_]{0,}$'
167
- minItems : 0
168
- maxItems : 1
169
- uniqueItems : true
172
+ roles :
173
+ type : array
174
+ items :
175
+ type : string
176
+ pattern : ' ^[a-z]{1,}[a-z-_]{0,}$'
177
+ minItems : 0
178
+ maxItems : 1
179
+ uniqueItems : true
170
180
required :
171
- - api-token
181
+ - roles
172
182
required :
173
- - name
174
- - value-from
183
+ - api-token
184
+
185
+ # An Image environment from a Kubernetes 'secret'.
186
+ # At the moment we expect the secret to be unencrypted,
187
+ # just 'opaque', so it can be read by the DM without special actions.
188
+ environment-value-from-secret :
189
+ type : object
190
+ additionalProperties : false
191
+ properties :
192
+ secret :
193
+ type : object
194
+ properties :
195
+ # The name of the secret object,
196
+ # i.e. its metadata->name.
197
+ name :
198
+ $ref : ' #/definitions/rfc-1035-name'
199
+ # The name of the key in the secret.
200
+ # - Begins with lowercase letter
201
+ # - Then lower-case alphanumeric including '-', '_' and '.'
202
+ # - Ends begins with lower-case alphanumeric
203
+ key :
204
+ type : string
205
+ minLength : 1
206
+ maxLength : 63
207
+ pattern : ' ^[a-z]([a-z0-9-_.]*[a-z0-9])?$'
208
+ required :
209
+ - name
210
+ - key
211
+ required :
212
+ - secret
175
213
176
214
# The pattern for Image environment names.
177
215
# Classic linux/shell,
0 commit comments