Skip to content

Commit

Permalink
split into two packages; apparmor only imported by optional package
Browse files Browse the repository at this point in the history
  • Loading branch information
thepudds committed Apr 14, 2022
1 parent 8e7adbc commit 7dfe806
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 1 addition & 6 deletions foobar.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package foobar

import (
"github.com/containerd/containerd/pkg/apparmor"
"github.com/sirupsen/logrus"
)

func Foobar() {
if apparmor.HostSupports() {
logrus.Infof("Running Foobar Deluxe, with AppArmor")
} else {
logrus.Infof("Running Foobar Basic")
}
logrus.Infof("Running Foobar")
}
14 changes: 14 additions & 0 deletions optional/optional.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package optional

import (
"github.com/containerd/containerd/pkg/apparmor"
"github.com/sirupsen/logrus"
)

func Optional() {
if apparmor.HostSupports() {
logrus.Infof("Running Foobar Deluxe, with AppArmor")
} else {
logrus.Infof("Running Foobar Basic")
}
}

0 comments on commit 7dfe806

Please sign in to comment.