|
@@ -6,13 +6,9 @@ import (
|
|
"os"
|
|
"os"
|
|
"path"
|
|
"path"
|
|
"text/template"
|
|
"text/template"
|
|
-
|
|
|
|
- "github.com/docker/docker/pkg/aaparser"
|
|
|
|
)
|
|
)
|
|
|
|
|
|
-type profileData struct {
|
|
|
|
- Version int
|
|
|
|
-}
|
|
|
|
|
|
+type profileData struct{}
|
|
|
|
|
|
func main() {
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
if len(os.Args) < 2 {
|
|
@@ -22,15 +18,6 @@ func main() {
|
|
// parse the arg
|
|
// parse the arg
|
|
apparmorProfilePath := os.Args[1]
|
|
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
|
|
// parse the template
|
|
compiled, err := template.New("apparmor_profile").Parse(dockerProfileTemplate)
|
|
compiled, err := template.New("apparmor_profile").Parse(dockerProfileTemplate)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -48,6 +35,7 @@ func main() {
|
|
}
|
|
}
|
|
defer f.Close()
|
|
defer f.Close()
|
|
|
|
|
|
|
|
+ data := profileData{}
|
|
if err := compiled.Execute(f, data); err != nil {
|
|
if err := compiled.Execute(f, data); err != nil {
|
|
log.Fatalf("executing template failed: %v", err)
|
|
log.Fatalf("executing template failed: %v", err)
|
|
}
|
|
}
|