commit
3483e94539
@ -11,6 +11,7 @@ before_script:
|
|||||||
- sudo service influxdb start
|
- sudo service influxdb start
|
||||||
script:
|
script:
|
||||||
- export PATH=$PATH:$HOME/gopath/bin
|
- export PATH=$PATH:$HOME/gopath/bin
|
||||||
|
- ./deploy/check_gofmt.sh .
|
||||||
|
- go vet github.com/google/cadvisor/...
|
||||||
- godep go test -v -race -test.short github.com/google/cadvisor/...
|
- godep go test -v -race -test.short github.com/google/cadvisor/...
|
||||||
- godep go build github.com/google/cadvisor
|
- godep go build github.com/google/cadvisor
|
||||||
- go vet github.com/google/cadvisor/...
|
|
||||||
|
@ -79,7 +79,7 @@ func TestGetMachineinfo(t *testing.T) {
|
|||||||
NumCores: 8,
|
NumCores: 8,
|
||||||
MemoryCapacity: 31625871360,
|
MemoryCapacity: 31625871360,
|
||||||
DiskMap: map[string]info.DiskInfo{
|
DiskMap: map[string]info.DiskInfo{
|
||||||
"8:0": info.DiskInfo{
|
"8:0": {
|
||||||
Name: "sda",
|
Name: "sda",
|
||||||
Major: 8,
|
Major: 8,
|
||||||
Minor: 0,
|
Minor: 0,
|
||||||
|
@ -159,7 +159,7 @@ func (self *dockerContainerHandler) readLibcontainerConfig() (*libcontainer.Conf
|
|||||||
|
|
||||||
// Translate the old config into the new config.
|
// Translate the old config into the new config.
|
||||||
config = oldConfig.Config
|
config = oldConfig.Config
|
||||||
for ns, _ := range oldConfig.OldNamespaces {
|
for ns := range oldConfig.OldNamespaces {
|
||||||
config.Namespaces = append(config.Namespaces, libcontainer.Namespace{
|
config.Namespaces = append(config.Namespaces, libcontainer.Namespace{
|
||||||
Name: ns,
|
Name: ns,
|
||||||
})
|
})
|
||||||
|
19
deploy/check_gofmt.sh
Executable file
19
deploy/check_gofmt.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check usage.
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "USAGE: check_gofmt <source directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check formatting on non Godep'd code.
|
||||||
|
GOFMT_PATHS=$(find . -not -wholename "*.git*" -not -wholename "*Godeps*" -not -name "." -type d)
|
||||||
|
|
||||||
|
# Find any files with gofmt problems
|
||||||
|
BAD_FILES=$(gofmt -s -l $GOFMT_PATHS)
|
||||||
|
|
||||||
|
if [ -n "$BAD_FILES" ]; then
|
||||||
|
echo "The following files are not properly formatted:"
|
||||||
|
echo $BAD_FILES
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -76,7 +76,7 @@ func (self *Node) AddNodeCache(c Cache) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *Node) AddPerCoreCache(c Cache) {
|
func (self *Node) AddPerCoreCache(c Cache) {
|
||||||
for idx, _ := range self.Cores {
|
for idx := range self.Cores {
|
||||||
self.Cores[idx].Caches = append(self.Cores[idx].Caches, c)
|
self.Cores[idx].Caches = append(self.Cores[idx].Caches, c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ func serveDockerPage(m manager.Manager, w http.ResponseWriter, u *url.URL) error
|
|||||||
data = &pageData{
|
data = &pageData{
|
||||||
DisplayName: dockerContainersText,
|
DisplayName: dockerContainersText,
|
||||||
ParentContainers: []link{
|
ParentContainers: []link{
|
||||||
link{
|
{
|
||||||
Text: dockerContainersText,
|
Text: dockerContainersText,
|
||||||
Link: DockerPage,
|
Link: DockerPage,
|
||||||
}},
|
}},
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
package static
|
package static
|
||||||
|
|
||||||
const googleJsapiJs= `
|
const googleJsapiJs = `
|
||||||
if(!window['googleLT_']){window['googleLT_']=(new Date()).getTime();}if (!window['google']) {
|
if(!window['googleLT_']){window['googleLT_']=(new Date()).getTime();}if (!window['google']) {
|
||||||
window['google'] = {};
|
window['google'] = {};
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/cadvisor/info"
|
"github.com/google/cadvisor/info"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func createStats(id int32) *info.ContainerStats {
|
func createStats(id int32) *info.ContainerStats {
|
||||||
|
Loading…
Reference in New Issue
Block a user