Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions clair/layering.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ func (layers *layering) pushAll() error {
Format: "Docker",
}}

//FIXME Update to TLS
if config.IsLocal {
local := layers.hURL + "/" + layers.image.Hostname()
// Fixed local path issue that arose when docker image provided was tagged
// Deleted portion of local URL that was adding '/docker.io/'to the path
local := layers.hURL
payload.Layer.Path = strings.Replace(payload.Layer.Path, u.String(), local, 1)
payload.Layer.Path += "/layer.tar"
}
Expand Down
1 change: 0 additions & 1 deletion clair/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func blobsURI(registry string, name string, digest string) string {
}

func insertRegistryMapping(layerDigest string, registryURI string) {

hostURL, _ := dockerdist.GetPushURL(registryURI)
log.Debugf("Saving %s[%s]", layerDigest, hostURL.String())
registryMapping[layerDigest] = hostURL.String()
Expand Down
10 changes: 5 additions & 5 deletions docker/dockercli/dockercli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os"
"strings"
"syscall"

"github.com/artyom/untar"
"github.com/coreos/pkg/capnslog"
"github.com/docker/distribution"
Expand All @@ -27,7 +27,7 @@ var log = capnslog.NewPackageLogger("github.com/jgsqware/clairctl", "dockercli")

//GetLocalManifest retrieve manifest for local image
func GetLocalManifest(imageName string, withExport bool) (reference.NamedTagged, distribution.Manifest, error) {

n, err := reference.ParseNamed(imageName)
if err != nil {
return nil, nil, err
Expand All @@ -36,7 +36,7 @@ func GetLocalManifest(imageName string, withExport bool) (reference.NamedTagged,
if reference.IsNameOnly(n) {
image = reference.WithDefaultTag(n).(reference.NamedTagged)
} else {
image = n.(reference.NamedTagged)
image = n.(reference.NamedTagged)
}
if err != nil {
return nil, nil, err
Expand Down Expand Up @@ -73,7 +73,7 @@ func saveImage(imageName string, fo *os.File) error {

func save(imageName string) (distribution.Manifest, error) {
path := config.TmpLocal() + "/" + strings.Split(imageName, ":")[0] + "/blobs"

if _, err := os.Stat(path); os.IsExist(err) {
err := os.RemoveAll(path)
if err != nil {
Expand Down Expand Up @@ -125,7 +125,7 @@ func save(imageName string) (distribution.Manifest, error) {
if n == 0 {
break
}

// write a chunk
if _, err := fo.Write(buf[:n]); err != nil {
log.Error(err)
Expand Down
1 change: 0 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func restrictedFileServer(path string) http.Handler {
if _, err := os.Stat(path); os.IsNotExist(err) {
os.Mkdir(path, 0777)
}

fc := func(w http.ResponseWriter, r *http.Request) {
http.FileServer(http.Dir(path)).ServeHTTP(w, r)
}
Expand Down