code: func validateSecretRefsSpec(spec api.TaskSpec) error {
  	container := spec.GetContainer()
  	if container == nil {
  		return nil
  	}
  
  	// Keep a map to track all the targets that will be exposed
  	// The string returned is only used for logging. It could as well be struct{}{}
  	existingTargets := make(map[string]string)
  	for _, secretRef := range container.Secrets {
  		// SecretID and SecretName are mandatory, we have invalid references without them
  		if secretRef.SecretID == "" || secretRef.SecretName == "" {
  			return status.Errorf(codes.InvalidArgument, "malformed secret reference")
  		}
  
  		// Every secret reference requires a Target
  		if secretRef.GetTarget() == nil {
  			return status.Errorf(codes.InvalidArgument, "malformed secret reference, no target provided")
  		}
  
  		// If this is a file target, we will ensure filename uniqueness
  		if secretRef.GetFile() != nil {
  			fileName := secretRef.GetFile().Name
  			if fileName == "" {
  				return status.Errorf(codes.InvalidArgument, "malformed file secret reference, invalid target file name provided")
  			}
  			// If this target is already in use, we have conflicting targets
  			if prevSecretName, ok := existingTargets[fileName]; ok {
  				return status.Errorf(codes.InvalidArgument, "secret references '%s' and '%s' have a conflicting target: '%s'", prevSecretName, secretRef.SecretName, fileName)
  			}
  
  			existingTargets[fileName] = secretRef.SecretName
  		}
  	}
  
  	return nil
  }
docs: // validateSecretRefsSpec finds if the secrets passed in spec are valid and have no
  // conflicting targets.