mirror of https://github.com/portainer/portainer
chore(code): remove superfluous checks EE-7040 (#11692)
parent
5560a444e5
commit
9068cfd892
|
@ -78,7 +78,7 @@ func (handler *Handler) imagesList(w http.ResponseWriter, r *http.Request) *http
|
||||||
|
|
||||||
imagesList := make([]ImageResponse, len(images))
|
imagesList := make([]ImageResponse, len(images))
|
||||||
for i, image := range images {
|
for i, image := range images {
|
||||||
if (image.RepoTags == nil || len(image.RepoTags) == 0) && (image.RepoDigests != nil && len(image.RepoDigests) > 0) {
|
if len(image.RepoTags) == 0 && len(image.RepoDigests) > 0 {
|
||||||
for _, repoDigest := range image.RepoDigests {
|
for _, repoDigest := range image.RepoDigests {
|
||||||
image.RepoTags = append(image.RepoTags, repoDigest[0:strings.Index(repoDigest, "@")]+":<none>")
|
image.RepoTags = append(image.RepoTags, repoDigest[0:strings.Index(repoDigest, "@")]+":<none>")
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,11 +48,11 @@ func IsValidStackFile(stackFileContent []byte, securitySettings *portainer.Endpo
|
||||||
return errors.New("pid host disabled for non administrator users")
|
return errors.New("pid host disabled for non administrator users")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !securitySettings.AllowDeviceMappingForRegularUsers && service.Devices != nil && len(service.Devices) > 0 {
|
if !securitySettings.AllowDeviceMappingForRegularUsers && len(service.Devices) > 0 {
|
||||||
return errors.New("device mapping disabled for non administrator users")
|
return errors.New("device mapping disabled for non administrator users")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !securitySettings.AllowSysctlSettingForRegularUsers && service.Sysctls != nil && len(service.Sysctls) > 0 {
|
if !securitySettings.AllowSysctlSettingForRegularUsers && len(service.Sysctls) > 0 {
|
||||||
return errors.New("sysctl setting disabled for non administrator users")
|
return errors.New("sysctl setting disabled for non administrator users")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue