MCPcopy
hub / github.com/containerd/containerd / getRuncOptions

Method getRuncOptions

client/task.go:171–188  ·  view source on GitHub ↗

getRuncOptions returns a reference to the runtime options for use by the task. If the set of options is not set by the opts passed into the NewTask creation this function first attempts to initialize the runtime options with a copy of the runtimeOptions, otherwise an empty set of options is assigned

()

Source from the content-addressed store, hash-verified

169// this function first attempts to initialize the runtime options with a copy of the runtimeOptions,
170// otherwise an empty set of options is assigned and returned
171func (i *TaskInfo) getRuncOptions() (*options.Options, error) {
172 if i.Options != nil {
173 opts, ok := i.Options.(*options.Options)
174 if !ok {
175 return nil, errors.New("invalid runtime v2 options format")
176 }
177 return opts, nil
178 }
179
180 opts := &options.Options{}
181 if i.runtimeOptions != nil && i.runtimeOptions.GetValue() != nil {
182 if err := typeurl.UnmarshalTo(i.runtimeOptions, opts); err != nil {
183 return nil, fmt.Errorf("failed to get runtime v2 options: %w", err)
184 }
185 }
186 i.Options = opts
187 return opts, nil
188}
189
190// Task is the executable object within containerd
191type Task interface {

Callers 8

WithNoNewKeyringFunction · 0.80
WithNoPivotRootFunction · 0.80
WithShimCgroupFunction · 0.80
WithUIDOwnerFunction · 0.80
WithGIDOwnerFunction · 0.80
WithTaskAPIEndpointFunction · 0.80
WithRestoreImagePathFunction · 0.80
WithRestoreWorkPathFunction · 0.80

Calls 1

GetValueMethod · 0.80

Tested by

no test coverage detected