id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c178000 |
}
res := "[" + s.transport.store.GraphDriverName() + "@" + s.transport.store.GraphRoot() + "+" + s.transport.store.RunRoot() + optionsList + "]"
if s.named != nil {
res = res + s.named.String()
}
if s.id != "" {
res = res + "@" + s.id
}
return res
} | |
c178001 | append(namespaces, storeSpec+s.named.Name()+":"+tagged.Tag())
}
components := strings.Split(s.named.Name(), "/")
for len(components) > 0 {
namespaces = append(namespaces, storeSpec+strings.Join(components, "/"))
components = components[:len(components)-1]
}
}
namespaces = append(namespaces, storeSpec)
... | |
c178002 | error) {
return pgzip.NewReader(r)
} | |
c178003 | ioutil.NopCloser(bzip2.NewReader(r)), nil
} | |
c178004 | return nil, err
}
return ioutil.NopCloser(r), nil
} | |
c178005 | := range compressionAlgos {
if bytes.HasPrefix(buffer[:n], algo.prefix) {
logrus.Debugf("Detected compression format %s", name)
decompressor = algo.decompressor
break
}
}
if decompressor == nil {
logrus.Debugf("No compression detected")
}
return decompressor, io.MultiReader(bytes.NewReader(buffer[:... | |
c178006 | != nil {
return nil, err
}
return &dockerImageDestination{
ref: ref,
c: c,
}, nil
} | |
c178007 | trying to cancel at %s", uploadLocation.String())
res2, err := d.c.makeRequestToResolvedURL(ctx, "DELETE", uploadLocation.String(), nil, nil, -1, v2Auth, extraScope)
if err != nil {
logrus.Debugf("Error trying to cancel an inadvertent upload: %s", err)
} else {
defer res2.Body.Close()
if res2.StatusCode... | |
c178008 | types.BICTransportScope{Opaque: reference.Domain(ref.ref)}
} | |
c178009 | reuse a blob).
return types.BICLocationReference{Opaque: ref.ref.Name()}
} | |
c178010 | return reference.ParseNormalizedNamed(lr.Opaque)
} | |
c178011 | auto-decompressing input")
}
defer uncompressedStream.Close()
// Copy the plain archive to the temporary file.
//
// TODO: This can take quite some time, and should ideally be cancellable
// using a context.Context.
if _, err := io.Copy(tarCopyFile, uncompressedStream); err != nil {
return nil, errors.... | |
c178012 | }
defer file.Close()
bytes, err := ioutil.ReadAll(file)
if err != nil {
return nil, err
}
return bytes, nil
} | |
c178013 | knownLayers, err := s.prepareLayerData(&tarManifest[0], &parsedConfig)
if err != nil {
s.cacheDataResult = err
return
}
// Success; commit.
s.tarManifest = &tarManifest[0]
s.configBytes = configBytes
s.configDigest = digest.FromBytes(configBytes)
s.orderedDiffIDList = parsedConfig.RootFS.DiffIDs
... | |
c178014 | if err := json.Unmarshal(bytes, &items); err != nil {
return nil, errors.Wrap(err, "Error decoding tar manifest.json")
}
return items, nil
} | |
c178015 | os.Remove(s.tarPath)
}
return nil
} | |
c178016 | := make(chan error, 1)
goroutineContext, goroutineCancel := context.WithCancel(ctx)
go imageLoadGoroutine(goroutineContext, c, reader, statusChannel)
return &daemonImageDestination{
ref: ref,
mustMatchRuntimeOS: mustMatchRuntimeOS,
Destination: tarfile.NewDestination(writer, namedTagge... | |
c178017 |
}
}()
resp, err := c.ImageLoad(ctx, reader, true)
if err != nil {
err = errors.Wrap(err, "Error saving image to docker engine")
return
}
defer resp.Body.Close()
} | |
c178018 |
}
if err := internal.ValidateImageName(image); err != nil {
return nil, err
}
return ociArchiveReference{file: file, resolvedFile: resolved, image: image}, nil
} | |
c178019 | {
return tempDirOCIRef{}, err
}
tempDirRef := tempDirOCIRef{tempDirectory: dir, ociRefExtracted: ociRef}
return tempDirRef, nil
} | |
c178020 | return tempDirOCIRef{}, errors.Wrapf(err, "error deleting temp directory %q", tempDirRef.tempDirectory)
}
return tempDirOCIRef{}, errors.Wrapf(err, "error untarring file %q", tempDirRef.tempDirectory)
}
return tempDirRef, nil
} | |
c178021 | primaryDigest,
uncompressedDigest: uncompressedDigest,
})
resLength := len(cs)
if resLength > maxCandidates {
resLength = maxCandidates
}
res := make([]types.BICReplacementCandidate, resLength)
for i := range res {
res[i] = cs[i].Candidate
}
return res
} | |
c178022 | &ostreeImageDestination{ref, "", manifestSchema{}, tmpDirPath, map[string]*blobToImport{}, "", 0, nil}, nil
} | |
c178023 | err // Coverage: This can fail only if os.Getwd() fails.
}
resolved, err = filepath.EvalSymlinks(resolved)
if err != nil {
return "", err
}
return filepath.Clean(resolved), nil
} | |
c178024 |
if versionExists {
contents, err := ioutil.ReadFile(d.ref.versionPath())
if err != nil {
return nil, err
}
// check if contents of version file is what we expect it to be
if string(contents) != version {
return nil, ErrNotContainerImageDir
}
} else {
return nil, ErrNotContai... | |
c178025 |
if err != nil {
return false, err
}
return len(files) == 0, nil
} | |
c178026 |
}
for _, file := range files {
if err := os.RemoveAll(filepath.Join(path, file.Name())); err != nil {
return err
}
}
return nil
} | |
c178027 | tagsHolder.Tags...)
link := res.Header.Get("Link")
if link == "" {
break
}
linkURLStr := strings.Trim(strings.Split(link, ";")[0], "<>")
linkURL, err := url.Parse(linkURLStr)
if err != nil {
return tags, err
}
// can be relative or absolute, but we only want the path (and I
// guess we're in... | |
c178028 | != nil {
logrus.Debugf("Error creating parent directories for %s, using a memory-only cache: %v", blobInfoCacheFilename, err)
return memory.New()
}
logrus.Debugf("Using blob info cache at %s", path)
return boltdb.New(path)
} | |
c178029 | with trivial (uncompressed, uncompressed) mappings
// when we already record a (compressed, uncompressed) pair.
if m, ok := mem.digestsByUncompressed[anyDigest]; ok && len(m) > 0 {
return anyDigest
}
return ""
} | |
c178030 | {
defer d.tempDirRef.deleteTempDir()
return d.unpackedDest.Close()
} | |
c178031 | {
return d.unpackedDest.PutManifest(ctx, m)
} | |
c178032 | := d.tempDirRef.tempDirectory
// path to save tarred up file
dst := d.ref.resolvedFile
return tarDirectory(src, dst)
} | |
c178033 |
// copies the contents of the directory to the tar file
// TODO: This can take quite some time, and should ideally be cancellable using a context.Context.
_, err = io.Copy(outFile, input)
return err
} | |
c178034 | like "a" matching an image by ID prefix when the input was actually meant to specify an image name.
if id == "" && len(ref) >= minimumTruncatedIDLength && !strings.ContainsAny(ref, "@:") {
if img, err := store.Image(ref); err == nil && img != nil && strings.HasPrefix(img.ID, ref) {
// It's a truncated version of... | |
c178035 | := range list.Manifests {
if d.Platform.Architecture == wantedArch && d.Platform.OS == wantedOS {
return d.Digest, nil
}
}
return "", fmt.Errorf("no image found in manifest list for architecture %s, OS %s", wantedArch, wantedOS)
} | |
c178036 | probably along with manifest list editing.
blob, mt, err := src.Manifest(ctx)
if err != nil {
return "", err
}
if mt != manifest.DockerV2ListMediaType {
return "", fmt.Errorf("Internal error: Trying to select an image from a non-manifest-list manifest type %s", mt)
}
return chooseDigestFromManifestList(sys, ... | |
c178037 | fsLayers, history, architecture)
if err != nil {
return nil, err
}
return &manifestSchema1{m: m}, nil
} | |
c178038 | == digest.Canonical {
return d, nil
}
}
if err := s.ensureManifestIsLoaded(ctx); err != nil {
return "", err
}
return manifest.Digest(s.cachedManifest)
} | |
c178039 | getPath, headers, nil, v2Auth, nil)
if err != nil {
return err
}
defer get.Body.Close()
manifestBody, err := ioutil.ReadAll(get.Body)
if err != nil {
return err
}
switch get.StatusCode {
case http.StatusOK:
case http.StatusNotFound:
return errors.Errorf("Unable to delete %v. Image may not exist or is no... | |
c178040 | := Schema1{
Name: name,
Tag: tag,
Architecture: architecture,
FSLayers: fsLayers,
History: history,
SchemaVersion: 1,
}
if err := s1.initialize(); err != nil {
return nil, err
}
return &s1, nil
} | |
c178041 | if err := json.Unmarshal([]byte(h.V1Compatibility), &m.ExtractedV1Compatibility[i]); err != nil {
return errors.Wrapf(err, "Error parsing v2s1 history entry %d", i)
}
}
return nil
} | |
c178042 | "id")
delete(raw, "parent")
delete(raw, "parent_id")
delete(raw, "layer_id")
delete(raw, "throwaway")
delete(raw, "Size")
// Add the history and rootfs information.
rootfs, err := json.Marshal(rootFS)
if err != nil {
return nil, errors.Errorf("error encoding rootfs information %#v: %v", rootFS, err)
}
rawR... | |
c178043 |
}
manifest, err = sig.Payload()
if err != nil {
// Coverage: This should never happen, libtrust's Payload() can fail only if joseBase64UrlDecode() fails, on a string
// that libtrust itself has josebase64UrlEncode()d
return "", err
}
}
return digest.FromBytes(manifest), nil
} | |
c178044 |
if err != nil {
return false, err
}
return expectedDigest == actualDigest, nil
} | |
c178045 | deserialize using v2s1 as per https://github.com/docker/distribution/blob/master/manifests.go#L108
// and https://github.com/docker/distribution/blob/master/manifest/schema1/manifest.go#L50
//
// Crane registries can also return "text/plain", or pretty much anything else depending on a file extension “recognized... | |
c178046 | individual manifests is not implemented")
default: // Note that this may not be reachable, NormalizedMIMEType has a default for unknown values.
return nil, fmt.Errorf("Unimplemented manifest MIME type %s", mt)
}
} | |
c178047 | nil, err
}
return dirReference{path: path, resolvedPath: resolved}, nil
} | |
c178048 | the digest identification?
return filepath.Join(ref.path, digest.Hex())
} | |
c178049 | fmt.Sprintf("signature-%d", index+1))
} | |
c178050 | reqChan: make(chan workRequest),
}
p.SetSize(n)
return p
} | |
c178051 | return &closureWorker{
processor: f,
}
})
} | |
c178052 |
request.interruptFunc()
return nil, ErrJobTimedOut
}
select {
case payload, open = <-request.retChan:
if !open {
return nil, ErrWorkerClosed
}
case <-tout.C:
request.interruptFunc()
return nil, ErrJobTimedOut
}
tout.Stop()
return payload, nil
} | |
c178053 | newWorkerWrapper(p.reqChan, p.ctor()))
}
// Asynchronously stop all workers > N
for i := n; i < lWorkers; i++ {
p.workers[i].stop()
}
// Synchronously wait for all workers > N to stop
for i := n; i < lWorkers; i++ {
p.workers[i].join()
}
// Remove stopped workers from slice
p.workers = p.workers[:n]
} | |
c178054 | p.workerMut.Unlock()
return len(p.workers)
} | |
c178055 | {
return Point{int(r.x), int(r.y)}
} | |
c178056 | + int(r.width), int(r.y) + int(r.height)}
} | |
c178057 |
cvBox.center.y = C.float(box.center.Y)
cvBox.size.width = C.float(box.size.Width)
cvBox.size.height = C.float(box.size.Height)
return cvBox
} | |
c178058 | i, p := range pts {
outPts[i].X = float32(p.x)
outPts[i].Y = float32(p.y)
}
return outPts
} | |
c178059 | C.int(c2), C.int(c3), C.int(c4))
return uint32(rv)
} | |
c178060 | unsafe.Pointer(imgRed),
unsafe.Pointer(imgAlpha),
unsafe.Pointer(dst),
)
} | |
c178061 | unsafe.Pointer(imgGreen),
unsafe.Pointer(imgRed),
unsafe.Pointer(imgAlpha),
)
} | |
c178062 |
unsafe.Pointer(src2),
C.double(beta),
C.double(gamma),
unsafe.Pointer(dst),
)
} | |
c178063 | AndWithMask(src1, src2, dst, nil)
} | |
c178064 | unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178065 | AndScalarWithMask(src, value, dst, nil)
} | |
c178066 |
C.cvAndS(
unsafe.Pointer(src),
(C.CvScalar)(value),
unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178067 | OrWithMask(src1, src2, dst, nil)
} | |
c178068 | unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178069 | OrScalarWithMask(src, value, dst, nil)
} | |
c178070 |
C.cvOrS(
unsafe.Pointer(src),
(C.CvScalar)(value),
unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178071 | unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178072 | AddScalarWithMask(src, value, dst, nil)
} | |
c178073 |
C.cvAddS(
unsafe.Pointer(src),
(C.CvScalar)(value),
unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178074 | SubtractWithMask(src1, src2, dst, nil)
} | |
c178075 |
unsafe.Pointer(src1),
unsafe.Pointer(src2),
unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178076 | SubScalarWithMask(src, value, dst, nil)
} | |
c178077 |
C.cvSubS(
unsafe.Pointer(src),
(C.CvScalar)(value),
unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178078 | *IplImage) {
SubScalarWithMaskRev(value, src, dst, nil)
} | |
c178079 | (C.CvScalar)(value),
unsafe.Pointer(dst),
unsafe.Pointer(mask),
)
} | |
c178080 | unsafe.Pointer(src2),
unsafe.Pointer(dst),
)
} | |
c178081 | {
C.cvAbsDiffS(
unsafe.Pointer(src),
unsafe.Pointer(dst),
(C.CvScalar)(value),
)
} | |
c178082 |
unsafe.Pointer(src),
(*C.CvScalar)(&mean),
(*C.CvScalar)(&stdDev),
unsafe.Pointer(mask),
)
return mean, stdDev
} | |
c178083 |
C.int(seq_flags),
C.size_t(unsafe.Sizeof(Seq{})),
C.size_t(elem_size),
C.cvCreateMemStorage(C.int(0)),
))
} | |
c178084 | {
return unsafe.Pointer(C.cvSeqPush((*C.struct_CvSeq)(seq), element))
} | |
c178085 | C.cvSeqPop((*C.struct_CvSeq)(seq), element)
} | |
c178086 | {
return unsafe.Pointer((C.cvSeqPushFront((*C.struct_CvSeq)(seq), element)))
} | |
c178087 | C.cvSeqPopFront((*C.struct_CvSeq)(seq), element)
} | |
c178088 | (unsafe.Pointer)(C.cvGetSeqElem(
(*C.struct_CvSeq)(seq),
C.int(index),
))
} | |
c178089 |
C.cvSeqRemove((*C.struct_CvSeq)(seq), C.int(index))
} | |
c178090 | *Config) {
c.delay = delay
}
} | |
c178091 | config.delay * (1 << (n - 1))
} | |
c178092 |
return fmt.Sprintf("All attempts fail:\n%s", strings.Join(logWithNumber, "\n"))
} | |
c178093 | = append(r.args, args...)
return r
} | |
c178094 | r.Body(strings.NewReader(body))
} | |
c178095 | r.Body(bytes.NewReader(body))
} | |
c178096 | *RequestBuilder {
r.body = body
return r
} | |
c178097 |
// slow case.
s = fmt.Sprint(value)
}
if r.opts == nil {
r.opts = make(map[string]string, 1)
}
r.opts[key] = s
return r
} | |
c178098 | = make(map[string]string, 1)
}
r.headers[name] = value
return r
} | |
c178099 | r.shell.url, r.command, r.args...)
req.Opts = r.opts
req.Headers = r.headers
req.Body = r.body
return req.Send(&r.shell.httpcli)
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.