Skip to content

Commit

Permalink
enable golint for pkg/security/podsecuritypolicy/capabilities
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <me@jessfraz.com>
  • Loading branch information
jessfraz committed Aug 10, 2016
1 parent 818cdaf commit c0f4bd3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/security/podsecuritypolicy/capabilities/mustrunas.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ import (
"k8s.io/kubernetes/pkg/util/validation/field"
)

// defaultCapabilities implements the CapabilitiesStrategy interface
// defaultCapabilities implements the Strategy interface
type defaultCapabilities struct {
defaultAddCapabilities []api.Capability
requiredDropCapabilities []api.Capability
allowedCaps []api.Capability
}

var _ CapabilitiesStrategy = &defaultCapabilities{}
var _ Strategy = &defaultCapabilities{}

// NewDefaultCapabilities creates a new defaultCapabilities strategy that will provide defaults and validation
// based on the configured initial caps and allowed caps.
func NewDefaultCapabilities(defaultAddCapabilities, requiredDropCapabilities, allowedCaps []api.Capability) (CapabilitiesStrategy, error) {
func NewDefaultCapabilities(defaultAddCapabilities, requiredDropCapabilities, allowedCaps []api.Capability) (Strategy, error) {
return &defaultCapabilities{
defaultAddCapabilities: defaultAddCapabilities,
requiredDropCapabilities: requiredDropCapabilities,
Expand Down
4 changes: 2 additions & 2 deletions pkg/security/podsecuritypolicy/capabilities/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"k8s.io/kubernetes/pkg/util/validation/field"
)

// CapabilitiesStrategy defines the interface for all cap constraint strategies.
type CapabilitiesStrategy interface {
// Strategy defines the interface for all cap constraint strategies.
type Strategy interface {
// Generate creates the capabilities based on policy rules.
Generate(pod *api.Pod, container *api.Container) (*api.Capabilities, error)
// Validate ensures that the specified values fall within the range of the strategy.
Expand Down
2 changes: 1 addition & 1 deletion pkg/security/podsecuritypolicy/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ func createSupplementalGroupStrategy(opts *extensions.SupplementalGroupsStrategy
}

// createCapabilitiesStrategy creates a new capabilities strategy.
func createCapabilitiesStrategy(defaultAddCaps, requiredDropCaps, allowedCaps []api.Capability) (capabilities.CapabilitiesStrategy, error) {
func createCapabilitiesStrategy(defaultAddCaps, requiredDropCaps, allowedCaps []api.Capability) (capabilities.Strategy, error) {
return capabilities.NewDefaultCapabilities(defaultAddCaps, requiredDropCaps, allowedCaps)
}
2 changes: 1 addition & 1 deletion pkg/security/podsecuritypolicy/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ type ProviderStrategies struct {
SELinuxStrategy selinux.SELinuxStrategy
FSGroupStrategy group.GroupStrategy
SupplementalGroupStrategy group.GroupStrategy
CapabilitiesStrategy capabilities.CapabilitiesStrategy
CapabilitiesStrategy capabilities.Strategy
}

0 comments on commit c0f4bd3

Please sign in to comment.