Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qfix] Add more logs to policies checking #1447

Merged

Conversation

glazychev-art
Copy link
Contributor

@glazychev-art glazychev-art commented Apr 11, 2023

Description

Add more logs to policies checking.

Error output:

2023/04/18 14:28:47 [ERROR] policy failed: policy.rego

Issue link

Incident: https://github.com/networkservicemesh/integration-k8s-kind/actions/runs/4665104418/jobs/8258077225
Logs (no information about failed policy):

...
Apr 11 08:21:05.750�[31m [ERRO] [id:alpine-74dcb6dd55-kfx57-0] [type:networkService] �[0m(8.3)          an error occurred during authorization policy check: rpc error: code = PermissionDenied desc = no sufficient privileges
Apr 11 08:21:05.750�[31m [ERRO] [id:alpine-74dcb6dd55-kfx57-0] [type:networkService] �[0m(7.1)         an error occurred during authorization policy check: rpc error: code = PermissionDenied desc = no sufficient privileges
...

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionality
  • Documentation
  • Refactoring
  • CI

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@2502d93). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1447   +/-   ##
=======================================
  Coverage        ?   70.17%           
=======================================
  Files           ?      242           
  Lines           ?    11012           
  Branches        ?        0           
=======================================
  Hits            ?     7728           
  Misses          ?     2784           
  Partials        ?      500           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@glazychev-art glazychev-art force-pushed the logs_to_policies branch 5 times, most recently from b6bd2d3 to 06d8412 Compare April 11, 2023 12:46
Copy link
Member

@denis-tingaikin denis-tingaikin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example on how log will look with the change?

@glazychev-art
Copy link
Contributor Author

@denis-tingaikin
Yes, It will look like:

2023/04/11 20:51:41 [ERROR] policy failed &{<nil>  
package test
	
default valid = false

valid {
		input.path_segments[_].token = "allowed"
}
 test valid 0xc00020bd90 0xb5c040 {1 {0 0}}}

@denis-tingaikin
Copy link
Member

denis-tingaikin commented Apr 11, 2023

@glazychev-art Could we add something like Policy.Name() func and use it instead?

@glazychev-art
Copy link
Contributor Author

@denis-tingaikin
Fixed.
Output:

2023/04/18 14:28:47 [ERROR] policy failed: policy.rego

@glazychev-art glazychev-art marked this pull request as ready for review April 18, 2023 07:38
Signed-off-by: Artem Glazychev <[email protected]>
@denis-tingaikin denis-tingaikin merged commit 777f572 into networkservicemesh:main Apr 18, 2023
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-cluster-info-k8s that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Apr 18, 2023
…k@main

PR link: networkservicemesh/sdk#1447

Commit: 777f572
Author: Artem Glazychev
Date: 2023-04-18 19:19:41 +0700
Message:
  - Add more logs to policies checking (#1447)
Signed-off-by: NSMBot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants