Skip to content

Conversation

@michaelawyu
Copy link
Contributor

Description of your changes

This PR addresses the leftover comments on #985.

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

  • Unit tests
  • Integration tests

Special notes for your reviewer

N/A

Comment on lines +167 to +169
wrappedErr := fmt.Errorf("unexpected apply strategy %s is found", applyStrategy.Type)
_ = controller.NewUnexpectedBehaviorError(wrappedErr)
return nil, wrappedErr
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why don't we return the unexpectedError here but return APIServer errors in other places?

Copy link
Contributor

Choose a reason for hiding this comment

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

is that UnExpected erorr are "unExpected" so we don't want to record?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Ryan! It's still logged; the thing about this one is that the returned error will be formatted into a condition message which the user would be able to see, and the unexpected behavior cannot be handled by the controller part might read a bit weird; do we still want to expose them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will make the changes if that is OK with you.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can see pros and cons on either solution

Comment on lines +167 to +169
wrappedErr := fmt.Errorf("unexpected apply strategy %s is found", applyStrategy.Type)
_ = controller.NewUnexpectedBehaviorError(wrappedErr)
return nil, wrappedErr
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see pros and cons on either solution

@ryanzhang-oss ryanzhang-oss merged commit 14cc734 into Azure:main Jan 30, 2025
12 checks passed
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