Append "AppArmor enabled" to the Node ready condition message

This commit is contained in:
Tim St. Clair
2016-08-29 17:54:15 -07:00
parent d0a2d17ec1
commit 3808243b9e
4 changed files with 21 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ var isDisabledBuild bool
// Interface for validating that a pod with with an AppArmor profile can be run by a Node.
type Validator interface {
Validate(pod *api.Pod) error
ValidateHost() error
}
func NewValidator(runtime string) Validator {
@@ -64,7 +65,7 @@ func (v *validator) Validate(pod *api.Pod) error {
return nil
}
if v.validateHostErr != nil {
if v.ValidateHost() != nil {
return v.validateHostErr
}
@@ -87,6 +88,10 @@ func (v *validator) Validate(pod *api.Pod) error {
return nil
}
func (v *validator) ValidateHost() error {
return v.validateHostErr
}
// Verify that the host and runtime is capable of enforcing AppArmor profiles.
func validateHost(runtime string) error {
// Check feature-gates