Skip to content

Commit

Permalink
Logging improvements (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellistarn committed Jul 29, 2021
1 parent b1f89b7 commit 9e718d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/cloudprovider/aws/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func getInstanceID(node *v1.Node) (*string, error) {
func combineFleetErrors(errors []*ec2.CreateFleetError) (errs error) {
unique := sets.NewString()
for _, err := range errors {
unique.Insert(aws.StringValue(err.ErrorCode))
unique.Insert(fmt.Sprintf("%s: %s", aws.StringValue(err.ErrorCode), aws.StringValue(err.ErrorMessage)))
}
for _, errorCode := range unique.List() {
errs = multierr.Append(errs, fmt.Errorf(errorCode))
Expand Down
6 changes: 2 additions & 4 deletions pkg/controllers/allocation/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ func (f *Filter) GetProvisionablePods(ctx context.Context, provisioner *v1alpha3
provisionable := []*v1.Pod{}
for _, p := range pods.Items {
if err := f.isProvisionable(ctx, &p, provisioner); err != nil {
logging.FromContext(ctx).Debugf("Ignored pod %s/%s when allocating for provisioner %s/%s, %s",
p.Name, p.Namespace,
provisioner.Name, provisioner.Namespace,
err.Error(),
logging.FromContext(ctx).Debugf("Ignored pod %s/%s when allocating for provisioner %s, %s",
p.Name, p.Namespace, provisioner.Name, err.Error(),
)
continue
}
Expand Down

0 comments on commit 9e718d3

Please sign in to comment.