id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c14500 |
g.Config.Windows.IgnoreFlushesDuringBoot = ignore
} | |
c14501 | = append(g.Config.Windows.LayerFolders, folder)
} | |
c14502 | ID: id,
IDType: idType,
}
g.initConfigWindows()
for i, device := range g.Config.Windows.Devices {
if device.ID == id {
g.Config.Windows.Devices[i].IDType = idType
return nil
}
}
g.Config.Windows.Devices = append(g.Config.Windows.Devices, device)
return nil
} | |
c14503 | g.initConfigWindows()
g.Config.Windows.Network = &network
} | |
c14504 |
g.Config.Windows.Network.AllowUnqualifiedDNSQuery = setting
} | |
c14505 | g.Config.Windows.Network.NetworkNamespace = path
} | |
c14506 | g.initConfigWindowsResources()
g.Config.Windows.Resources.CPU = &cpu
} | |
c14507 | g.Config.Windows.Resources.Memory.Limit = &limit
} | |
c14508 | g.initConfigWindowsResources()
g.Config.Windows.Resources.Storage = &storage
} | |
c14509 |
g.Config.Windows.Servicing = servicing
} | |
c14510 | t.Ok(found, fmt.Sprintf("devices %s %d:%d %s is set correctly", device.Type, *device.Major, *device.Minor, device.Access))
t.Diagnosticf("expect: %s %d:%d %s, actual: %s %d:%d %s",
device.Type, *device.Major, *device.Minor, device.Access, lnd[i-1].Type, *lnd[i-1].Major, *lnd[i-1].Minor, lnd[i-1].Access)
if !... | |
c14511 |
}
sep := Separator(os)
if !strings.HasSuffix(pathA, string(sep)) {
pathA = fmt.Sprintf("%s%c", pathA, sep)
}
if pathA == pathB {
return false, nil
}
return strings.HasPrefix(pathB, pathA), nil
} | |
c14512 |
if lip.Name == priority.Name {
found = true
t.Ok(lip.Priority == priority.Priority, fmt.Sprintf("network priority for %s is set correctly", priority.Name))
t.Diagnosticf("expect: %d, actual: %d", priority.Priority, lip.Priority)
}
}
t.Ok(found, fmt.Sprintf("network priority for %s found", priorit... | |
c14513 | *lm.Kernel)
t.Ok(*lm.KernelTCP == *config.Linux.Resources.Memory.KernelTCP, "memory kernelTCP is set correctly")
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.Memory.KernelTCP, *lm.Kernel)
t.Ok(*lm.Swappiness == *config.Linux.Resources.Memory.Swappiness, "memory swappiness is set correctly")
t.... | |
c14514 |
case "MUSTNOT":
fallthrough
case "SHALL":
fallthrough
case "SHALLNOT":
fallthrough
case "REQUIRED":
return Must, nil
}
var l Level
return l, fmt.Errorf("%q is not a valid compliance level", level)
} | |
c14515 | "RECOMMENDED"
case NotRecommended:
return "NOT RECOMMENDED"
case Must:
return "MUST"
case MustNot:
return "MUST NOT"
case Shall:
return "SHALL"
case ShallNot:
return "SHALL NOT"
case Required:
return "REQUIRED"
}
panic(fmt.Sprintf("%d is not a valid compliance level", level))
} | |
c14516 | err.Err.Error(), err.Reference)
} | |
c14517 | != nil {
return Runtime{}, err
}
r.BundleDir = bundleDir
return r, err
} | |
c14518 | set a nil config")
}
return g.SaveToFile(filepath.Join(r.bundleDir(), "config.json"), generate.ExportOptions{})
} | |
c14519 | _, err = r.stderr.Seek(0, io.SeekStart)
stderr, err2 = ioutil.ReadAll(r.stderr)
if err == nil && err2 != nil {
err = err2
}
return stdout, stderr, err
} | |
c14520 | }
var state rspecs.State
err = json.Unmarshal(out, &state)
if err != nil {
return rspecs.State{}, specerror.NewError(specerror.DefaultStateJSONPattern, fmt.Errorf("when serialized in JSON, the format MUST adhere to the default pattern"), rspecs.Version)
}
return state, err
} | |
c14521 | append(args, sig)
} else {
args = append(args, DefaultSignal)
}
cmd := exec.Command(r.RuntimeCommand, args...)
return execWithStderrFallbackToStdout(cmd)
} | |
c14522 | != "" {
args = append(args, r.ID)
}
cmd := exec.Command(r.RuntimeCommand, args...)
return execWithStderrFallbackToStdout(cmd)
} | |
c14523 | err2 := os.RemoveAll(r.bundleDir())
if err2 != nil && err == nil {
err = err2
}
}
return err
} | |
c14524 | if err2 != nil {
panic(err2.Error())
}
return rfcError
} | |
c14525 | level {
fmt.Println(e)
levelErrors.Warnings = append(levelErrors.Warnings, e)
continue
}
levelErrors.Error = multierror.Append(levelErrors.Error, err)
}
return levelErrors, nil
} | |
c14526 | len(arguments)
if numOfArgs == 6 || numOfArgs == 2 {
argStruct, err := parseArguments(arguments[1:])
if err != nil {
return err
}
newSyscall = newSyscallStruct(arguments[1], action, argStruct)
} else {
return fmt.Errorf("incorrect number of arguments to ParseSyscall: %d", numOfArgs)
}
descison, err :... | |
c14527 |
err = RemoveAllMatchingRules(config, defaultAction)
if err != nil {
return err
}
return nil
} | |
c14528 | return nil
}
defaultAction, err := parseAction(action)
if err != nil {
return err
}
config.DefaultAction = defaultAction
return nil
} | |
c14529 | Validator{
spec: spec,
bundlePath: bundlePath,
HostSpecific: hostSpecific,
platform: platform,
}, nil
} | |
c14530 | rspec.Version)
}
if !utf8.Valid(content) {
return Validator{}, fmt.Errorf("%q is not encoded in UTF-8", configPath)
}
var spec rspec.Spec
if err = json.Unmarshal(content, &spec); err != nil {
return Validator{}, err
}
return NewValidator(&spec, bundlePath, hostSpecific, platform)
} | |
c14531 | multierror.Append(errs, v.CheckLinux())
errs = multierror.Append(errs, v.CheckAnnotations())
if v.platform == "linux" || v.platform == "solaris" {
errs = multierror.Append(errs, v.CheckHooks())
}
return errs.ErrorOrNil()
} | |
c14532 | := semver.Parse("1.0.0-rc2") // config.json became config-schema.json in 1.0.0-rc2
if ver.Compare(configRenamedToConfigSchemaVersion) == -1 {
return "", fmt.Errorf("unsupported configuration version (older than %s)", configRenamedToConfigSchemaVersion)
}
return fmt.Sprintf(configSchemaTemplate, version), nil
} | |
c14533 | errs = multierror.Append(errs, err)
return errs
}
if !result.Valid() {
for _, resultError := range result.Errors() {
errs = multierror.Append(errs, errors.New(resultError.String()))
}
}
return errs
} | |
c14534 | errs = multierror.Append(errs, fmt.Errorf("validate currently only handles version %s, but the supplied configuration targets %s", rspec.Version, version))
}
return
} | |
c14535 | v.spec.Hooks.Prestart, v.HostSpecific))
errs = multierror.Append(errs, v.checkEventHooks("poststart", v.spec.Hooks.Poststart, v.HostSpecific))
errs = multierror.Append(errs, v.checkEventHooks("poststop", v.spec.Hooks.Poststop, v.HostSpecific))
}
return
} | |
c14536 | nil {
var rootfsPath string
if filepath.IsAbs(v.spec.Root.Path) {
rootfsPath = v.spec.Root.Path
} else {
rootfsPath = filepath.Join(v.bundlePath, v.spec.Root.Path)
}
absPath := filepath.Join(rootfsPath, process.Args[0])
fileinfo, err := os.Stat(absPath)
if os.IsNotExist(err) {
logrus.W... | |
c14537 | _, set := range owns {
if set == "effective" {
effective = true
continue
}
if set == "inheritable" {
inheritable = true
continue
}
if set == "permitted" {
permitted = true
continue
}
if set == "ambient" {
ambient = true
continue
}
}
if effective && !permitted... | |
c14538 | specerror.NewError(
specerror.PosixProcRlimitsErrorOnDup,
fmt.Errorf("rlimit can not contain the same type %q",
process.Rlimits[index].Type),
rspec.Version))
}
}
errs = multierror.Append(errs, v.rlimitValid(rlimit))
}
return
} | |
c14539 |
if err != nil {
errs = multierror.Append(errs, err)
continue
}
if nested {
if v.platform == "windows" && i < j {
errs = multierror.Append(errs,
specerror.NewError(
specerror.MountsDestOnWindowsNotNested,
fmt.Errorf("on Windows, %v nested within %v is forbidden",
mo... | |
c14540 | v.spec.Windows == nil {
errs = multierror.Append(errs,
specerror.NewError(
specerror.PlatformSpecConfOnWindowsSet,
fmt.Errorf("'windows' MUST be set when platform is `windows`"),
rspec.Version))
}
}
return
} | |
c14541 | for _, ni := range interfaces {
if prio.Name == ni.Name {
exist = true
break
}
}
if !exist {
errs = multierror.Append(errs, fmt.Errorf("interface %s does not exist currently", prio.Name))
}
}
}
for index := 0; index < len(r.Devices); index++ {
switch r.Devices[index].Type {
cas... | |
c14542 |
errs = multierror.Append(errs,
specerror.NewError(
specerror.AnnotationsKeyReversedDomain,
fmt.Errorf("key %q SHOULD be named using a reverse domain notation", key),
rspec.Version))
}
}
return
} | |
c14543 | {
return fmt.Errorf("%s is not supported on the current host", c)
}
isValid = true
break
}
}
if !isValid {
return fmt.Errorf("invalid capability: %s", c)
}
return nil
} | |
c14544 | return fmt.Errorf("Spec can't be nil")
}
return checkMandatory(v.spec)
} | |
c14545 | t.Diagnostic(err.Error())
return nil
}
t.Ok(lpd.Limit == config.Linux.Resources.Pids.Limit, "pids limit is set correctly")
t.Diagnosticf("expect: %d, actual: %d", config.Linux.Resources.Pids.Limit, lpd.Limit)
return nil
} | |
c14546 | = strings.ToLower(dialect)
delete(ds_adapters, dialect)
}
} | |
c14547 |
return me.dataset.Literal(buf, val)
} | |
c14548 | buf.Write(me.UpdateClause)
return nil
} | |
c14549 | me.SupportsInsertIgnoreSyntax() && o != nil {
buf.Write(me.InsertIgnoreClause)
} else {
buf.Write(me.InsertClause)
}
return nil
} | |
c14550 | buf.Write(me.DeleteClause)
return nil
} | |
c14551 |
}
if opts.Identity != empty_string {
buf.WriteRune(space_rune)
buf.WriteString(strings.ToUpper(opts.Identity))
buf.Write(me.IdentityFragment)
}
if opts.Cascade {
buf.Write(me.CascadeFragment)
} else if opts.Restrict {
buf.Write(me.RestrictFragment)
}
return nil
} | |
c14552 |
buf.WriteRune(left_paren_rune)
if err := me.Literal(buf, cols); err != nil {
return err
}
buf.WriteRune(right_paren_rune)
return nil
} | |
c14553 | if len(row) != rowLen {
return fmt.Errorf("Rows with different value length expected %d got %d", rowLen, len(row))
}
if err := me.Literal(buf, row); err != nil {
return err
}
if i < valueLen-1 {
buf.WriteRune(comma_rune)
buf.WriteRune(space_rune)
}
}
return nil
} | |
c14554 | buf.WriteRune(star_rune)
} else {
return me.Literal(buf, cols)
}
return nil
} | |
c14555 |
buf.Write(me.DistinctFragment)
return me.Literal(buf, cols)
} | |
c14556 | buf.Write(me.FromFragment)
return me.SourcesSql(buf, from)
}
return nil
} | |
c14557 | buf.WriteRune(space_rune)
return me.Literal(buf, from)
} | |
c14558 | condition.(JoinOnExpression).On()); err != nil {
return err
}
case JoinUsingExpression:
buf.WriteRune(left_paren_rune)
if err := me.Literal(buf, condition.(JoinUsingExpression).Using()); err != nil {
return err
}
buf.WriteRune(right_paren_rune)
}
}
}
}
return nil
} | |
c14559 | buf.Write(me.WhereFragment)
return me.Literal(buf, where)
}
return nil
} | |
c14560 | buf.Write(me.GroupByFragment)
return me.Literal(buf, groupBy)
}
return nil
} | |
c14561 | buf.Write(me.HavingFragment)
return me.Literal(buf, having)
}
return nil
} | |
c14562 | buf.Write(me.OrderByFragment)
return me.Literal(buf, order)
}
return nil
} | |
c14563 | buf.Write(me.LimitFragment)
return me.Literal(buf, limit)
}
return nil
} | |
c14564 | buf.Write(me.OffsetFragment)
return me.Literal(buf, offset)
}
return nil
} | |
c14565 | buf.WriteRune(right_paren_rune)
alias := dataset.GetClauses().Alias
if alias != nil {
buf.Write(me.AsFragment)
return me.Literal(buf, alias)
}
return nil
} | |
c14566 | buf.Write(me.Null)
return nil
} | |
c14567 | }
return me.Literal(buf, t.UTC().Format(me.TimeFormat))
} | |
c14568 | buf.WriteString(strconv.FormatFloat(f, 'f', -1, 64))
return nil
} | |
c14569 |
buf.WriteString(strconv.FormatInt(i, 10))
return nil
} | |
c14570 |
buf.Write(e)
} else {
buf.WriteRune(char)
}
}
buf.WriteRune(me.StringQuote)
return nil
} | |
c14571 | if e, ok := me.EscapedRunes[char]; ok {
buf.Write(e)
} else {
buf.WriteRune(char)
}
i++
bs = bs[l:]
}
buf.WriteRune(me.StringQuote)
return nil
} | |
c14572 | {
return err
}
if i < colLen-1 {
buf.WriteRune(comma_rune)
buf.WriteRune(space_rune)
}
}
return nil
} | |
c14573 | err := me.Literal(buf, update.Col()); err != nil {
return err
}
buf.WriteRune(me.SetOperatorRune)
return me.Literal(buf, update.Val())
} | |
c14574 | cte.Name()); err != nil {
return err
}
buf.Write(me.AsFragment)
if err := me.Literal(buf, cte.SubQuery()); err != nil {
return err
}
return nil
} | |
c14575 |
buf.Write(me.IntersectFragment)
case INTERSECT_ALL:
buf.Write(me.IntersectAllFragment)
}
return me.Literal(buf, compound.Rhs())
} | |
c14576 | cols(Star()),
}
ret.adapter = db.queryAdapter(ret)
return ret
} | |
c14577 | me.adapter = adapter
return me
} | |
c14578 | len(me.clauses.From.Columns()) > 0
} | |
c14579 | {
me.CurrentArgPosition++
me.args = append(me.args, i)
} | |
c14580 | if err != nil {
return nil, err
}
return &TxDatabase{Dialect: me.Dialect, Tx: tx, logger: me.logger}, nil
} | |
c14581 | return NewAdapter(me.Dialect, dataset)
} | |
c14582 | [query:=`%s` args:=%+v]", op, sql, args)
} else {
me.logger.Printf("[goqu] %s [query:=`%s`]", op, sql)
}
} else {
me.logger.Printf("[goqu] %s", op)
}
}
} | |
c14583 | return NewAdapter(me.Dialect, dataset)
} | |
c14584 | len(mapKeys), len(newMapKeys))
}
if !mapKeys.Equal(newMapKeys) {
return nil, nil, NewGoquError("Rows with different keys expected %s got %s", mapKeys.String(), newMapKeys.String())
}
rowVals := make([]interface{}, len(mapKeys))
for j, key := range mapKeys {
rowVals[j] = newRowValue.MapIndex(key)... | |
c14585 | := me.adapter.DefaultValuesSql(buf); err != nil {
return "", nil, NewGoquError(err.Error())
}
} else {
if err := me.adapter.InsertColumnsSql(buf, cols); err != nil {
return "", nil, NewGoquError(err.Error())
}
if err := me.adapter.InsertValuesSql(buf, values); err != nil {
return "", nil, NewGoquErro... | |
c14586 | := me.adapter.OnConflictSql(buf, c); err != nil {
return "", nil, err
}
if me.adapter.SupportsReturn() {
if err := me.adapter.ReturningSql(buf, me.clauses.Returning); err != nil {
return "", nil, err
}
} else if me.clauses.Returning != nil {
return "", nil, NewGoquError("Adapter does not support RETURNIN... | |
c14587 | {
return checkBoolExpType(EQ_OP, lhs, rhs, false)
} | |
c14588 | {
return checkBoolExpType(EQ_OP, lhs, rhs, true)
} | |
c14589 | {
return boolean{op: GT_OP, lhs: lhs, rhs: rhs}
} | |
c14590 | {
return boolean{op: GTE_OP, lhs: lhs, rhs: rhs}
} | |
c14591 | {
return boolean{op: LT_OP, lhs: lhs, rhs: rhs}
} | |
c14592 | {
return boolean{op: LTE_OP, lhs: lhs, rhs: rhs}
} | |
c14593 | == reflect.Slice {
return boolean{op: IN_OP, lhs: lhs, rhs: vals[0]}
}
return boolean{op: IN_OP, lhs: lhs, rhs: vals}
} | |
c14594 | == reflect.Slice {
return boolean{op: NOT_IN_OP, lhs: lhs, rhs: vals[0]}
}
return boolean{op: NOT_IN_OP, lhs: lhs, rhs: vals}
} | |
c14595 | {
return checkBoolExpType(IS_OP, lhs, val, false)
} | |
c14596 | {
return checkBoolExpType(IS_OP, lhs, val, true)
} | |
c14597 | {
return checkLikeExp(LIKE_OP, lhs, val, false)
} | |
c14598 | {
return checkLikeExp(I_LIKE_OP, lhs, val, false)
} | |
c14599 | checkLikeExp(LIKE_OP, lhs, val, true)
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.