Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1010094 Details for
Bug 1189840
[atomic] Negative DNS caching of the dockerd breaks docker pull
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
go reproducer
ping-after-iface-restart.go (text/plain), 1.44 KB, created by
Michal Minar
on 2015-04-02 09:51:45 UTC
(
hide
)
Description:
go reproducer
Filename:
MIME Type:
Creator:
Michal Minar
Created:
2015-04-02 09:51:45 UTC
Size:
1.44 KB
patch
obsolete
>package main > >import ( > "flag" > "fmt" > "net/http" > "os" > "os/exec" > "time" >) > >const IndexURL = "https://index.docker.io/v1" > >func die(msg string, args ...interface{}) { > fmt.Printf(msg+"\n", args...) > os.Exit(1) >} > >func ping() { > fmt.Printf("Pinging index %s\n", IndexURL) > req, err := http.NewRequest("GET", IndexURL+"/_ping", nil) > if err != nil { > die("Failed to create request.") > } > client := &http.Client{} > resp, err := client.Do(req) > if err != nil { > fmt.Printf("Failed to ping %s: %v\n", IndexURL, err) > } else { > version := resp.Header.Get("X-Docker-Registry-Version") > if version == "" { > version = "unknown" > } > fmt.Printf("Ping successful. StatusCode=%d, Registry Version: %s\n", resp.StatusCode, version) > } >} > >func main() { > var iface = flag.String("iface", "eth0", "The name of interface to restart.") > var once = flag.Bool("once", false, "Ping the index just once without any iface restart.") > flag.Parse() > > ping() > if !*once { > fmt.Printf("Shutting down interface %q.\n", *iface) > cmd := exec.Command("nmcli", "d", "disconnect", *iface) > if _, err := cmd.Output(); err != nil { > die("Failed to shut down interface %q: %v", *iface, err) > } > time.Sleep(time.Second * 1) > ping() > fmt.Printf("Bringing interface %q back up.\n", *iface) > cmd = exec.Command("nmcli", "d", "connect", *iface) > if _, err := cmd.Output(); err != nil { > die("Failed to bring interface %q up: %v", *iface, err) > } > time.Sleep(time.Second * 1) > ping() > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1189840
:
1010091
| 1010094 |
1010593