Skip to content

Commit 337fcea

Browse files
alvaroalemankubermatic-bot
authored andcommitted
Set a terminal error if AMI terms were not accepted (#441)
* Set a terminal error if AMI terms were not accepted Fixes #358 * Fix e2e
1 parent 64bee2e commit 337fcea

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

hack/ci-e2e-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ for try in {1..20}; do
4949
set +e
5050
# Create environment at cloud provider
5151
echo "Creating environment at cloud provider."
52-
terraform import hcloud_ssh_key.default 265119
52+
terraform import hcloud_ssh_key.default 355488
5353
terraform apply -auto-approve
5454
TF_RC=$?
5555
if [[ $TF_RC == 0 ]]; then break; fi

pkg/cloudprovider/provider/aws/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,12 @@ func awsErrorToTerminalError(err error, msg string) error {
732732
Reason: common.InvalidConfigurationMachineError,
733733
Message: "A request has been rejected due to invalid credentials which were taken from the MachineSpec",
734734
}
735+
case "OptInRequired":
736+
// User has to accept the terms of the AMI
737+
return cloudprovidererrors.TerminalError{
738+
Reason: "AMI terms not accepted",
739+
Message: err.Error(),
740+
}
735741
default:
736742
return prepareAndReturnError()
737743
}

0 commit comments

Comments
 (0)