summaryrefslogtreecommitdiff
path: root/vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-29 12:20:59 +0200
committerGitHub <noreply@github.com>2022-09-29 12:20:59 +0200
commit2489a94b98b9d2a9f74d6899dc94aaf92a8a6246 (patch)
treecbcb56945c93bf86cae6a368168179a5e5bdd024 /vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go
parent64ca617a42981cc6846ad85744a0826d7cc14318 (diff)
parentba70dd5ecf6b4e5e55f55bcf966c513c3ce944be (diff)
downloadpodman-2489a94b98b9d2a9f74d6899dc94aaf92a8a6246.tar.gz
podman-2489a94b98b9d2a9f74d6899dc94aaf92a8a6246.tar.bz2
podman-2489a94b98b9d2a9f74d6899dc94aaf92a8a6246.zip
Merge pull request #15971 from containers/dependabot/go_modules/github.com/container-orchestrated-devices/container-device-interface-0.5.2
build(deps): bump github.com/container-orchestrated-devices/container-device-interface from 0.5.1 to 0.5.2
Diffstat (limited to 'vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go')
-rw-r--r--vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go b/vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go
index 1295f75e9..9fcecf849 100644
--- a/vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go
+++ b/vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits.go
@@ -27,8 +27,6 @@ import (
"github.com/container-orchestrated-devices/container-device-interface/specs-go"
oci "github.com/opencontainers/runtime-spec/specs-go"
ocigen "github.com/opencontainers/runtime-tools/generate"
-
- runc "github.com/opencontainers/runc/libcontainer/devices"
)
const (
@@ -289,37 +287,6 @@ func ensureOCIHooks(spec *oci.Spec) {
}
}
-// fillMissingInfo fills in missing mandatory attributes from the host device.
-func (d *DeviceNode) fillMissingInfo() error {
- if d.HostPath == "" {
- d.HostPath = d.Path
- }
-
- if d.Type != "" && (d.Major != 0 || d.Type == "p") {
- return nil
- }
-
- hostDev, err := runc.DeviceFromPath(d.HostPath, "rwm")
- if err != nil {
- return errors.Wrapf(err, "failed to stat CDI host device %q", d.HostPath)
- }
-
- if d.Type == "" {
- d.Type = string(hostDev.Type)
- } else {
- if d.Type != string(hostDev.Type) {
- return errors.Errorf("CDI device (%q, %q), host type mismatch (%s, %s)",
- d.Path, d.HostPath, d.Type, string(hostDev.Type))
- }
- }
- if d.Major == 0 && d.Type != "p" {
- d.Major = hostDev.Major
- d.Minor = hostDev.Minor
- }
-
- return nil
-}
-
// sortMounts sorts the mounts in the given OCI Spec.
func sortMounts(specgen *ocigen.Generator) {
mounts := specgen.Mounts()