Merge pull request #45492 from thaJeztah/contrib_apparmor_remove_version
contrib/apparmor: remove remaining version-conditionals (< 2.9) from template
This commit is contained in:
commit
a8b1ce2447
2 changed files with 2 additions and 16 deletions
|
@ -6,13 +6,9 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
"text/template"
|
||||
|
||||
"github.com/docker/docker/pkg/aaparser"
|
||||
)
|
||||
|
||||
type profileData struct {
|
||||
Version int
|
||||
}
|
||||
type profileData struct{}
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
|
@ -22,15 +18,6 @@ func main() {
|
|||
// parse the arg
|
||||
apparmorProfilePath := os.Args[1]
|
||||
|
||||
version, err := aaparser.GetVersion()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
data := profileData{
|
||||
Version: version,
|
||||
}
|
||||
fmt.Printf("apparmor_parser is of version %+v\n", data)
|
||||
|
||||
// parse the template
|
||||
compiled, err := template.New("apparmor_profile").Parse(dockerProfileTemplate)
|
||||
if err != nil {
|
||||
|
@ -48,6 +35,7 @@ func main() {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
data := profileData{}
|
||||
if err := compiled.Execute(f, data); err != nil {
|
||||
log.Fatalf("executing template failed: %v", err)
|
||||
}
|
||||
|
|
|
@ -149,9 +149,7 @@ profile /usr/bin/docker (attach_disconnected, complain) {
|
|||
}
|
||||
# xz works via pipes, so we do not need access to the filesystem.
|
||||
profile /usr/bin/xz (complain) {
|
||||
{{if ge .Version 209000}}
|
||||
signal (receive) peer=/usr/bin/docker,
|
||||
{{end}}
|
||||
/etc/ld.so.cache r,
|
||||
/lib/** rm,
|
||||
/usr/bin/xz rm,
|
||||
|
|
Loading…
Add table
Reference in a new issue