Replace uses of deprecated functions from opencontainers/selinux/go-selinux/label
That also avoids warnings about missing error checks. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
e946df9d7a
commit
fb2df5d9fd
10
layers.go
10
layers.go
|
|
@ -26,7 +26,7 @@ import (
|
||||||
multierror "github.com/hashicorp/go-multierror"
|
multierror "github.com/hashicorp/go-multierror"
|
||||||
"github.com/klauspost/pgzip"
|
"github.com/klauspost/pgzip"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
"github.com/opencontainers/selinux/go-selinux/label"
|
"github.com/opencontainers/selinux/go-selinux"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/vbatts/tar-split/archive/tar"
|
"github.com/vbatts/tar-split/archive/tar"
|
||||||
"github.com/vbatts/tar-split/tar/asm"
|
"github.com/vbatts/tar-split/tar/asm"
|
||||||
|
|
@ -362,7 +362,7 @@ func (r *layerStore) Load() error {
|
||||||
compressedsums := make(map[digest.Digest][]string)
|
compressedsums := make(map[digest.Digest][]string)
|
||||||
uncompressedsums := make(map[digest.Digest][]string)
|
uncompressedsums := make(map[digest.Digest][]string)
|
||||||
if r.IsReadWrite() {
|
if r.IsReadWrite() {
|
||||||
label.ClearLabels()
|
selinux.ClearLabels()
|
||||||
}
|
}
|
||||||
if err = json.Unmarshal(data, &layers); len(data) == 0 || err == nil {
|
if err = json.Unmarshal(data, &layers); len(data) == 0 || err == nil {
|
||||||
idlist = make([]string, 0, len(layers))
|
idlist = make([]string, 0, len(layers))
|
||||||
|
|
@ -383,7 +383,7 @@ func (r *layerStore) Load() error {
|
||||||
uncompressedsums[layer.UncompressedDigest] = append(uncompressedsums[layer.UncompressedDigest], layer.ID)
|
uncompressedsums[layer.UncompressedDigest] = append(uncompressedsums[layer.UncompressedDigest], layer.ID)
|
||||||
}
|
}
|
||||||
if layer.MountLabel != "" {
|
if layer.MountLabel != "" {
|
||||||
label.ReserveLabel(layer.MountLabel)
|
selinux.ReserveLabel(layer.MountLabel)
|
||||||
}
|
}
|
||||||
layer.ReadOnly = !r.IsReadWrite()
|
layer.ReadOnly = !r.IsReadWrite()
|
||||||
}
|
}
|
||||||
|
|
@ -772,7 +772,7 @@ func (r *layerStore) Put(id string, parentLayer *Layer, names []string, mountLab
|
||||||
parentMappings = &idtools.IDMappings{}
|
parentMappings = &idtools.IDMappings{}
|
||||||
}
|
}
|
||||||
if mountLabel != "" {
|
if mountLabel != "" {
|
||||||
label.ReserveLabel(mountLabel)
|
selinux.ReserveLabel(mountLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Before actually creating the layer, make a persistent record of it with incompleteFlag,
|
// Before actually creating the layer, make a persistent record of it with incompleteFlag,
|
||||||
|
|
@ -1315,7 +1315,7 @@ func (r *layerStore) deleteInternal(id string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
label.ReleaseLabel(mountLabel)
|
selinux.ReleaseLabel(mountLabel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue