@@ -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