
cAdvisor currently binds to all interfaces. Currently the only solution is to use iptables to block access to the port. We are better off making cAdvisor to bind to the interface that kubelet uses for better security. Fixes #11710
76 lines
2.3 KiB
Go
76 lines
2.3 KiB
Go
// +build windows
|
|
|
|
/*
|
|
Copyright 2015 The Kubernetes Authors.
|
|
|
|
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 (
|
|
"github.com/google/cadvisor/events"
|
|
cadvisorapi "github.com/google/cadvisor/info/v1"
|
|
cadvisorapiv2 "github.com/google/cadvisor/info/v2"
|
|
)
|
|
|
|
type cadvisorClient struct {
|
|
}
|
|
|
|
var _ Interface = new(cadvisorClient)
|
|
|
|
// New creates a cAdvisor and exports its API on the specified port if port > 0.
|
|
func New(address string, port uint, runtime string, rootPath string) (Interface, error) {
|
|
return &cadvisorClient{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) Start() error {
|
|
return nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) DockerContainer(name string, req *cadvisorapi.ContainerInfoRequest) (cadvisorapi.ContainerInfo, error) {
|
|
return cadvisorapi.ContainerInfo{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) {
|
|
return &cadvisorapi.ContainerInfo{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) {
|
|
return make(map[string]cadvisorapiv2.ContainerInfo), nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) MachineInfo() (*cadvisorapi.MachineInfo, error) {
|
|
return &cadvisorapi.MachineInfo{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) VersionInfo() (*cadvisorapi.VersionInfo, error) {
|
|
return &cadvisorapi.VersionInfo{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) ImagesFsInfo() (cadvisorapiv2.FsInfo, error) {
|
|
return cadvisorapiv2.FsInfo{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) RootFsInfo() (cadvisorapiv2.FsInfo, error) {
|
|
return cadvisorapiv2.FsInfo{}, nil
|
|
}
|
|
|
|
func (cu *cadvisorClient) WatchEvents(request *events.Request) (*events.EventChannel, error) {
|
|
return &events.EventChannel{}, nil
|
|
}
|