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

Support structured policy recommendation results #138

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

yanjunz97
Copy link
Contributor

This PR adds support for structured policy recommendations with the following changes:

  • Updates ClickHouse data schema to store each PR individually
  • Removes RecommendedNetworkPolicy CRD
  • Adds PR results retrieving in the API server
  • Adds e2e tests to verify the table recommendations during upgrading

Fix: #134

Signed-off-by: Yanjun Zhou zhouya@vmware.com

Copy link
Contributor

@yuntanghsu yuntanghsu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

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

Partial review. Planning to complete it today.

build/yamls/flow-visibility.yml Show resolved Hide resolved
pkg/apis/intelligence/v1alpha1/types.go Show resolved Hide resolved
if npReco.Status.State == crdv1alpha1.NPRecommendationStateCompleted {
result, err := r.getRecommendationResult(npReco.Status.SparkApplication)
if err != nil {
klog.Warningf("Failed to get the result for completed NetworkPolicy Recommedation with id %s, error: %v", npReco.Status.SparkApplication, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think it might be worth populating ErrorMsg in the CRD status if we fail to fetch the results from CH?

Copy link
Contributor Author

@yanjunz97 yanjunz97 Nov 30, 2022

Choose a reason for hiding this comment

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

I updated to populate the ErrorMsg. My only concern is usually we keep consistency between status.State and status.ErrorMsg, i.e. status.ErrorMsg will be empty if the status.State is not failed. But in the case of failing to fetch the results from CH, we need to choose between

  • breaking the consistency, i.e. we may have a State of Completed with some ErrorMsg
  • overwriting the State value which indicates the status of the NPR CR

Currently I choose the first option. Please tell me if you have other idea for this.

Copy link
Contributor

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

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

Just some additional, minor comments.

Signed-off-by: Yanjun Zhou <zhouya@vmware.com>
@yanjunz97
Copy link
Contributor Author

/theia-test-e2e

Copy link
Contributor

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

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

LGTM!

@yanjunz97 yanjunz97 merged commit ff33a90 into antrea-io:main Dec 9, 2022
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.

Store recommended policies individually
3 participants