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

Set Terminal Condition if ACK Terminal Error #318

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

nmvk
Copy link
Member

@nmvk nmvk commented Apr 5, 2022

Set terminal condition if ACK Terminal Error is thrown.

ACK Terminal errors can be used to set terminal conditions
if controller validations fail.

	if *latestStatus == "create-failed" {
		return nil, ackerr.TerminalError.New(errors.New("cluster cannot be updated as its status is not 'available'."))
	}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

templates/pkg/resource/sdk.go.tpl Outdated Show resolved Hide resolved
templates/pkg/resource/sdk.go.tpl Show resolved Hide resolved
templates/pkg/resource/sdk.go.tpl Show resolved Hide resolved
Set terminal condition if ACK Terminal Error is thrown.

ACK Terminal errors can be used to set terminal conditions
if controller validations fail.
@nmvk nmvk requested a review from RedbackThomson April 5, 2022 19:06
ack-bot pushed a commit to aws-controllers-k8s/runtime that referenced this pull request Apr 5, 2022
This method helps to throw terminal error from the controller.

Controller code can throw errors like

```
	if *latestStatus == "create-failed" {
		return nil, ackerr.TerminalError.New(errors.New("cluster cannot be updated as its status is not 'available'."))
	}
```

Code generator changes - aws-controllers-k8s/code-generator#318

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
@RedbackThomson
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 5, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Apr 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nmvk, RedbackThomson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit 122650f into aws-controllers-k8s:main Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants