Revert "Fix working_set calculation in kubelet"

This commit is contained in:
Antoine Pelisse
2016-07-20 17:04:32 -07:00
committed by GitHub
parent b829d4d4ef
commit b681b17bb0
124 changed files with 2354 additions and 6213 deletions

View File

@@ -94,9 +94,6 @@ type dockerContainerHandler struct {
// Filesystem handler.
fsHandler common.FsHandler
// The IP address of the container
ipAddress string
ignoreMetrics container.MetricSet
// thin pool watcher
@@ -225,22 +222,6 @@ func newDockerContainerHandler(
handler.networkMode = ctnr.HostConfig.NetworkMode
handler.deviceID = ctnr.GraphDriver.Data["DeviceId"]
// Obtain the IP address for the contianer.
// If the NetworkMode starts with 'container:' then we need to use the IP address of the container specified.
// This happens in cases such as kubernetes where the containers doesn't have an IP address itself and we need to use the pod's address
ipAddress := ctnr.NetworkSettings.IPAddress
networkMode := string(ctnr.HostConfig.NetworkMode)
if ipAddress == "" && strings.HasPrefix(networkMode, "container:") {
containerId := strings.TrimPrefix(networkMode, "container:")
c, err := client.ContainerInspect(context.Background(), containerId)
if err != nil {
return nil, fmt.Errorf("failed to inspect container %q: %v", id, err)
}
ipAddress = c.NetworkSettings.IPAddress
}
handler.ipAddress = ipAddress
if !ignoreMetrics.Has(container.DiskUsageMetrics) {
handler.fsHandler = &dockerFsHandler{
fsHandler: common.NewFsHandler(time.Minute, rootfsStorageDir, otherStorageDir, fsInfo),
@@ -431,10 +412,6 @@ func (self *dockerContainerHandler) GetContainerLabels() map[string]string {
return self.labels
}
func (self *dockerContainerHandler) GetContainerIPAddress() string {
return self.ipAddress
}
func (self *dockerContainerHandler) ListProcesses(listType container.ListType) ([]int, error) {
return containerlibcontainer.GetProcesses(self.cgroupManager)
}