You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-node/4639-oci-volume-source/README.md
+82-1
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,7 @@ tags, and then generate with `hack/update-toc.sh`.
92
92
-[Vocabulary: OCI Images, Artifacts, and Objects](#vocabulary-oci-images-artifacts-and-objects)
93
93
-[Risks and Mitigations](#risks-and-mitigations)
94
94
-[Design Details](#design-details)
95
+
-[Kubernetes API](#kubernetes-api)
95
96
-[Kubelet and Container Runtime Interface (CRI) support for OCI artifacts](#kubelet-and-container-runtime-interface-cri-support-for-oci-artifacts)
96
97
-[kubelet](#kubelet)
97
98
-[Pull Policy](#pull-policy)
@@ -323,6 +324,8 @@ to support this source type. Key design aspects include:
323
324
- For OCI artifacts, we want to convert and represent them as a directory with
324
325
files. A single file could also be nested inside a directory.
325
326
327
+
### Kubernetes API
328
+
326
329
The following code snippet illustrates the proposed API change:
327
330
328
331
```yaml
@@ -344,6 +347,84 @@ spec:
344
347
name: oci-volume
345
348
```
346
349
350
+
351
+
This means we extend the [`VolumeSource`](https://github.com/kubernetes/kubernetes/blob/7b359a2f9e1ff5cdc49cfcc4e350e9d796f502c0/staging/src/k8s.io/api/core/v1/types.go#L49)
352
+
by:
353
+
354
+
```go
355
+
// Represents the source of a volume to mount.
356
+
// Only one of its members may be specified.
357
+
type VolumeSource struct {
358
+
// …
359
+
360
+
// oci represents a OCI object pulled and mounted on kubelet's host machine
The same will apply to [`pkg/apis/core/types.VolumeSource`](https://github.com/kubernetes/kubernetes/blob/7b359a2f9e1ff5cdc49cfcc4e350e9d796f502c0/pkg/apis/core/types.go#L58),
382
+
which is the internal API compared to the external one from staging. The [API Validation](https://github.com/kubernetes/kubernetes/blob/7b359a2f9e1ff5cdc49cfcc4e350e9d796f502c0/pkg/apis/core/validation/validation.go)
383
+
validation will be extended to disallow the `subPath`/`subPathExpr` field as
384
+
well as making the `reference` mandatory:
385
+
386
+
```go
387
+
// …
388
+
389
+
if source.OCI != nil {
390
+
if numVolumes > 0 {
391
+
allErrs = append(allErrs, field.Forbidden(fldPath.Child("oci"), "may not specify more than 1 volume type"))
0 commit comments