mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Optimizing some format problems (#82983)
* modify the error string * omit redundant type bool from variable declarations
This commit is contained in:
parent
58323cbf4e
commit
65f2280a38
@ -102,7 +102,7 @@ func validateHost(runtime string) error {
|
||||
|
||||
// Check build support.
|
||||
if isDisabledBuild {
|
||||
return errors.New("Binary not compiled for linux")
|
||||
return errors.New("binary not compiled for linux")
|
||||
}
|
||||
|
||||
// Check kernel support.
|
||||
@ -112,7 +112,7 @@ func validateHost(runtime string) error {
|
||||
|
||||
// Check runtime support. Currently only Docker is supported.
|
||||
if runtime != kubetypes.DockerContainerRuntime && runtime != kubetypes.RemoteContainerRuntime {
|
||||
return fmt.Errorf("AppArmor is only enabled for 'docker' and 'remote' runtimes. Found: %q.", runtime)
|
||||
return fmt.Errorf("AppArmor is only enabled for 'docker' and 'remote' runtimes. Found: %q", runtime)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -556,7 +556,7 @@ func TestValidateContainerFailures(t *testing.T) {
|
||||
}
|
||||
|
||||
failPrivPod := defaultPod()
|
||||
var priv bool = true
|
||||
var priv = true
|
||||
failPrivPod.Spec.Containers[0].SecurityContext.Privileged = &priv
|
||||
|
||||
failProcMountPod := defaultPod()
|
||||
@ -1043,7 +1043,7 @@ func TestValidateContainerSuccess(t *testing.T) {
|
||||
privPSP := defaultPSP()
|
||||
privPSP.Spec.Privileged = true
|
||||
privPod := defaultPod()
|
||||
var priv bool = true
|
||||
var priv = true
|
||||
privPod.Spec.Containers[0].SecurityContext.Privileged = &priv
|
||||
|
||||
capsPSP := defaultPSP()
|
||||
@ -1275,7 +1275,7 @@ func defaultNamedPSP(name string) *policy.PodSecurityPolicy {
|
||||
}
|
||||
|
||||
func defaultPod() *api.Pod {
|
||||
var notPriv bool = false
|
||||
var notPriv = false
|
||||
return &api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: map[string]string{},
|
||||
@ -1299,7 +1299,7 @@ func defaultPod() *api.Pod {
|
||||
}
|
||||
|
||||
func defaultV1Pod() *v1.Pod {
|
||||
var notPriv bool = false
|
||||
var notPriv = false
|
||||
return &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: map[string]string{},
|
||||
|
Loading…
Reference in New Issue
Block a user