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

Updating policy settings does not change policy state to pending #543

Open
Tracked by #536
kravciak opened this issue Nov 14, 2023 · 2 comments
Open
Tracked by #536

Updating policy settings does not change policy state to pending #543

kravciak opened this issue Nov 14, 2023 · 2 comments

Comments

@kravciak
Copy link
Collaborator

kravciak commented Nov 14, 2023

When I modify policy config policyserver is restarted. Only after that changes are applied to the cluster.
UI does not reflect this transition period, for example when updating mode policy is immediatelly Active and Protect but change are not in effect yet. Same applies to other modifications, for example module updates.

When I make errors in configuration it's not obvious that changes were not applied and old policyserver stays active.

Screencast.from.2023-11-14.14-17-06.webm
@kravciak kravciak mentioned this issue Nov 14, 2023
18 tasks
@kravciak kravciak changed the title Updating mode Monitor -> Protect does not change policy state to pending (same as config update) Updating mode Monitor -> Protect does not change policy state to pending Nov 14, 2023
@kravciak kravciak added the kind/bug Something isn't working label Nov 14, 2023
@kravciak
Copy link
Collaborator Author

kravciak commented Nov 14, 2023

As discussed on daily it might be fixed by observing state PolicyUniquelyReachable instead of PolicyActive

Values are described in https://github.com/kubewarden/kubewarden-controller/blob/3e2246abe21a1613406394351b2b073992a37d04/pkg/apis/policies/v1/policy.go#L54

Sample from command line:

~ k wait clusteradmissionpolicy --for=condition=PolicyUniquelyReachable no-privileged-pod

@kravciak kravciak changed the title Updating mode Monitor -> Protect does not change policy state to pending Updating policy settings does not change policy state to pending Nov 14, 2023
@jordojordo jordojordo self-assigned this Nov 21, 2023
@jordojordo
Copy link
Member

jordojordo commented Nov 21, 2023

Changing the status to search for a PolicyUniquelyReachable condition causes some messy behavior which could be confusing.

When one policy is not uniquely reachable, all other policies with a related PolicyServer are considered not reachable as well since the PS pod is updating all of the policies. However, all of the policies that are then showing as not reachable are in fact still working and active.

Perhaps a good alternative here would be to show a transitioning icon or equivalent next to the status?

Policy creation

policy-status.mp4

Policy mode update

policy-status2.mp4

Policy deletion

policy-status3.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants