Merge pull request #45495 from thaJeztah/apparmor_remove_version_code

profiles/apparmor: remove use of aaparser.GetVersion()
This commit is contained in:
Sebastiaan van Stijn 2023-05-09 16:46:32 +02:00 committed by GitHub
commit 06221297bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,10 +14,8 @@ import (
"github.com/docker/docker/pkg/aaparser"
)
var (
// profileDirectory is the file store for apparmor profiles and macros.
profileDirectory = "/etc/apparmor.d"
)
// profileDirectory is the file store for apparmor profiles and macros.
const profileDirectory = "/etc/apparmor.d"
// profileData holds information about the given profile for generation.
type profileData struct {
@ -29,8 +27,6 @@ type profileData struct {
Imports []string
// InnerImports defines the apparmor functions to import in the profile.
InnerImports []string
// Version is the {major, minor, patch} version of apparmor_parser as a single number.
Version int
}
// generateDefault creates an apparmor profile from ProfileData.
@ -50,12 +46,6 @@ func (p *profileData) generateDefault(out io.Writer) error {
p.InnerImports = append(p.InnerImports, "#include <abstractions/base>")
}
ver, err := aaparser.GetVersion()
if err != nil {
return err
}
p.Version = ver
return compiled.Execute(out, p)
}