@@ -657,6 +657,7 @@ func (ec *Controller) handleClaim(ctx context.Context, pod *v1.Pod, podClaim v1.
 | 
				
			|||||||
			metrics.ResourceClaimCreateFailures.Inc()
 | 
								metrics.ResourceClaimCreateFailures.Inc()
 | 
				
			||||||
			return fmt.Errorf("create ResourceClaim %s: %v", claimName, err)
 | 
								return fmt.Errorf("create ResourceClaim %s: %v", claimName, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							logger.V(4).Info("Created ResourceClaim", "claim", klog.KObj(claim), "pod", klog.KObj(pod))
 | 
				
			||||||
		ec.claimCache.Mutation(claim)
 | 
							ec.claimCache.Mutation(claim)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -241,7 +241,7 @@ func (c *ExampleController) allocateOneByOne(ctx context.Context, claimAllocatio
 | 
				
			|||||||
	for _, ca := range claimAllocations {
 | 
						for _, ca := range claimAllocations {
 | 
				
			||||||
		allocationResult, err := c.allocateOne(ctx, ca.Claim, ca.ClaimParameters, ca.Class, ca.ClassParameters, selectedNode)
 | 
							allocationResult, err := c.allocateOne(ctx, ca.Claim, ca.ClaimParameters, ca.Class, ca.ClassParameters, selectedNode)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			ca.Error = fmt.Errorf("failed allocating claim %v", ca.Claim.UID)
 | 
								ca.Error = err
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		ca.Allocation = allocationResult
 | 
							ca.Allocation = allocationResult
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,6 +20,7 @@ import (
 | 
				
			|||||||
	"context"
 | 
						"context"
 | 
				
			||||||
	"flag"
 | 
						"flag"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/onsi/gomega"
 | 
						"github.com/onsi/gomega"
 | 
				
			||||||
@@ -242,7 +243,19 @@ func Init(tb TB, opts ...InitOption) TContext {
 | 
				
			|||||||
	if c.PerTestOutput {
 | 
						if c.PerTestOutput {
 | 
				
			||||||
		config := ktesting.NewConfig(
 | 
							config := ktesting.NewConfig(
 | 
				
			||||||
			ktesting.AnyToString(func(v interface{}) string {
 | 
								ktesting.AnyToString(func(v interface{}) string {
 | 
				
			||||||
				return format.Object(v, 1)
 | 
									// For basic types where the string
 | 
				
			||||||
 | 
									// representation is "obvious" we use
 | 
				
			||||||
 | 
									// fmt.Sprintf because format.Object always
 | 
				
			||||||
 | 
									// adds a <"type"> prefix, which is too long
 | 
				
			||||||
 | 
									// for simple values.
 | 
				
			||||||
 | 
									switch v := v.(type) {
 | 
				
			||||||
 | 
									case int, int32, int64, uint, uint32, uint64, float32, float64, bool:
 | 
				
			||||||
 | 
										return fmt.Sprintf("%v", v)
 | 
				
			||||||
 | 
									case string:
 | 
				
			||||||
 | 
										return v
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										return strings.TrimSpace(format.Object(v, 1))
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}),
 | 
								}),
 | 
				
			||||||
			ktesting.VerbosityFlagName("v"),
 | 
								ktesting.VerbosityFlagName("v"),
 | 
				
			||||||
			ktesting.VModuleFlagName("vmodule"),
 | 
								ktesting.VModuleFlagName("vmodule"),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user