// ValidateStorageClass validates a StorageClass.
162292
func ValidateStorageClass(storageClass *storage.StorageClass) field.ErrorList {
	allErrs := apivalidation.ValidateObjectMeta(&storageClass.ObjectMeta, false, apivalidation.ValidateClassName, field.NewPath("metadata"))
	allErrs = append(allErrs, validateProvisioner(storageClass.Provisioner, field.NewPath("provisioner"))...)
	allErrs = append(allErrs, validateParameters(storageClass.Parameters, field.NewPath("parameters"))...)
	allErrs = append(allErrs, validateReclaimPolicy(storageClass.ReclaimPolicy, field.NewPath("reclaimPolicy"))...)
	allErrs = append(allErrs, validateVolumeBindingMode(storageClass.VolumeBindingMode, field.NewPath("volumeBindingMode"))...)
	allErrs = append(allErrs, validateAllowedTopologies(storageClass.AllowedTopologies, field.NewPath("allowedTopologies"))...)

	return allErrs
}
197540
func NewStorageError(code int, msg string, instance string) error {
	return &StorageError{Code: code, Msg: msg, Instance: instance}
}
94266
func (s *Transition) SetStorageClass(v string) *Transition {
	s.StorageClass = &v
	return s
}
17745
func (s *Destination) SetStorageClass(v string) *Destination {
	s.StorageClass = &v
	return s
}
474576
func (s *Object) SetStorageClass(v string) *Object {
	s.StorageClass = &v
	return s
}
1273002
func (s *PutObjectOutput) SetStorageClass(v string) *PutObjectOutput {
	s.StorageClass = &v
	return s
}
1248143
func Convert_storage_StorageClassList_To_v1beta1_StorageClassList(in *storage.StorageClassList, out *v1beta1.StorageClassList, s conversion.Scope) error {
	return autoConvert_storage_StorageClassList_To_v1beta1_StorageClassList(in, out, s)
}
1363067
func validateDynamicStoragePools(sb *storageBackend, pools set.Strings) error {
	for pool := range pools {
		providerType, provider, _, err := poolStorageProvider(sb, pool)
		if err != nil {
			return errors.Trace(err)
		}
		if !provider.Dynamic() {
			return errors.NewNotSupported(err, fmt.Sprintf(
				"%q storage provider does not support dynamic storage",
				providerType,
			))
		}
	}
	return nil
}
210493
func DisableDefaultStorageClass(class string) error {
	loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
	kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, &clientcmd.ConfigOverrides{})
	config, err := kubeConfig.ClientConfig()
	if err != nil {
		return errors.Wrap(err, "Error creating kubeConfig")
	}
	client, err := kubernetes.NewForConfig(config)
	if err != nil {
		return errors.Wrap(err, "Error creating new client from kubeConfig.ClientConfig()")
	}

	sc, err := client.Storage().StorageClasses().Get(class, metav1.GetOptions{})
	if err != nil {
		return errors.Wrapf(err, "Error getting storage class %s", class)
	}

	err = annotateDefaultStorageClass(client, sc, false)
	if err != nil {
		return errors.Wrapf(err, "Error marking storage class %s as non-default", class)
	}

	return nil
}
89853
func (s *MultipartUpload) SetStorageClass(v string) *MultipartUpload {
	s.StorageClass = &v
	return s
}
795166
func (p *priorityPlugin) validatePriorityClass(a admission.Attributes) error {
	operation := a.GetOperation()
	pc, ok := a.GetObject().(*scheduling.PriorityClass)
	if !ok {
		return errors.NewBadRequest("resource was marked with kind PriorityClass but was unable to be converted")
	}
	// If the new PriorityClass tries to be the default priority, make sure that no other priority class is marked as default.
	if pc.GlobalDefault {
		dpc, err := p.getDefaultPriorityClass()
		if err != nil {
			return fmt.Errorf("failed to get default priority class: %v", err)
		}
		if dpc != nil {
			// Throw an error if a second default priority class is being created, or an existing priority class is being marked as default, while another default already exists.
			if operation == admission.Create || (operation == admission.Update && dpc.GetName() != pc.GetName()) {
				return admission.NewForbidden(a, fmt.Errorf("PriorityClass %v is already marked as default. Only one default can exist", dpc.GetName()))
			}
		}
	}
	return nil
}
602934
func (s *HeadObjectOutput) SetStorageClass(v string) *HeadObjectOutput {
	s.StorageClass = &v
	return s
}
1325278
func (m *MockStorageV1Interface) StorageClasses() v11.StorageClassInterface {
	ret := m.ctrl.Call(m, "StorageClasses")
	ret0, _ := ret[0].(v11.StorageClassInterface)
	return ret0
}
861004
func (s *S3Location) SetStorageClass(v string) *S3Location {
	s.StorageClass = &v
	return s
}
1112348
func Convert_storage_StorageClass_To_v1_StorageClass(in *storage.StorageClass, out *v1.StorageClass, s conversion.Scope) error {
	return autoConvert_storage_StorageClass_To_v1_StorageClass(in, out, s)
}
641988
func (s *CreateMultipartUploadInput) SetStorageClass(v string) *CreateMultipartUploadInput {
	s.StorageClass = &v
	return s
}
230467
func (e *lxdStorageProvider) ValidateConfig(cfg *storage.Config) error {
	lxdStorageConfig, err := newLXDStorageConfig(cfg.Attrs())
	if err != nil {
		return errors.Trace(err)
	}
	return ensureLXDStoragePool(e.env, lxdStorageConfig)
}