quota_unsupported.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 quota
  15. import (
  16. "errors"
  17. "k8s.io/apimachinery/pkg/api/resource"
  18. "k8s.io/kubernetes/pkg/util/mount"
  19. )
  20. // Dummy quota implementation for systems that do not implement support
  21. // for volume quotas
  22. var errNotImplemented = errors.New("not implemented")
  23. // SupportsQuotas -- dummy implementation
  24. func SupportsQuotas(_ mount.Interface, _ string) (bool, error) {
  25. return false, errNotImplemented
  26. }
  27. // AssignQuota -- dummy implementation
  28. func AssignQuota(_ mount.Interface, _ string, _ string, _ *resource.Quantity) error {
  29. return errNotImplemented
  30. }
  31. // GetConsumption -- dummy implementation
  32. func GetConsumption(_ string) (*resource.Quantity, error) {
  33. return nil, errNotImplemented
  34. }
  35. // GetInodes -- dummy implementation
  36. func GetInodes(_ string) (*resource.Quantity, error) {
  37. return nil, errNotImplemented
  38. }
  39. // ClearQuota -- dummy implementation
  40. func ClearQuota(_ mount.Interface, _ string) error {
  41. return errNotImplemented
  42. }