Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit f4d08b8

Browse files
authored
Merge pull request #2325 from thedadams/gh-1556
Stop trying to parse empty image names
2 parents 6b3a745 + 21b2601 commit f4d08b8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/controller/permissions/permissions_check.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ import (
2727
// - there are no missing permissions
2828
// - there are no image permissions denied (if ImageRoleAuthorizations are enabled)
2929
// - the image is allowed by the image allow rules (if enabled)
30-
func CopyPromoteStagedAppImage(req router.Request, resp router.Response) error {
30+
func CopyPromoteStagedAppImage(req router.Request, _ router.Response) error {
3131
app := req.Object.(*v1.AppInstance)
3232
if app.Status.Staged.AppImage.ID != "" &&
3333
app.Status.Staged.PermissionsChecked &&
3434
len(app.Status.Staged.PermissionsMissing) == 0 &&
3535
len(app.Status.Staged.ImagePermissionsDenied) == 0 &&
36-
z.Dereference[bool](app.Status.Staged.ImageAllowed) {
36+
z.Dereference(app.Status.Staged.ImageAllowed) {
3737
app.Status.AppImage = app.Status.Staged.AppImage
3838
app.Status.Permissions = app.Status.Staged.AppScopedPermissions
3939
}
@@ -63,9 +63,8 @@ func CheckPermissions(req router.Request, _ router.Response) error {
6363
}
6464

6565
// Early exit
66-
if (app.Status.Staged.AppImage.ID == "" ||
67-
app.Status.Staged.AppImage.Digest == app.Status.AppImage.Digest) &&
68-
app.Status.Staged.PermissionsObservedGeneration == app.Generation {
66+
if app.Status.Staged.AppImage.ID == "" ||
67+
app.Status.Staged.AppImage.Digest == app.Status.AppImage.Digest && app.Status.Staged.PermissionsObservedGeneration == app.Generation {
6968
// IAR disabled? Allow the Image if we're not re-checking permissions
7069
if enabled, err := config.GetFeature(req.Ctx, req.Client, profiles.FeatureImageAllowRules); err != nil {
7170
return err

0 commit comments

Comments
 (0)