From 9e718d3183048dbf93aeb9e218a84fa4b68d4086 Mon Sep 17 00:00:00 2001 From: Ellis Tarn Date: Wed, 28 Jul 2021 17:21:35 -0700 Subject: [PATCH] Logging improvements (#568) --- pkg/cloudprovider/aws/instance.go | 2 +- pkg/controllers/allocation/filter.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/cloudprovider/aws/instance.go b/pkg/cloudprovider/aws/instance.go index 8dc81c5daa60..7d3708031235 100644 --- a/pkg/cloudprovider/aws/instance.go +++ b/pkg/cloudprovider/aws/instance.go @@ -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)) diff --git a/pkg/controllers/allocation/filter.go b/pkg/controllers/allocation/filter.go index d10511dacd9d..c1625136483e 100644 --- a/pkg/controllers/allocation/filter.go +++ b/pkg/controllers/allocation/filter.go @@ -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 }