cadvisor_unsupported.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // +build !linux,!windows linux,!cgo
  2. /*
  3. Copyright 2015 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 cadvisor
  15. import (
  16. "errors"
  17. "github.com/google/cadvisor/events"
  18. cadvisorapi "github.com/google/cadvisor/info/v1"
  19. cadvisorapiv2 "github.com/google/cadvisor/info/v2"
  20. )
  21. type cadvisorUnsupported struct {
  22. }
  23. var _ Interface = new(cadvisorUnsupported)
  24. func New(imageFsInfoProvider ImageFsInfoProvider, rootPath string, cgroupsRoots []string, usingLegacyStats bool) (Interface, error) {
  25. return &cadvisorUnsupported{}, nil
  26. }
  27. var unsupportedErr = errors.New("cAdvisor is unsupported in this build")
  28. func (cu *cadvisorUnsupported) Start() error {
  29. return unsupportedErr
  30. }
  31. func (cu *cadvisorUnsupported) DockerContainer(name string, req *cadvisorapi.ContainerInfoRequest) (cadvisorapi.ContainerInfo, error) {
  32. return cadvisorapi.ContainerInfo{}, unsupportedErr
  33. }
  34. func (cu *cadvisorUnsupported) ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) {
  35. return nil, unsupportedErr
  36. }
  37. func (cu *cadvisorUnsupported) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) {
  38. return nil, unsupportedErr
  39. }
  40. func (cu *cadvisorUnsupported) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) {
  41. return nil, unsupportedErr
  42. }
  43. func (cu *cadvisorUnsupported) MachineInfo() (*cadvisorapi.MachineInfo, error) {
  44. return nil, unsupportedErr
  45. }
  46. func (cu *cadvisorUnsupported) VersionInfo() (*cadvisorapi.VersionInfo, error) {
  47. return nil, unsupportedErr
  48. }
  49. func (cu *cadvisorUnsupported) ImagesFsInfo() (cadvisorapiv2.FsInfo, error) {
  50. return cadvisorapiv2.FsInfo{}, unsupportedErr
  51. }
  52. func (cu *cadvisorUnsupported) RootFsInfo() (cadvisorapiv2.FsInfo, error) {
  53. return cadvisorapiv2.FsInfo{}, unsupportedErr
  54. }
  55. func (cu *cadvisorUnsupported) WatchEvents(request *events.Request) (*events.EventChannel, error) {
  56. return nil, unsupportedErr
  57. }
  58. func (cu *cadvisorUnsupported) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error) {
  59. return cadvisorapiv2.FsInfo{}, nil
  60. }