Skip to content

Conversation

@yolken-segment
Copy link
Contributor

@yolken-segment yolken-segment commented Apr 13, 2021

Description

This change includes some miscellaneous updates to improve locking and OPA policy evaluation results:

  1. Use a separate context for lock release since the main context might already be cancelled by the time the release happens
  2. Wait for the underlying lock to be released before returning from the KubeLocker's Release method
  3. Support returning specific "reasons" for OPA policy failures
  4. Improve formatting of validation results (see example below)
  5. Update README to include more details on OPA policy evaluation

Example validation result

---------------+--------------------------------------------------------------------
    PROPERTY   |                               VALUE                                
---------------+--------------------------------------------------------------------
       cluster | test-cluster                         
          path | test-path/local-volume-provisioner/provisioner.yaml  
      resource | DaemonSet.apps/v1.app.local-volume-provisioner            
     checkType | opa                                                                
     checkName | only_ecr_images.rego                                               
   checkStatus | invalid                                                            
  checkMessage | Policy returned 1 deny reason(s)                                   
               | (1) Container provisioner does not appear to be using ECR image    
---------------+--------------------------------------------------------------------

@yolken-segment yolken-segment requested a review from dk1027 April 13, 2021 23:37
@yolken-segment yolken-segment merged commit 696f462 into master Apr 14, 2021
@yolken-segment yolken-segment deleted the yolken-improve-locks-opa branch April 14, 2021 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants