-
Notifications
You must be signed in to change notification settings - Fork 540
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Generate event when instance fails to launch because no subnets available in an availability zone #1445
馃悰 Generate event when instance fails to launch because no subnets available in an availability zone #1445
Conversation
pkg/cloud/services/ec2/instances.go
Outdated
@@ -159,6 +159,9 @@ func (s *Service) CreateInstance(scope *scope.MachineScope) (*infrav1.Instance, | |||
|
|||
sns := s.scope.Subnets().FilterPrivate().FilterByZone(*availabilityZone) | |||
if len(sns) == 0 { | |||
record.Warnf(scope.AWSMachine, "FailedCreate", | |||
"Failed to create instance: no subnets available in availaibility zone %q", *availabilityZone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Failed to create instance: no subnets available in availaibility zone %q", *availabilityZone) | |
"Failed to create instance: no subnets available in availability zone %q", *availabilityZone) |
pkg/cloud/services/ec2/instances.go
Outdated
@@ -159,6 +159,9 @@ func (s *Service) CreateInstance(scope *scope.MachineScope) (*infrav1.Instance, | |||
|
|||
sns := s.scope.Subnets().FilterPrivate().FilterByZone(*availabilityZone) | |||
if len(sns) == 0 { | |||
record.Warnf(scope.AWSMachine, "FailedCreate", | |||
"Failed to create instance: no subnets available in availaibility zone %q", *availabilityZone) | |||
|
|||
return nil, awserrors.NewFailedDependency( | |||
errors.Errorf("failed to run machine %q, no subnets available in availaibility zone %q", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors.Errorf("failed to run machine %q, no subnets available in availaibility zone %q", | |
errors.Errorf("failed to run machine %q, no subnets available in availability zone %q", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor spelling nit, but otherwise lgtm
/hold |
Looking at the code in |
@ncdc I can take a look at |
@aaroniscode, @ncdc what do you want to do with this PR? |
It's definitely helpful, but it doesn't cover 100% of the possible errors where we are not generating events. I guess let's get the 2 typos fixed and merge it for now until we have a more comprehensive solution. |
If we merge this but it's not complete, we shouldn't close the related issue |
Edited PR desc so it won't close the issue |
spelling fixed /unhold |
@aaroniscode It looks like the updated version with the fixed spelling didn't get pushed? |
sorry @vincepri was git error on my side ... fixed now |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aaroniscode, ncdc 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 |
What this PR does / why we need it:
When a user specifies the
availabilityZone
orfailureDomain
in aAWSMachine
and there are no available subnets to launch the EC2 instance, there are no events registered with theAWSMachine
. This PR adds the event.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of #1425