2016-11-01 20:01:27 +00:00
|
|
|
// +build !linux,!windows
|
2015-03-10 05:39:00 +00:00
|
|
|
|
|
|
|
/*
|
2016-06-03 00:25:58 +00:00
|
|
|
Copyright 2015 The Kubernetes Authors.
|
2015-03-10 05:39:00 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package cadvisor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
2015-04-09 22:38:36 +00:00
|
|
|
"github.com/google/cadvisor/events"
|
2015-10-16 03:00:28 +00:00
|
|
|
cadvisorapi "github.com/google/cadvisor/info/v1"
|
|
|
|
cadvisorapiv2 "github.com/google/cadvisor/info/v2"
|
2015-03-10 05:39:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type cadvisorUnsupported struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ Interface = new(cadvisorUnsupported)
|
|
|
|
|
2016-10-28 19:57:16 +00:00
|
|
|
func New(port uint, runtime string, rootPath string) (Interface, error) {
|
2015-03-10 05:39:00 +00:00
|
|
|
return &cadvisorUnsupported{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var unsupportedErr = errors.New("cAdvisor is unsupported in this build")
|
|
|
|
|
2015-05-15 20:24:24 +00:00
|
|
|
func (cu *cadvisorUnsupported) Start() error {
|
|
|
|
return unsupportedErr
|
|
|
|
}
|
|
|
|
|
2015-10-16 03:00:28 +00:00
|
|
|
func (cu *cadvisorUnsupported) DockerContainer(name string, req *cadvisorapi.ContainerInfoRequest) (cadvisorapi.ContainerInfo, error) {
|
|
|
|
return cadvisorapi.ContainerInfo{}, unsupportedErr
|
2015-03-10 05:39:00 +00:00
|
|
|
}
|
|
|
|
|
2015-10-16 03:00:28 +00:00
|
|
|
func (cu *cadvisorUnsupported) ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) {
|
2015-03-10 05:39:00 +00:00
|
|
|
return nil, unsupportedErr
|
|
|
|
}
|
|
|
|
|
2016-01-22 20:14:06 +00:00
|
|
|
func (cu *cadvisorUnsupported) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) {
|
|
|
|
return nil, unsupportedErr
|
|
|
|
}
|
|
|
|
|
2015-10-16 03:00:28 +00:00
|
|
|
func (cu *cadvisorUnsupported) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) {
|
2015-04-23 16:23:57 +00:00
|
|
|
return nil, unsupportedErr
|
|
|
|
}
|
|
|
|
|
2015-10-16 03:00:28 +00:00
|
|
|
func (cu *cadvisorUnsupported) MachineInfo() (*cadvisorapi.MachineInfo, error) {
|
2015-03-10 05:39:00 +00:00
|
|
|
return nil, unsupportedErr
|
|
|
|
}
|
2015-03-16 01:40:34 +00:00
|
|
|
|
2015-10-16 03:00:28 +00:00
|
|
|
func (cu *cadvisorUnsupported) VersionInfo() (*cadvisorapi.VersionInfo, error) {
|
2015-03-31 07:22:37 +00:00
|
|
|
return nil, unsupportedErr
|
|
|
|
}
|
|
|
|
|
2016-05-18 05:05:55 +00:00
|
|
|
func (cu *cadvisorUnsupported) ImagesFsInfo() (cadvisorapiv2.FsInfo, error) {
|
2015-10-16 03:00:28 +00:00
|
|
|
return cadvisorapiv2.FsInfo{}, unsupportedErr
|
2015-03-16 01:40:34 +00:00
|
|
|
}
|
2015-04-09 22:38:36 +00:00
|
|
|
|
2015-10-16 03:00:28 +00:00
|
|
|
func (cu *cadvisorUnsupported) RootFsInfo() (cadvisorapiv2.FsInfo, error) {
|
|
|
|
return cadvisorapiv2.FsInfo{}, unsupportedErr
|
2015-05-12 08:24:08 +00:00
|
|
|
}
|
|
|
|
|
2015-04-09 22:38:36 +00:00
|
|
|
func (cu *cadvisorUnsupported) WatchEvents(request *events.Request) (*events.EventChannel, error) {
|
|
|
|
return nil, unsupportedErr
|
2015-04-09 22:38:36 +00:00
|
|
|
}
|