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

Method Set

cli/command/swarm/opts.go:142–152  ·  view source on GitHub ↗

Set parses a root rotation option

(value string)

Source from the content-addressed store, hash-verified

140
141// Set parses a root rotation option
142func (p *PEMFile) Set(value string) error {
143 contents, err := os.ReadFile(value)
144 if err != nil {
145 return err
146 }
147 if pemBlock, _ := pem.Decode(contents); pemBlock == nil {
148 return errors.New("file contents must be in PEM format")
149 }
150 p.contents, p.path = string(contents), value
151 return nil
152}
153
154// Contents returns the contents of the PEM file
155func (p *PEMFile) Contents() string {

Callers 15

TestParseExecFunction · 0.45
TestParseExecErrorsFunction · 0.45
TestContainerListErrorsFunction · 0.45
TestContainerListNoTruncFunction · 0.45
TestInspectErrorsFunction · 0.45
TestInspectFunction · 0.45
TestListErrorsFunction · 0.45
TestListFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestParseExecFunction · 0.36
TestParseExecErrorsFunction · 0.36
TestContainerListErrorsFunction · 0.36
TestContainerListNoTruncFunction · 0.36
TestInspectErrorsFunction · 0.36
TestInspectFunction · 0.36
TestListErrorsFunction · 0.36
TestListFunction · 0.36