mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
Merge pull request #3848 from dgageot/remove-more-dead-code-pkg
Remove dead or redundant code (packages)
This commit is contained in:
commit
45e299ce91
@ -108,7 +108,7 @@ func main() {
|
|||||||
d := time.Date(int(t.tmYear+1900), time.Month(t.tmMon+1), int(t.tmMday), int(t.tmHour), int(t.tmMin), int(t.tmSec), 0, time.UTC)
|
d := time.Date(int(t.tmYear+1900), time.Month(t.tmMon+1), int(t.tmMday), int(t.tmHour), int(t.tmMin), int(t.tmSec), 0, time.UTC)
|
||||||
log.Printf("Setting system clock to %s", d)
|
log.Printf("Setting system clock to %s", d)
|
||||||
tv := syscall.Timeval{
|
tv := syscall.Timeval{
|
||||||
Sec: int64(d.Unix()),
|
Sec: d.Unix(),
|
||||||
Usec: 0, // the RTC only has second granularity
|
Usec: 0, // the RTC only has second granularity
|
||||||
}
|
}
|
||||||
if err = syscall.Settimeofday(&tv); err != nil {
|
if err = syscall.Settimeofday(&tv); err != nil {
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
"github.com/containerd/containerd/cio"
|
"github.com/containerd/containerd/cio"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ func prepareProcess(pid int, runtime Runtime) error {
|
|||||||
move = true
|
move = true
|
||||||
}
|
}
|
||||||
if move {
|
if move {
|
||||||
if err := netlink.LinkSetNsPid(link, int(pid)); err != nil {
|
if err := netlink.LinkSetNsPid(link, pid); err != nil {
|
||||||
return fmt.Errorf("Cannot move interface %s into namespace: %v", iface.Name, err)
|
return fmt.Errorf("Cannot move interface %s into namespace: %v", iface.Name, err)
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stderr, "Moved interface %s to pid %d\n", iface.Name, pid)
|
fmt.Fprintf(os.Stderr, "Moved interface %s to pid %d\n", iface.Name, pid)
|
||||||
|
@ -114,7 +114,7 @@ func ringBufferHandler(ringSize, chanSize int, logCh chan logEntry, queryMsgChan
|
|||||||
conn: msg.conn,
|
conn: msg.conn,
|
||||||
output: make(chan *logEntry, chanSize),
|
output: make(chan *logEntry, chanSize),
|
||||||
err: nil,
|
err: nil,
|
||||||
exitOnEOF: (msg.mode == logDump),
|
exitOnEOF: msg.mode == logDump,
|
||||||
}
|
}
|
||||||
go logQueryHandler(&l)
|
go logQueryHandler(&l)
|
||||||
if msg.mode == logDumpFollow || msg.mode == logFollow {
|
if msg.mode == logDumpFollow || msg.mode == logFollow {
|
||||||
|
@ -211,6 +211,6 @@ func assertContent(t *testing.T, path, expected string) {
|
|||||||
t.Fatalf("can't read %v: %v", path, err)
|
t.Fatalf("can't read %v: %v", path, err)
|
||||||
}
|
}
|
||||||
if !bytes.Equal(file, []byte(expected)) {
|
if !bytes.Equal(file, []byte(expected)) {
|
||||||
t.Fatalf("%v: expected %v but has %v", path, string(expected), string(file))
|
t.Fatalf("%v: expected %v but has %v", path, expected, string(file))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ func (p *ProviderAWS) String() string {
|
|||||||
func (p *ProviderAWS) Probe() bool {
|
func (p *ProviderAWS) Probe() bool {
|
||||||
// Getting the hostname should always work...
|
// Getting the hostname should always work...
|
||||||
_, err := awsGet(metaDataURL + "hostname")
|
_, err := awsGet(metaDataURL + "hostname")
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the AWS specific and generic userdata
|
// Extract gets both the AWS specific and generic userdata
|
||||||
|
@ -31,7 +31,7 @@ func (p *ProviderDigitalOcean) String() string {
|
|||||||
func (p *ProviderDigitalOcean) Probe() bool {
|
func (p *ProviderDigitalOcean) Probe() bool {
|
||||||
// Getting the index should always work...
|
// Getting the index should always work...
|
||||||
_, err := digitalOceanGet(digitalOceanMetaDataURL)
|
_, err := digitalOceanGet(digitalOceanMetaDataURL)
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the DigitalOcean specific and generic userdata
|
// Extract gets both the DigitalOcean specific and generic userdata
|
||||||
|
@ -33,7 +33,7 @@ func (p *ProviderGCP) String() string {
|
|||||||
func (p *ProviderGCP) Probe() bool {
|
func (p *ProviderGCP) Probe() bool {
|
||||||
// Getting the hostname should always work...
|
// Getting the hostname should always work...
|
||||||
_, err := gcpGet(instance + "hostname")
|
_, err := gcpGet(instance + "hostname")
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the GCP specific and generic userdata
|
// Extract gets both the GCP specific and generic userdata
|
||||||
|
@ -28,7 +28,7 @@ func (p *ProviderHetzner) String() string {
|
|||||||
func (p *ProviderHetzner) Probe() bool {
|
func (p *ProviderHetzner) Probe() bool {
|
||||||
// Getting the hostname should always work...
|
// Getting the hostname should always work...
|
||||||
_, err := hetznerGet(metaDataURL + "hostname")
|
_, err := hetznerGet(metaDataURL + "hostname")
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the Hetzner specific and generic userdata
|
// Extract gets both the Hetzner specific and generic userdata
|
||||||
|
@ -33,7 +33,7 @@ func (p *ProviderMetaldata) Probe() bool {
|
|||||||
log.Println("Metaldata: Probing...")
|
log.Println("Metaldata: Probing...")
|
||||||
// Getting the hostname should always work...
|
// Getting the hostname should always work...
|
||||||
_, err := metaldataGet(metaldataMetaDataURL + "hostname")
|
_, err := metaldataGet(metaldataMetaDataURL + "hostname")
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the Metaldata specific and generic userdata
|
// Extract gets both the Metaldata specific and generic userdata
|
||||||
|
@ -27,7 +27,7 @@ func (p *ProviderOpenstack) String() string {
|
|||||||
func (p *ProviderOpenstack) Probe() bool {
|
func (p *ProviderOpenstack) Probe() bool {
|
||||||
// Getting the hostname should always work...
|
// Getting the hostname should always work...
|
||||||
_, err := openstackGet(metaDataURL + "hostname")
|
_, err := openstackGet(metaDataURL + "hostname")
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the OpenStack specific and generic userdata
|
// Extract gets both the OpenStack specific and generic userdata
|
||||||
|
@ -31,7 +31,7 @@ func (p *ProviderVultr) String() string {
|
|||||||
func (p *ProviderVultr) Probe() bool {
|
func (p *ProviderVultr) Probe() bool {
|
||||||
// Getting the index should always work...
|
// Getting the index should always work...
|
||||||
_, err := vultrGet(vultrMetaDataURL)
|
_, err := vultrGet(vultrMetaDataURL)
|
||||||
return (err == nil)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract gets both the Vultr specific and generic userdata
|
// Extract gets both the Vultr specific and generic userdata
|
||||||
|
Loading…
Reference in New Issue
Block a user