MCPcopy Index your code
hub / github.com/docker/cli / importEndpointTLS

Function importEndpointTLS

cli/context/store/store.go:510–527  ·  view source on GitHub ↗
(tlsData *ContextTLSData, tlsPath string, data []byte)

Source from the content-addressed store, hash-verified

508}
509
510func importEndpointTLS(tlsData *ContextTLSData, tlsPath string, data []byte) error {
511 parts := strings.SplitN(strings.TrimPrefix(tlsPath, "tls/"), "/", 2)
512 if len(parts) != 2 {
513 // TLS endpoints require archived file directory with 2 layers
514 // i.e. tls/{endpointName}/{fileName}
515 return errors.New("archive format is invalid")
516 }
517
518 epName := parts[0]
519 fileName := parts[1]
520 if _, ok := tlsData.Endpoints[epName]; !ok {
521 tlsData.Endpoints[epName] = EndpointTLSData{
522 Files: map[string][]byte{},
523 }
524 }
525 tlsData.Endpoints[epName].Files[fileName] = data
526 return nil
527}
528
529type contextdir string
530

Callers 2

importTarFunction · 0.85
importZipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…