Skip to content

Conversation

@surajkota
Copy link
Contributor

@surajkota surajkota commented Apr 23, 2021

Description of Changes

"conditions": [
           ...
            {
                "message": "Unable to update Endpoint. Check FailureReason",
                "status": "True",
                "type": "ACK.Recoverable"
            },
            {
                "message": "Unable to update Endpoint. Check FailureReason",
                "status": "True",
                "type": "ACK.Terminal"
            }
        ],

This PR fixes this issue by creating making FailUpdateError an awserr type of error and using it as one of the terminal codes just like any other AWS error. This also simplifies the custom code in customUpdateConditions which now only needs to check for Status.EndpointStatus == Failed while setting terminal condition


Testing

Locally using pytest and manually

(ack) ubuntu@ip-172-31-0-119:~/go/src/github.com/aws-controllers-k8s/sagemaker-controller/test/e2e$ PYTHONPATH=. pytest -n 4 --dist loadfile
=============================================== test session starts ===============================================
platform linux -- Python 3.8.8, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/ubuntu/go/src/github.com/aws-controllers-k8s/sagemaker-controller/test/e2e
plugins: xdist-2.2.0, forked-1.3.0, black-0.3.12
gw0 [24] / gw1 [24] / gw2 [24] / gw3 [24]
........................                                                                                    [100%]
========================================= 24 passed in 1866.80s (0:31:06) =========================================

@surajkota surajkota requested a review from mbaijal April 23, 2021 00:21
@surajkota surajkota self-assigned this Apr 23, 2021
@surajkota surajkota requested review from a team and akartsky and removed request for RedbackThomson April 23, 2021 00:21

var (
FailUpdateError = fmt.Errorf("Unable to update Endpoint. Check FailureReason")
FailUpdateError = awserr.New("EndpointUpdateError", "unable to update endpoint. check FailureReason", nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat

@surajkota surajkota merged commit 8c43988 into aws-controllers-k8s:main Apr 26, 2021
ryansteakley pushed a commit to ryansteakley/sagemaker-controller that referenced this pull request May 17, 2021
ryansteakley pushed a commit to ryansteakley/sagemaker-controller that referenced this pull request May 18, 2021
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.

3 participants