Skip to content

Instantly share code, notes, and snippets.

View jhadvig's full-sized avatar
:octocat:
OpenShift

Jakub Hadvig jhadvig

:octocat:
OpenShift
View GitHub Profile
package main
import (
"fmt"
"bytes"
"github.com/fsouza/go-dockerclient"
)
func main() {
endpoint := "unix:///var/run/docker.sock"
package main
import (
"fmt"
"bytes"
"github.com/fsouza/go-dockerclient"
)
func main() {
endpoint := "unix:///var/run/docker.sock"
package main
import (
"fmt"
"github.com/fsouza/go-dockerclient"
"bytes"
)
func main() {
endpoint := "unix:///var/run/docker.sock"
package main
import (
"io"
"log"
"net/http"
"github.com/fsouza/go-dockerclient"
"io/ioutil"
)
// handleContainerLogs handles containerLogs request againts the Kubelet
func (s *Server) handleContainerLogs(w http.ResponseWriter, req *http.Request) {
defer req.Body.Close()
u, err := url.ParseRequestURI(req.RequestURI)
if err != nil {
s.error(w, err)
return
}
@jhadvig
jhadvig / stream
Created September 30, 2014 08:21
func (r *Request) Stream() (io.Reader, error) {
response, err := r.c.httpClient.Do(req)
if err != nil {
return nil, err
}
return response.Body, err
}
location := &url.URL{
Path: "/proxy/minion/" + buildHost + "/containerLogs/" + buildPodID + "/" + buildContainerName,
}
package main
import (
"io"
"log"
"net/http"
"github.com/fsouza/go-dockerclient"
"io/ioutil"
"fmt"
)
package main
import (
"io"
"log"
"net/http"
"github.com/fsouza/go-dockerclient"
"io/ioutil"
"fmt"
)
package buildlog
import (
// "fmt"
// "reflect"
"testing"
kubeapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
kubeclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client"