quota_unsupported.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // +build !linux
  2. /*
  3. Copyright 2018 The Kubernetes Authors.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. package fsquota
  15. import (
  16. "errors"
  17. "k8s.io/utils/mount"
  18. "k8s.io/apimachinery/pkg/api/resource"
  19. "k8s.io/apimachinery/pkg/types"
  20. )
  21. // Dummy quota implementation for systems that do not implement support
  22. // for volume quotas
  23. var errNotImplemented = errors.New("not implemented")
  24. // SupportsQuotas -- dummy implementation
  25. func SupportsQuotas(_ mount.Interface, _ string) (bool, error) {
  26. return false, errNotImplemented
  27. }
  28. // AssignQuota -- dummy implementation
  29. func AssignQuota(_ mount.Interface, _ string, _ types.UID, _ *resource.Quantity) error {
  30. return errNotImplemented
  31. }
  32. // GetConsumption -- dummy implementation
  33. func GetConsumption(_ string) (*resource.Quantity, error) {
  34. return nil, errNotImplemented
  35. }
  36. // GetInodes -- dummy implementation
  37. func GetInodes(_ string) (*resource.Quantity, error) {
  38. return nil, errNotImplemented
  39. }
  40. // ClearQuota -- dummy implementation
  41. func ClearQuota(_ mount.Interface, _ string) error {
  42. return errNotImplemented
  43. }