Skip to content

Added more resilience on update policies. #672

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

crstrn13
Copy link
Contributor

@crstrn13 crstrn13 commented May 5, 2025

Added check function that will assert the generation has been incremented before confirming it the policy enforcement.

Signed-off-by: Alexander Cristurean <[email protected]>
@crstrn13 crstrn13 requested a review from azgabur May 5, 2025 11:05
crstrn13 added 3 commits May 5, 2025 15:22
Signed-off-by: Alexander Cristurean <[email protected]>
Signed-off-by: Alexander Cristurean <[email protected]>
Signed-off-by: Alexander Cristurean <[email protected]>
import pytest

pytestmark = [pytest.mark.authorino]

logger = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the logging for here?

authorization.identity.add_anonymous("anonymous")
authorization.wait_for_ready()
authorization.wait_until(has_observed_generation(generation + 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

You still need the wait_for_ready as just waiting for Authorino to pick up the the AuthPolicy is not enough. The observedGeneration can be incremented but the Policy can be in status "Not Enforced". wait_for_ready makes sure the Policy is also "Enforced"

authorization.identity.add_anonymous("anonymous")
authorization.wait_for_ready()
authorization.wait_until(has_observed_generation(generation + 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put the wait for generation == observedGeneration inside wait_for_ready in class Policy as it conceptually fits there.

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.

2 participants