mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Minor comments improvements.
This commit is contained in:
parent
46becf2c81
commit
1320f47f2a
@ -87,7 +87,7 @@ func (s *defaultCapabilities) Validate(pod *api.Pod, container *api.Container) f
|
|||||||
}
|
}
|
||||||
|
|
||||||
if container.SecurityContext.Capabilities == nil {
|
if container.SecurityContext.Capabilities == nil {
|
||||||
// if container.SC.Caps is nil then nothing was defaulted by the strat or requested by the pod author
|
// if container.SC.Caps is nil then nothing was defaulted by the strategy or requested by the pod author
|
||||||
// if there are no required caps on the strategy and nothing is requested on the pod
|
// if there are no required caps on the strategy and nothing is requested on the pod
|
||||||
// then we can safely return here without further validation.
|
// then we can safely return here without further validation.
|
||||||
if len(s.defaultAddCapabilities) == 0 && len(s.requiredDropCapabilities) == 0 {
|
if len(s.defaultAddCapabilities) == 0 && len(s.requiredDropCapabilities) == 0 {
|
||||||
@ -138,8 +138,7 @@ func capabilityFromStringSlice(slice []string) []api.Capability {
|
|||||||
return caps
|
return caps
|
||||||
}
|
}
|
||||||
|
|
||||||
// makeCapSet makes a string set from capabilities and normalizes them to be all lower case to help
|
// makeCapSet makes a string set from capabilities.
|
||||||
// with comparisons.
|
|
||||||
func makeCapSet(caps []api.Capability) sets.String {
|
func makeCapSet(caps []api.Capability) sets.String {
|
||||||
s := sets.NewString()
|
s := sets.NewString()
|
||||||
for _, c := range caps {
|
for _, c := range caps {
|
||||||
|
Loading…
Reference in New Issue
Block a user