Change:
When ResourceClaimParameters or ResourceClassParameters fail validation in resource driver during PodSchedulingContext sync loop, the error is visible only in the events of the PodSchedulingContext. The error should be visible on the object that fails validation as well, ResourceClaim or ResourceClass respectively. Creating ResourceClaim with unsupported parameters' values or unsupported No response <details</details<details</details<details</details<details</details<details</details<details</details
/assign
/sig node
/triage accepted
KEP:

Discussion:
// If selectedNode is set, the driver must attempt to allocate for that // node. If that is not possible, it must return an error. The // controller will call UnsuitableNodes and pass the new information to <del> // the scheduler, which then will lead to selecting a diffent node </del> <ins> // the scheduler, which then will lead to selecting a different node </ins> // if the current one is not suitable. // // The Claim, ClaimParameters, Class, ClassParameters fields of "claims" parameter

var errRequeue = errors.New("requeue") // errPeriodic is a special error instance that functions can return <del> // to request silent instance that functions can return </del> // to request silent retrying at a fixed rate. var errPeriodic = errors.New("periodic")

return errRequeue } <del> // Check parameters. claimParameters, classParameters, err := ctrl.getParameters(ctx, claim, class) </del> <ins> // Check parameters. Do not record event to Claim if its parameters are invalid, // syncKey will record the error. claimParameters, classParameters, err := ctrl.getParameters(ctx, claim, class, false) </ins> if err != nil { return err }

return nil } <del> func (ctrl *controller) getParameters(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, class *resourcev1alpha2.ResourceClass) (claimParameters, classParameters interface{}, err error) { </del> <ins> func (ctrl *controller) getParameters(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, class *resourcev1alpha2.ResourceClass, notifyClaim bool) (claimParameters, classParameters interface{}, err error) { </ins> classParameters, err = ctrl.driver.GetClassParameters(ctx, class) if err != nil { <ins> ctrl.eventRecorder.Event(class, v1.EventTypeWarning, "Failed", err.Error()) </ins> err = fmt.Errorf("class parameters %s: %v", class.ParametersRef, err) return } claimParameters, err = ctrl.driver.GetClaimParameters(ctx, claim, class, classParameters) if err != nil { <ins> if notifyClaim { ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, "Failed", err.Error()) } </ins> err = fmt.Errorf("claim parameters %s: %v", claim.Spec.ParametersRef, err) return }

if class.DriverName != ctrl.name { return nil, nil } <del> // Check parameters. claimParameters, classParameters, err := ctrl.getParameters(ctx, claim, class) </del> <ins> // Check parameters. Record event to claim and pod if parameters are invalid. claimParameters, classParameters, err := ctrl.getParameters(ctx, claim, class, true) </ins> if err != nil { <ins> ctrl.eventRecorder.Event(pod, v1.EventTypeWarning, "Failed", fmt.Sprintf("claim %v: %v", claim.Name, err.Error())) </ins> return nil, err } return &ClaimAllocation{

type NodeClient interface { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the <del> // response is ignored. Failures for individidual claims </del> <ins> // response is ignored. Failures for individual claims </ins> // can be reported inside NodePrepareResourcesResponse. NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) // NodeUnprepareResources is the opposite of NodePrepareResources.

type NodeServer interface { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the <del> // response is ignored. Failures for individidual claims </del> <ins> // response is ignored. Failures for individual claims </ins> // can be reported inside NodePrepareResourcesResponse. NodePrepareResources(context.Context, *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) // NodeUnprepareResources is the opposite of NodePrepareResources.

service Node { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the <del> // response is ignored. Failures for individidual claims </del> <ins> // response is ignored. Failures for individual claims </ins> // can be reported inside NodePrepareResourcesResponse. rpc NodePrepareResources (NodePrepareResourcesRequest) returns (NodePrepareResourcesResponse) {}