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

Method ToStoreTLSData

cli/context/tlsdata.go:25–42  ·  view source on GitHub ↗

ToStoreTLSData converts TLSData to the store representation

()

Source from the content-addressed store, hash-verified

23
24// ToStoreTLSData converts TLSData to the store representation
25func (data *TLSData) ToStoreTLSData() *store.EndpointTLSData {
26 if data == nil {
27 return nil
28 }
29 result := store.EndpointTLSData{
30 Files: make(map[string][]byte),
31 }
32 if data.CA != nil {
33 result.Files[caKey] = data.CA
34 }
35 if data.Cert != nil {
36 result.Files[certKey] = data.Cert
37 }
38 if data.Key != nil {
39 result.Files[keyKey] = data.Key
40 }
41 return &result
42}
43
44// LoadTLSData loads TLS data from the store
45func LoadTLSData(s store.Reader, contextName, endpointName string) (*TLSData, error) {

Callers 2

resolveDefaultContextFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected