(ctx context.Context, desc string, val **policy.OptionalBool, str string, changeCount *int)
| 283 | } |
| 284 | |
| 285 | func applyPolicyBoolPtr(ctx context.Context, desc string, val **policy.OptionalBool, str string, changeCount *int) error { |
| 286 | if str == "" { |
| 287 | // not changed |
| 288 | return nil |
| 289 | } |
| 290 | |
| 291 | if str == inheritPolicyString || str == defaultPolicyString { |
| 292 | *changeCount++ |
| 293 | |
| 294 | log(ctx).Infof(" - resetting %q to a default value inherited from parent.", desc) |
| 295 | |
| 296 | *val = nil |
| 297 | |
| 298 | return nil |
| 299 | } |
| 300 | |
| 301 | v, err := strconv.ParseBool(str) |
| 302 | if err != nil { |
| 303 | return errors.Wrapf(err, "can't parse the %q %q", desc, str) |
| 304 | } |
| 305 | |
| 306 | *changeCount++ |
| 307 | |
| 308 | log(ctx).Infof(" - setting %q to %v.", desc, v) |
| 309 | |
| 310 | ov := policy.OptionalBool(v) |
| 311 | *val = &ov |
| 312 | |
| 313 | return nil |
| 314 | } |
| 315 | |
| 316 | func supportedCompressionAlgorithms() []string { |
| 317 | var res []string |
no test coverage detected
searching dependent graphs…