contrib/podex: remove logging

This commit is contained in:
Johan Euphrosine 2015-01-09 12:13:25 +00:00
parent 49776d4d05
commit 686b187067

View File

@ -28,11 +28,9 @@ limitations under the License.
package main package main
import ( import (
"bytes"
"encoding/json" "encoding/json"
"flag" "flag"
"fmt" "fmt"
"io/ioutil"
"log" "log"
"net/http" "net/http"
"os" "os"
@ -215,11 +213,8 @@ func getImageMetadata(host, namespace, repo, tag string) (*imageMetadata, error)
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting json for image %q: %v", imageID, err) return nil, fmt.Errorf("error getting json for image %q: %v", imageID, err)
} }
data, _ := ioutil.ReadAll(resp.Body)
buf := bytes.NewBuffer(data)
log.Print(string(data))
var image imageMetadata var image imageMetadata
if err := json.NewDecoder(buf).Decode(&image); err != nil { if err := json.NewDecoder(resp.Body).Decode(&image); err != nil {
return nil, fmt.Errorf("error decoding image %q metadata: %v", imageID, err) return nil, fmt.Errorf("error decoding image %q metadata: %v", imageID, err)
} }
return &image, nil return &image, nil