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
+80-1
Original file line number
Diff line number
Diff line change
@@ -323,6 +323,8 @@ to support this source type. Key design aspects include:
323
323
- For OCI artifacts, we want to convert and represent them as a directory with
324
324
files. A single file could also be nested inside a directory.
325
325
326
+
### Kubernetes API
327
+
326
328
The following code snippet illustrates the proposed API change:
327
329
328
330
```yaml
@@ -344,6 +346,83 @@ spec:
344
346
name: oci-volume
345
347
```
346
348
349
+
350
+
This means we extend the [`VolumeSource`](https://github.com/kubernetes/kubernetes/blob/7b359a2f9e1ff5cdc49cfcc4e350e9d796f502c0/staging/src/k8s.io/api/core/v1/types.go#L49)
351
+
by:
352
+
353
+
```go
354
+
// Represents the source of a volume to mount.
355
+
// Only one of its members may be specified.
356
+
type VolumeSource struct {
357
+
// …
358
+
359
+
// 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),
380
+
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)
381
+
validation will be extended to disallow the `subPath`/`subPathExpr` field as
382
+
well as making the `reference` mandatory:
383
+
384
+
```go
385
+
// …
386
+
387
+
if source.OCI != nil {
388
+
if numVolumes > 0 {
389
+
allErrs = append(allErrs, field.Forbidden(fldPath.Child("oci"), "may not specify more than 1 volume type"))
0 commit comments