|
50 | 50 | WorkspaceSpec defines the desired state of Workspace. |
51 | 51 | Modelled closely on Kubeflow Notebook spec - wraps a full PodSpec. |
52 | 52 | properties: |
| 53 | + containerInit: |
| 54 | + description: |- |
| 55 | + ContainerInit is resolved at creation and applied to the main container. |
| 56 | + Direct Workspace CRs can supply it without an Image catalog lookup. |
| 57 | + properties: |
| 58 | + mode: |
| 59 | + enum: |
| 60 | + - disabled |
| 61 | + - injected |
| 62 | + - baked-in |
| 63 | + type: string |
| 64 | + userData: |
| 65 | + description: |- |
| 66 | + UserData is an inline #cloud-config document, mounted through a generated |
| 67 | + Workspace-owned Secret. Maximum 256 KiB (also enforced in bytes at runtime). |
| 68 | + maxLength: 262144 |
| 69 | + type: string |
| 70 | + userDataSecretRef: |
| 71 | + description: |- |
| 72 | + UserDataSecretRef references a same-namespace Secret with a user-data key. |
| 73 | + The referenced Secret is independently managed and is never adopted/deleted. |
| 74 | + properties: |
| 75 | + name: |
| 76 | + default: "" |
| 77 | + description: |- |
| 78 | + Name of the referent. |
| 79 | + This field is effectively required, but due to backwards compatibility is |
| 80 | + allowed to be empty. Instances of this type with an empty value here are |
| 81 | + almost certainly wrong. |
| 82 | + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
| 83 | + type: string |
| 84 | + type: object |
| 85 | + x-kubernetes-map-type: atomic |
| 86 | + x-kubernetes-validations: |
| 87 | + - message: A user-data Secret name is required |
| 88 | + rule: has(self.name) && size(self.name) > 0 |
| 89 | + required: |
| 90 | + - mode |
| 91 | + type: object |
| 92 | + x-kubernetes-validations: |
| 93 | + - message: Choose inline userData or userDataSecretRef, not both |
| 94 | + rule: '!(has(self.userData) && has(self.userDataSecretRef))' |
| 95 | + - message: Enabled container initialization requires user-data |
| 96 | + rule: self.mode == 'disabled' || (has(self.userData) && size(self.userData) |
| 97 | + > 0) || has(self.userDataSecretRef) |
53 | 98 | executionRevocationEpoch: |
54 | 99 | default: 0 |
55 | 100 | description: |- |
@@ -8231,6 +8276,8 @@ spec: |
8231 | 8276 | x-kubernetes-validations: |
8232 | 8277 | - message: VM guest profiles require type vm |
8233 | 8278 | rule: '!has(self.vmProfile) || self.type == ''vm''' |
| 8279 | + - message: Container initialization requires container or scratch type |
| 8280 | + rule: '!has(self.containerInit) || self.type != ''vm''' |
8234 | 8281 | - message: The main image must match the resolved VM source |
8235 | 8282 | rule: '!has(self.vmProfile) || (size(self.template.spec.containers) |
8236 | 8283 | == 1 && self.template.spec.containers[0].image == self.vmProfile.image)' |
|
0 commit comments