anchor
dict
positive
dict
negative
dict
{ "audio": "", "image": "", "text": "func (v *volumeAttachmentPlan) PlanInfo() (VolumeAttachmentPlanInfo, error) {\n\tif v.doc.PlanInfo == nil {\n\t\treturn VolumeAttachmentPlanInfo{},", "video": "" }
{ "audio": "", "image": "", "text": " errors.NotProvisionedf(\"volume attachment plan %q on %q\", v.doc.Volume, v.doc.Machine)\n\t}\n\treturn *v.doc.PlanInfo, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " rhs.ImportPath) {\n\t\treturn false\n\t}\n\tif !(v.Directory == rhs.Directory) {\n\t\treturn false\n\t}\n\tif !(v.ThriftFilePath == rhs.ThriftFilePath) {\n\t\treturn false\n\t}\n\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (v *volumeAttachment) Volume() names.VolumeTag", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn names.NewVolumeTag(v.doc.Volume)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn names.StorageTag{}, errors.NewNotAssigned(nil, msg)\n\t}\n\treturn names.NewStorageTag(v.doc.StorageId), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (v *volumeAttachment) Info() (VolumeAttachmentInfo, error) {\n\tif v.doc.Info == nil {\n\t\thost := storageAttachmentHost(v.doc.Host)\n\t\treturn VolumeAttachmentInfo{},", "video": "" }
{ "audio": "", "image": "", "text": " errors.NotProvisionedf(\"volume attachment %q on %q\", v.doc.Volume, names.ReadableString(host))\n\t}\n\treturn *v.doc.Info, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn applicationCharmConfigKey(a.doc.Name, a.doc.CharmURL)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (v *volumeAttachment) Params() (VolumeAttachmentParams, bool) {\n\tif v.doc.Params == nil {\n\t\treturn", "video": "" }
{ "audio": "", "image": "", "text": " VolumeAttachmentParams{}, false\n\t}\n\treturn *v.doc.Params, true\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\t\tv.Set(\"limit\", strconv.Itoa(*opt.Limit))\n\t\t}\n\t\tif opt.Offset != nil {\n\t\t\tv.Set(\"offset\", strconv.Itoa(*opt.Offset))\n\t\t}\n\t\tif params := v.Encode(); params != \"\" {\n\t\t\tspotifyURL += \"?\" + params\n\t\t}\n\t}\n\n\tvar result SavedTrackPage\n\n\...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) Volume(tag names.VolumeTag)", "video": "" }
{ "audio": "", "image": "", "text": " (Volume, error) {\n\tv, err := getVolumeByTag(sb.mb, tag)\n\treturn v, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tsb.sql.WriteString(`\n\t\tLEFT OUTER JOIN dashboard folder on folder.id = dashboard.folder_id\n\t\tLEFT OUTER JOIN dashboard_tag on dashboard.id = dashboard_tag.dashboard_id`)\n\n\tsb.sql.WriteString(\" ORDER BY dashboard.title ASC\")\n\treturn sb.sql.String(), sb.params\n}"...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) StorageInstanceVolume(tag names.StorageTag)", "video": "" }
{ "audio": "", "image": "", "text": " (Volume, error) {\n\tv, err := sb.storageInstanceVolume(tag)\n\treturn v, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tsb.sql.WriteString(`\n\t\tLEFT OUTER JOIN dashboard folder on folder.id = dashboard.folder_id\n\t\tLEFT OUTER JOIN dashboard_tag on dashboard.id = dashboard_tag.dashboard_id`)\n\n\tsb.sql.WriteString(\" ORDER BY dashboard.title ASC\")\n\treturn sb.sql.String(), sb.params\n}"...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) VolumeAttachment(host names.Tag, volume names.VolumeTag) (VolumeAttachment, error) {\n\tcoll, cleanup := sb.mb.db().GetCollection(volumeAttachmentsC)\n\tdefer cleanup()\n\n\tvar att volumeAttachment\n\terr := coll.FindId(volumeAttachmentId(host.Id(), ...
{ "audio": "", "image": "", "text": "\n\tif err == mgo.ErrNotFound {\n\t\treturn nil, errors.NotFoundf(\"volume %q on %q\", volume.Id(), names.ReadableString(host))\n\t} else if err != nil {\n\t\treturn nil, errors.Annotatef(err, \"getting volume %q on %q\", volume.Id(), names.ReadableString(host))\n\t}\n\treturn...
{ "audio": "", "image": "", "text": " *v1alpha1.VolumeAttachment, s conversion.Scope) error {\n\treturn autoConvert_storage_VolumeAttachment_To_v1alpha1_VolumeAttachment(in, out, s)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) MachineVolumeAttachments(machine names.MachineTag) ([]VolumeAttachment, error) {\n\tattachments, err := sb.volumeAttachments(bson.D{{\"hostid\", machine.Id()}})\n\tif err != nil {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn nil, errors.Annotatef(err, \"getting volume attachments for machine %q\", machine.Id())\n\t}\n\treturn attachments, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(sb *sandbox) {\n\t\tsb.config.originResolvConfPath = path\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) UnitVolumeAttachments(unit names.UnitTag) ([]VolumeAttachment, error) {\n\tattachments, err := sb.volumeAttachments(bson.D{{\"hostid\", unit.Id()}})\n\tif err != nil {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn nil, errors.Annotatef(err, \"getting volume attachments for unit %q\", unit.Id())\n\t}\n\treturn attachments, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(sb *sandbox) {\n\t\tsb.config.originResolvConfPath = path\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) VolumeAttachments(volume names.VolumeTag) ([]VolumeAttachment, error) {\n\tattachments, err := sb.volumeAttachments(bson.D{{\"volumeid\", volume.Id()}})\n\tif err != nil {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn nil, errors.Annotatef(err, \"getting volume attachments for volume %q\", volume.Id())\n\t}\n\treturn attachments, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(sb *sandbox) {\n\t\tsb.config.originResolvConfPath = path\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) VolumeAttachmentPlans(volume names.VolumeTag) ([]VolumeAttachmentPlan, error) {\n\tattachmentPlans, err := sb.volumeAttachmentPlans(bson.D{{\"volumeid\", volume.Id()}})\n\tif err != nil {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn nil, errors.Annotatef(err, \"getting volume attachment plans for volume %q\", volume.Id())\n\t}\n\treturn attachmentPlans, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(sb *sandbox) {\n\t\tsb.config.originResolvConfPath = path\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) removeMachineVolumesOps(m *Machine) ([]txn.Op, error) {\n\t// A machine cannot transition to Dead if it has any detachable storage\n\t// attached, so any attachments are for machine-bound storage.\n\t//\n\t// Even if a volume is \"non-detachable\", th...
{ "audio": "", "image": "", "text": "\t\t\tRemove: true,\n\t\t})\n\t}\n\tfor _, v := range machineVolumes {\n\t\tif v.doc.StorageId != \"\" {\n\t\t\t// The volume is assigned to a storage instance;\n\t\t\t// make sure we also remove the storage instance.\n\t\t\t// There should be no storage attachments remaining,...
{ "audio": "", "image": "", "text": "\n\t\tif utilfeature.DefaultFeatureGate.Enabled(features.StorageObjectInUseProtection) {\n\t\t\tif volume.ObjectMeta.DeletionTimestamp != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tnodeAffinityValid := true\n\t\tif node != nil {\n\t\t\t// Scheduler path, check that the PV ...
{ "audio": "", "image": "", "text": "func isDetachableVolumeTag(db Database, tag names.VolumeTag) (bool, error) {\n\tdoc, err := getVolumeDocByTag(db, tag)\n\tif err != nil {", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn false, errors.Trace(err)\n\t}\n\treturn detachableVolumeDoc(&doc), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tvar w wrap\n\tvar err error\n\tif err = json.Unmarshal(body, &w); err != nil {\n\t\treturn err\n\t}\n\tu.Tag = w.Tag\n\tswitch u.Tag {\n\tcase \"metadata\":\n\t\tu.Metadata, err = IsMediaMetadataFromJSON(body)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn ...
{ "audio": "", "image": "", "text": "func isDetachableVolumePool(im *storageBackend, pool string) (bool, error) {\n\t_, provider, _, err := poolStorageProvider(im, pool)\n\tif err != nil {\n\t\treturn false, errors.Trace(err)\n\t}\n\tif provider.Scope() == storage.ScopeMachine {\n\t\t// Any storage created by a m...
{ "audio": "", "image": "", "text": " create non-\n\t\t// persistent storage. None of the storage providers do\n\t\t// this, so we assume it will be persistent for now.\n\t\t//\n\t\t// TODO(axw) get rid of the Persistent field from Volume\n\t\t// and Filesystem. We only need to care whether the\n\t\t// storage is...
{ "audio": "", "image": "", "text": " errors.Trace(err)\n\t}\n\n\tif err := env.SetConfig(cfg); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tmodelTag := names.NewModelTag(cfg.UUID())\n\tenv.resourceGroup = resourceGroupName(modelTag, cfg.Name())\n\tenv.envName = cfg.Name()\n\n\t// We need a determini...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) DetachVolume(host names.Tag, volume names.VolumeTag) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"detaching volume %s from %s\", volume.Id(), names.ReadableString(host))\n\t// If the volume is backing a filesystem, the volume cannot be deta...
{ "audio": "", "image": "", "text": " errors.Trace(err)\n\t\t}\n\t\tif !detachable {\n\t\t\treturn nil, errors.New(\"volume is not detachable\")\n\t\t}\n\t\tif plans, err := sb.machineVolumeAttachmentPlans(host, volume); err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t} else {\n\t\t\tif len(plans) > 0 {\n\...
{ "audio": "", "image": "", "text": " == volume.AttachedServerID {\n\t\t\tglog.V(4).Infof(\"Disk %s is already attached to instance %s\", volumeID, instanceID)\n\t\t\treturn volume.ID, nil\n\t\t}\n\t\tglog.V(2).Infof(\"Disk %s is attached to a different instance (%s), detaching\", volumeID, volume.AttachedServerI...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) RemoveVolumeAttachment(host names.Tag, volume names.VolumeTag) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"removing attachment of volume %s from %s\", volume.Id(), names.ReadableString(host))\n\tbuildTxn := func(attempt int) ([]txn.Op, err...
{ "audio": "", "image": "", "text": " {\n\t\t\t// We only ignore IsNotFound on attempts after the\n\t\t\t// first, since we expect the volume attachment to\n\t\t\t// be there initially.\n\t\t\treturn nil, jujutxn.ErrNoOperations\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif attac...
{ "audio": "", "image": "", "text": " == volume.AttachedServerID {\n\t\t\tglog.V(4).Infof(\"Disk %s is already attached to instance %s\", volumeID, instanceID)\n\t\t\treturn volume.ID, nil\n\t\t}\n\t\tglog.V(2).Infof(\"Disk %s is attached to a different instance (%s), detaching\", volumeID, volume.AttachedServerI...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) DestroyVolume(tag names.VolumeTag) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"destroying volume %s\", tag.Id())\n\tif _, err := sb.VolumeFilesystem(tag); err == nil {\n\t\treturn &errContainsFilesystem{errors.New(\"volume contains filesys...
{ "audio": "", "image": "", "text": " {\n\t\t\t// On the first attempt, we expect it to exist.\n\t\t\treturn nil, jujutxn.ErrNoOperations\n\t\t} else if err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif volume.doc.StorageId != \"\" {\n\t\t\treturn nil, errors.Errorf(\n\t\t\t\t\"volume is assigned t...
{ "audio": "", "image": "", "text": " m.Id(), subnetID)\n\tif err != nil && !errors.IsNotFound(err) {\n\t\treturn nil, errors.Trace(err)\n\t}\n\treturn ports, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) RemoveVolume(tag names.VolumeTag) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"removing volume %s\", tag.Id())\n\tbuildTxn := func(attempt int) ([]txn.Op, error) {\n\t\tvolume, err := sb.Volume(tag)", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tif errors.IsNotFound(err) {\n\t\t\treturn nil, jujutxn.ErrNoOperations\n\t\t} else if err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif volume.Life() != Dead {\n\t\t\treturn nil, errors.New(\"volume is not dead\")\n\t\t}\n\t\treturn sb.removeVolumeOps(tag)...
{ "audio": "", "image": "", "text": "\tsb.sql.WriteString(`\n\t\tLEFT OUTER JOIN dashboard folder on folder.id = dashboard.folder_id\n\t\tLEFT OUTER JOIN dashboard_tag on dashboard.id = dashboard_tag.dashboard_id`)\n\n\tsb.sql.WriteString(\" ORDER BY dashboard.title ASC\")\n\treturn sb.sql.String(), sb.params\n}"...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) addVolumeOps(params VolumeParams, hostId string) ([]txn.Op, names.VolumeTag, error) {\n\tparams, err := sb.volumeParamsWithDefaults(params)\n\tif err != nil {\n\t\treturn nil, names.VolumeTag{}, errors.Trace(err)\n\t}\n\tdetachable, err := isDetachabl...
{ "audio": "", "image": "", "text": " provisioned volume into the\n\t\t// model. Set provisioned info rather than params, and set\n\t\t// the status to \"detached\".\n\t\tstatusDoc.Status = status.Detached\n\t\tdoc.Info = params.volumeInfo\n\t} else {\n\t\t// Every new volume is created with one attachment.\n\t\t...
{ "audio": "", "image": "", "text": "\t\t}\n\t}\n\tfor filesystemTag := range params.filesystemAttachments {\n\t\tfilesystem, err := sb.Filesystem(filesystemTag)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif params, ok := filesystem.Params(); ok {\n\t\t\tpools.Add(params.Pool)\n\t\t} el...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) validateVolumeParams(params VolumeParams, machineId string) (maybeMachineId string, _ error) {\n\tif err := validateStoragePool(sb, params.Pool, storage.StorageKindBlock, &machineId); err != nil {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn \"\", err\n\t}\n\tif params.Size == 0 {\n\t\treturn \"\", errors.New(\"invalid size 0\")\n\t}\n\treturn machineId, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t}\n\t}\n\tfor filesystemTag := range params.filesystemAttachments {\n\t\tfilesystem, err := sb.Filesystem(filesystemTag)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif params, ok := filesystem.Params(); ok {\n\t\t\tpools.Add(params.Pool)\n\t\t} el...
{ "audio": "", "image": "", "text": "func ParseVolumeAttachmentId(id string) (names.Tag, names.VolumeTag, error) {\n\tfields := strings.SplitN(id, \":\", 2)\n\tisValidHost := names.IsValidMachine(fields[0]) || names.IsValidUnit(fields[0])\n\tif len(fields) != 2 || !isValidHost || !names.IsValidVolume(fields[1]) {...
{ "audio": "", "image": "", "text": "\n\tif names.IsValidMachine(fields[0]) {\n\t\thostTag = names.NewMachineTag(fields[0])\n\t} else {\n\t\thostTag = names.NewUnitTag(fields[0])\n\t}\n\tvolumeTag := names.NewVolumeTag(fields[1])\n\treturn hostTag, volumeTag, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " := range serviceaccount.Secrets {\n\t\tnames.Insert(secret.Name)\n\t}\n\treturn names\n}", "video": "" }
{ "audio": "", "image": "", "text": "func createMachineVolumeAttachmentsOps(hostId string, attachments []volumeAttachmentTemplate) []txn.Op {\n\tops := make([]txn.Op, len(attachments))\n\tfor i, attachment := range attachments {\n\t\tparamsCopy := attachment.params\n\t\tops[i] = txn.Op{\n\t\t\tC: volumeAttac...
{ "audio": "", "image": "", "text": "\n\t\t}\n\t\tif attachment.existing {\n\t\t\tops = append(ops, txn.Op{\n\t\t\t\tC: volumesC,\n\t\t\t\tId: attachment.tag.Id(),\n\t\t\t\tAssert: txn.DocExists,\n\t\t\t\tUpdate: bson.D{{\"$inc\", bson.D{{\"attachmentcount\", 1}}}},\n\t\t\t})\n\t\t}\n\t}\n\treturn ops\n}...
{ "audio": "", "image": "", "text": "\tC: firewallRulesC,\n\t\t\t\tId: serviceStr,\n\t\t\t\tAssert: txn.DocExists,\n\t\t\t\tUpdate: bson.D{\n\t\t\t\t\t{\"$set\", bson.D{{\"whitelist-cidrs\", rule.WhitelistCIDRs}}},\n\t\t\t\t},\n\t\t\t}, model.assertActiveOp()}\n\t\t} else {\n\t\t\tdoc.WhitelistCIDRS = ru...
{ "audio": "", "image": "", "text": "func setMachineVolumeAttachmentInfo(sb *storageBackend, machineId string, attachments map[names.VolumeTag]VolumeAttachmentInfo) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"cannot set volume attachment info for machine %s\", machineId)\n\tmachineTag := names.NewMach...
{ "audio": "", "image": "", "text": "\t\tif err := sb.setVolumeAttachmentInfo(machineTag, volumeTag, info); err != nil {\n\t\t\treturn errors.Annotatef(err, \"setting attachment info for volume %s\", volumeTag.Id())\n\t\t}\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif unitInfo.MachineId == machineId {\n\t\t\t\t\tfilesystemAttachmentInfo.UnitId = unitId\n\t\t\t\t\tfilesystemAttachmentInfo.UnitStorageAttachment = unitInfo\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\thaveMachines = true\n\t\t\tfilesystemAttachmentInfos = append(filesystemA...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) SetVolumeAttachmentInfo(hostTag names.Tag, volumeTag names.VolumeTag, info VolumeAttachmentInfo) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"cannot set info for volume attachment %s:%s\", volumeTag.Id(), hostTag.Id())\n\tv, err := sb.Volum...
{ "audio": "", "image": "", "text": "\t\treturn errors.Trace(err)\n\t}\n\t// Also ensure the machine is provisioned.\n\tif _, ok := hostTag.(names.MachineTag); ok {\n\t\tm, err := sb.machine(hostTag.Id())\n\t\tif err != nil {\n\t\t\treturn errors.Trace(err)\n\t\t}\n\t\tif _, err := m.InstanceId(); err != nil {\n\...
{ "audio": "", "image": "", "text": "\tif err != nil {\n\t\treturn names.FilesystemTag{}, state.FilesystemInfo{}, errors.Trace(err)\n\t}\n\treturn filesystemTag, state.FilesystemInfo{\n\t\tv.Info.Size,\n\t\t\"\", // pool is set by state\n\t\tv.Info.FilesystemId,\n\t}, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) RemoveVolumeAttachmentPlan(hostTag names.Tag, volume names.VolumeTag) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"removing attachment plan of volume %s from machine %s\", volume.Id(), hostTag.Id())\n\tbuildTxn := func(attempt int) ([]txn.O...
{ "audio": "", "image": "", "text": " only have one plan for a volume\n\t\tif plans != nil && len(plans) > 0 {\n\t\t\tif plans[0].Life() != Dying {\n\t\t\t\treturn nil, jujutxn.ErrNoOperations\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, jujutxn.ErrNoOperations\n\t\t}\n\t\treturn removeVolumeAttachmentPlanOps(hostTa...
{ "audio": "", "image": "", "text": " == volume.AttachedServerID {\n\t\t\tglog.V(4).Infof(\"Disk %s is already attached to instance %s\", volumeID, instanceID)\n\t\t\treturn volume.ID, nil\n\t\t}\n\t\tglog.V(2).Infof(\"Disk %s is attached to a different instance (%s), detaching\", volumeID, volume.AttachedServerI...
{ "audio": "", "image": "", "text": "func removeVolumeAttachmentPlanOps(hostTag names.Tag, volume names.VolumeTag) []txn.Op {\n\tdetachOps := detachVolumeOps(hostTag, volume)\n\tremoveOps := []txn.Op{{\n\t\tC: volumeAttachmentPlanC,\n\t\tId: volumeAttachmentId(hostTag.Id(),", "video": "" }
{ "audio": "", "image": "", "text": " volume.Id()),\n\t\tAssert: bson.D{{\"life\", Dying}},\n\t\tRemove: true,\n\t}}\n\tremoveOps = append(removeOps, detachOps...)\n\treturn removeOps\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tC: firewallRulesC,\n\t\t\t\tId: serviceStr,\n\t\t\t\tAssert: txn.DocExists,\n\t\t\t\tUpdate: bson.D{\n\t\t\t\t\t{\"$set\", bson.D{{\"whitelist-cidrs\", rule.WhitelistCIDRs}}},\n\t\t\t\t},\n\t\t\t}, model.assertActiveOp()}\n\t\t} else {\n\t\t\tdoc.WhitelistCIDRS = ru...
{ "audio": "", "image": "", "text": "func setProvisionedVolumeInfo(sb *storageBackend, volumes map[names.VolumeTag]VolumeInfo) error {\n\tfor volumeTag, info := range volumes {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tif err := sb.SetVolumeInfo(volumeTag, info); err != nil {\n\t\t\treturn errors.Trace(err)\n\t\t}\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(sb *sandbox) {\n\t\tsb.config.originResolvConfPath = path\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (sb *storageBackend) SetVolumeInfo(tag names.VolumeTag, info VolumeInfo) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"cannot set info for volume %q\", tag.Id())\n\tif info.VolumeId == \"\" {\n\t\treturn errors.New(\"volume ID not set\")\n\t}\n\t// TODO(axw) we ...
{ "audio": "", "image": "", "text": " = true\n\t\t} else {\n\t\t\t// Ensure immutable properties do not change.\n\t\t\toldInfo, err := v.Info()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif err := validateVolumeInfoChange(info, oldInfo); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n...
{ "audio": "", "image": "", "text": "\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tvar info jujuclient.RegistrationInfo\n\tif _, err := asn1.Unmarshal(decodedData, &info); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tparams.controllerAddrs = info.Addrs\n\tparams.userTag = names.NewUser...
{ "audio": "", "image": "", "text": "func (sb *storageBackend) AllVolumes() ([]Volume, error) {\n\tvolumes, err := sb.volumes(nil)\n\tif err != nil {\n\t\treturn", "video": "" }
{ "audio": "", "image": "", "text": " nil, errors.Annotate(err, \"cannot get volumes\")\n\t}\n\treturn volumesToInterfaces(volumes), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(sb *sandbox) {\n\t\tsb.config.originResolvConfPath = path\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func watchMachinesLoop(context updaterContext, machinesWatcher watcher.StringsWatcher) (err error) {\n\tp := &updater{\n\t\tcontext: context,\n\t\tmachines: make(map[names.MachineTag]chan struct{}),\n\t\tmachineDead: make(chan machine),\n\t}\n\tdefer func() {\n\t\t// TO...
{ "audio": "", "image": "", "text": "\t\tcase <-p.context.dying():\n\t\t\treturn p.context.errDying()\n\t\tcase ids, ok := <-machinesWatcher.Changes():\n\t\t\tif !ok {\n\t\t\t\treturn errors.New(\"machines watcher closed\")\n\t\t\t}\n\t\t\ttags := make([]names.MachineTag, len(ids))\n\t\t\tfor i := range ids {\n\t...
{ "audio": "", "image": "", "text": " make(chan bool, 1),\n\t}\n\tp.routines = append(p.routines, newRoutine)\n\tp.waitGroup.Add(1)\n\tGo(func() {\n\t\tgoroutine(newRoutine.stop)\n\t\tp.waitGroup.Done()\n\t})\n\tp.lock.Unlock()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func runMachine(context machineContext, m machine, changed <-chan struct{}, died chan<- machine, clock clock.Clock) {\n\tdefer func() {\n\t\t// We can't just send on the died channel because the\n\t\t// central loop might be trying to write to us on the\n\t\t// changed channel...
{ "audio": "", "image": "", "text": " m:\n\t\t\t\treturn\n\t\t\tcase <-changed:\n\t\t\t}\n\t\t}\n\t}()\n\tif err := machineLoop(context, m, changed, clock); err != nil {\n\t\tcontext.kill(err)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " connect back to us and send us traffic. We hide the host:port\n\t// so that service instances on remote machines don't try to connect back\n\t// and don't try to send Hyperbahn traffic on this connection.\n\tctx, cancel := NewContextBuilder(timeout).HideListeningOnOutbound()....
{ "audio": "", "image": "", "text": "func pollInstanceInfo(context machineContext, m machine) (instInfo instanceInfo, err error) {\n\tinstInfo = instanceInfo{}\n\tinstId, err := m.InstanceId()\n\t// We can't ask the machine for its addresses if it isn't provisioned yet.\n\tif params.IsCodeNotProvisioned(err) {\n\...
{ "audio": "", "image": "", "text": " currentInstStatus {\n\t\t\tlogger.Infof(\"machine %q instance status changed from %q to %q\", m.Id(), currentInstStatus, instInfo.status)\n\t\t\tif err = m.SetInstanceStatus(instInfo.status.Status, instInfo.status.Message, nil); err != nil {\n\t\t\t\tlogger.Errorf(\"cannot se...
{ "audio": "", "image": "", "text": "\t\tif statusInfo.Status != status.Error && statusInfo.Status != status.ProvisioningError {\n\t\t\tcontinue\n\t\t}\n\t\t// Transient errors are marked as such in the status data.\n\t\tif transient, ok := result.Data[\"transient\"].(bool); !ok || !transient {\n\t\t\tcontinue\n\...
{ "audio": "", "image": "", "text": "func addressesEqual(a0, a1 []network.Address) bool {\n\tif len(a0) != len(a1) {\n\t\tlogger.Tracef(\"address lists have different lengths %d != %d for %v != %v\",\n\t\t\tlen(a0), len(a1), a0, a1)\n\t\treturn false\n\t}\n\n\tca0 := make([]network.Address, len(a0))\n\tcopy(ca0, ...
{ "audio": "", "image": "", "text": "\tfor i := range ca0 {\n\t\tif ca0[i] != ca1[i] {\n\t\t\tlogger.Tracef(\"address entry at offset %d has a different value for %v != %v\",\n\t\t\t\ti, ca0, ca1)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn false\n\t}\n\t//if the first argument is a context, yes\n\tif a0.Elem() == contextType {\n\t\treturn true\n\t}\n\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *modelStateCollection) Count() (int, error) {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " c.WriteCollection.Find(bson.D{{\"model-uuid\", c.modelUUID}}).Count()\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(_ *Client, c *RemoteContext) error {\n\t\tc.Snapshotter = snapshotterName\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *modelStateCollection) Insert(docs ...interface{}) error {\n\tvar mungedDocs []interface{}\n\tfor _, doc := range docs {\n\t\tmungedDoc, err :=", "video": "" }
{ "audio": "", "image": "", "text": " mungeDocForMultiModel(doc, c.modelUUID, modelUUIDRequired)\n\t\tif err != nil {\n\t\t\treturn errors.Trace(err)\n\t\t}\n\t\tmungedDocs = append(mungedDocs, mungedDoc)\n\t}\n\treturn c.WriteCollection.Insert(mungedDocs...)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tchunks := make([]map[string]interface{}, num_chunk)\n\tfor i := 0; i < num_chunk; i++ {\n\t\tadd := make([]Document, 0, chunk_size)\n\t\tfor j := 0; j < chunk_size; j++ {\n\t\t\tif doc_counter >= docs_len {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tadd = append(add, docs[doc_counter]...
{ "audio": "", "image": "", "text": "func (c *modelStateCollection) UpdateId(id interface{}, update interface{}) error {\n\tif sid, ok := id.(string); ok {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn c.WriteCollection.UpdateId(ensureModelUUID(c.modelUUID, sid), update)\n\t}\n\treturn c.WriteCollection.UpdateId(bson.D{{\"_id\", id}}, update)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tdefer c.Unlock()\n\n\tfor id := range c.cache {\n\t\tif _, ok := liveContainers[id]; !ok {\n\t\t\tdelete(c.cache, id)\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func getAllUnitNames(st *state.State, units, services []string) (result []names.Tag, err error) {\n\tvar leaders map[string]string\n\tgetLeader := func(appName string) (string, error) {\n\t\tif leaders == nil {\n\t\t\tvar err error\n\t\t\tleaders, err = st.ApplicationLeaders()...
{ "audio": "", "image": "", "text": "\n\t\tservice, err := st.Application(name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tunits, err := service.AllUnits()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, unit := range units {\n\t\t\tunitsSet.Add(unit.Name())\n\t\t}\n\t}\n\tfor _, unitN...
{ "audio": "", "image": "", "text": " hash.String()\n\t\tunit, ok := hashToUnit[stringHash]\n\t\tif !ok {\n\t\t\tlog.Errorf(\"did not find Unit %v in list of all units\", stringHash)\n\t\t\treturn nil\n\t\t}\n\t\treturn unit\n\t}\n\n\tunits := make([]job.Unit, 0)\n\tfor _, dir := range res.Node.Nodes {\n\t\tu, er...
{ "audio": "", "image": "", "text": "func (a *ActionAPI) Run(run params.RunParams) (results params.ActionResults, err error) {\n\tif err := a.checkCanAdmin(); err != nil {\n\t\treturn results, err\n\t}\n\n\tif err := a.check.ChangeAllowed(); err != nil {\n\t\treturn results, errors.Trace(err)\n\t}\n\n\tunits, err...
{ "audio": "", "image": "", "text": " results, errors.Errorf(\"invalid machine id %q\", machineId)\n\t\t}\n\t\tmachines[i] = names.NewMachineTag(machineId)\n\t}\n\n\tactionParams := a.createActionsParams(append(units, machines...), run.Commands, run.Timeout)\n\n\treturn queueActions(a, actionParams)\n}", "video...
{ "audio": "", "image": "", "text": "\tfor i, pool := range p.Pools {\n\t\terr := a.storageAccess.RemoveStoragePool(pool.Name)\n\t\tif err != nil {\n\t\t\tresults.Results[i].Error = common.ServerError(err)\n\t\t}\n\t}\n\treturn results, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (a *ActionAPI) RunOnAllMachines(run params.RunParams) (results params.ActionResults, err error) {\n\tif err := a.checkCanAdmin(); err != nil {\n\t\treturn results, err\n\t}\n\n\tif err := a.check.ChangeAllowed(); err != nil {\n\t\treturn results, errors.Trace(err)\n", "...
{ "audio": "", "image": "", "text": "\t}\n\n\tmachines, err := a.state.AllMachines()\n\tif err != nil {\n\t\treturn results, err\n\t}\n\tmachineTags := make([]names.Tag, len(machines))\n\tfor i, machine := range machines {\n\t\tmachineTags[i] = machine.Tag()\n\t}\n\n\tactionParams := a.createActionsParams(machine...
{ "audio": "", "image": "", "text": "\tfor i, pool := range p.Pools {\n\t\terr := a.storageAccess.RemoveStoragePool(pool.Name)\n\t\tif err != nil {\n\t\t\tresults.Results[i].Error = common.ServerError(err)\n\t\t}\n\t}\n\treturn results, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func bounceErrChanged(err error) error {\n\tif errors.Cause(err) == ErrChanged {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\treturn dependency.ErrBounce\n\t}\n\treturn err\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func stateStepsFor237() []Step {\n\treturn []Step{\n\t\t&upgradeStep{\n\t\t\tdescription: \"ensure container-image-stream isn't set in applications\",", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\ttargets: []Target{DatabaseMaster},\n\t\t\trun: func(context Context) error {\n\t\t\t\treturn context.State().RemoveContainerImageStreamFromNonModelSettings()\n\t\t\t},\n\t\t},\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\teachName(f.Name, func(name string) {\n\t\t\t\t\tf.set.Set(f.Name, strconv.FormatBool(value))\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func hookToolMain(commandName string, ctx *cmd.Context, args []string) (code int, err error) {\n\tcode = 1\n\tcontextId, err := getenv(\"JUJU_CONTEXT_ID\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdir, err := getwd()\n\tif err != nil {\n\t\treturn\n\t}\n\treq := jujuc.Request{\n...
{ "audio": "", "image": "", "text": " = client.Call(\"Jujuc.Main\", req, &resp)\n\tif err != nil && err.Error() == jujuc.ErrNoStdin.Error() {\n\t\treq.Stdin, err = ioutil.ReadAll(os.Stdin)\n\t\tif err != nil {\n\t\t\terr = errors.Annotate(err, \"cannot read stdin\")\n\t\t\treturn\n\t\t}\n\t\treq.StdinSet = true\n...
{ "audio": "", "image": "", "text": " err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Unexpected status code.\")\n\t}\n\n\tdataFromHTTP, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tr...
{ "audio": "", "image": "", "text": "func jujuDMain(args []string, ctx *cmd.Context) (code int, err error) {\n\t// Assuming an average of 200 bytes per log message, use up to\n\t// 200MB for the log buffer.\n\tdefer logger.Debugf(\"jujud complete, code %d, err %v\", code, err)\n\tbufferedLogger, err := logsender....
{ "audio": "", "image": "", "text": "\tupgrades.PreUpgradeSteps,\n\t\t\"\",\n\t)\n\tjujud.Register(agentcmd.NewMachineAgentCmd(ctx, machineAgentFactory, agentConf, agentConf))\n\n\tunitAgent, err := agentcmd.NewUnitAgent(ctx, bufferedLogger)\n\tif err != nil {\n\t\treturn -1, errors.Trace(err)\n\t}\n\tjujud.Regis...
{ "audio": "", "image": "", "text": " the text to be logged\n\tline, err := json.Marshal(fields)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\t// log it to the main log file:\n\tif l.file != nil {\n\t\tfmt.Fprintln(l.file, string(line))\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *provisioner) saveApplicationWorker(appName string, aw worker.Worker) {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\n\tif p.provisioners == nil", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tp.provisioners = make(map[string]worker.Worker)\n\t}\n\tp.provisioners[appName] = aw\n}", "video": "" }
{ "audio": "", "image": "", "text": " error {\n\tp.mu.Lock()\n\tp.Points = append(p.Points, points...)\n\terr := p.Err\n\tp.mu.Unlock()\n\treturn err\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) RunOnAllMachines(commands string, timeout time.Duration) ([]params.ActionResult, error) {\n\tvar results params.ActionResults\n\targs := params.RunParams{Commands: commands, Timeout: timeout}\n", "video": "" }
{ "audio": "", "image": "", "text": "\terr := c.facade.FacadeCall(\"RunOnAllMachines\", args, &results)\n\treturn results.Results, err\n}", "video": "" }
{ "audio": "", "image": "", "text": " service.Commands(options...)...)\n\tapp.Commands = append(app.Commands, new.Commands()...)\n\tapp.Commands = append(app.Commands, web.Commands(options...)...)\n\tapp.Action = func(context *ccli.Context) { ccli.ShowAppHelp(context) }\n\n\tsetup(app)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) Run(run params.RunParams) ([]params.ActionResult, error) {\n\tvar results params.ActionResults\n", "video": "" }
{ "audio": "", "image": "", "text": "\terr := c.facade.FacadeCall(\"Run\", run, &results)\n\treturn results.Results, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\tif len(results.Results) != 1 {\n\t\treturn params.ControllersChanges{}, errors.Errorf(\"expected 1 result, got %d\", len(results.Results))\n\t}\n\tresult := results.Results[0]\n\tif result.Error != nil {\n\t\treturn params.ControllersChanges{}, result.Error\n\t}\n\tretu...
{ "audio": "", "image": "", "text": "func (g EnvironConfigGetter) CloudAPIVersion(spec environs.CloudSpec) (string, error) {\n\t// Only CAAS models have an API version we care about right now.\n\tif g.Model.Type() == state.ModelTypeIAAS {\n\t\treturn \"\", nil\n\t}\n\tcfg, err := g.ModelConfig()\n\tif err != nil ...
{ "audio": "", "image": "", "text": "\t}\n\tbroker, err := newBroker(environs.OpenParams{\n\t\tControllerUUID: ctrlCfg.ControllerUUID(),\n\t\tCloud: spec,\n\t\tConfig: cfg,\n\t})\n\tif err != nil {\n\t\treturn \"\", errors.Trace(err)\n\t}\n\treturn broker.APIVersion()\n}", "video": "" }
{ "audio": "", "image": "", "text": " to %s\", name)\n\t\t}\n\t\t*conn = c\n\t\treturn nil\n\t}\n\n\tg.Go(func() error {\n\t\treturn dialfn(stdin, &set.stdin)\n\t})\n\tg.Go(func() error {\n\t\treturn dialfn(stdout, &set.stdout)\n\t})\n\tg.Go(func() error {\n\t\treturn dialfn(stderr, &set.stderr)\n\t})\n\n\terr = ...
{ "audio": "", "image": "", "text": "func GetNewEnvironFunc(newEnviron environs.NewEnvironFunc) NewEnvironFunc {\n\treturn func(st *state.State) (environs.Environ, error) {\n\t\tm, err := st.Model()\n\t\tif err != nil {\n\t\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn nil, errors.Trace(err)\n\t\t}\n\t\tg := EnvironConfigGetter{State: st, Model: m}\n\t\treturn environs.GetEnviron(g, newEnviron)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " args environs.StartInstanceParams) error {\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func GetNewCAASBrokerFunc(newBroker caas.NewContainerBrokerFunc) NewCAASBrokerFunc {\n\treturn func(st *state.State) (caas.Broker, error) {\n\t\tm, err := st.Model()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tg := EnvironConfigGetter{State: st, Model...
{ "audio": "", "image": "", "text": " nil, errors.Trace(err)\n\t\t}\n\t\tctrlCfg, err := g.ControllerConfig()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\treturn newBroker(environs.OpenParams{\n\t\t\tControllerUUID: ctrlCfg.ControllerUUID(),\n\t\t\tCloud: cloudSpec,\n\t\t\tConfig...
{ "audio": "", "image": "", "text": "\n\t}\n\n\tmodel, err := st.Model()\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tif model.Type() == state.ModelTypeCAAS {\n\t\treturn nil, errors.NotSupportedf(\"high availability on kubernetes controllers\")\n\t}\n\n\treturn &HighAvailabilityAPI{\n\t\tstate: ...
{ "audio": "", "image": "", "text": "func (st *State) setModelAccess(access permission.Access, userGlobalKey, modelUUID string) error {\n\tif err := permission.ValidateModelAccess(access); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\top := updatePermissionOp(modelKey(modelUUID), userGlobalKey, access)\n", ...
{ "audio": "", "image": "", "text": "\terr := st.db().RunTransactionFor(modelUUID, []txn.Op{op})\n\tif err == txn.ErrAborted {\n\t\treturn errors.NotFoundf(\"existing permissions\")\n\t}\n\treturn errors.Trace(err)\n}", "video": "" }
{ "audio": "", "image": "", "text": " = errors.AlreadyExistsf(\"cloud %q\", c.Name)\n\t\t}\n\t\treturn err\n\t}\n\t// Ensure the owner has access to the cloud.\n\townerTag := names.NewUserTag(owner)\n\terr := st.CreateCloudAccess(c.Name, ownerTag, permission.AdminAccess)\n\tif err != nil {\n\t\treturn errors.Anno...
{ "audio": "", "image": "", "text": "func (m *Model) LastModelConnection(user names.UserTag) (time.Time, error) {\n\tlastConnections, closer := m.st.db().GetRawCollection(modelUserLastConnectionC)\n\tdefer closer()\n\n\tusername := user.Id()\n\tvar lastConn modelUserLastConnectionDoc\n", "video": "" }
{ "audio": "", "image": "", "text": "\terr := lastConnections.FindId(m.st.docID(username)).Select(bson.D{{\"last-connection\", 1}}).One(&lastConn)\n\tif err != nil {\n\t\tif err == mgo.ErrNotFound {\n\t\t\terr = errors.Wrap(err, NeverConnectedError(username))\n\t\t}\n\t\treturn time.Time{}, errors.Trace(err)\n\t}...
{ "audio": "", "image": "", "text": " $6, $7, $8, $9) RETURNING id`\n\trow := db.QueryRowx(q, m.User.ID, m.Sentence, pluginName, m.Route,\n\t\tm.AbotSent, m.NeedsTraining, m.User.FlexID, m.User.FlexIDType,\n\t\tm.Trained)\n\tif err := row.Scan(&m.ID); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "video"...
{ "audio": "", "image": "", "text": "func IsNeverConnectedError(err error) bool {\n\t_, ok", "video": "" }
{ "audio": "", "image": "", "text": " := errors.Cause(err).(NeverConnectedError)\n\treturn ok\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\treturn func(req *http.Request, ctx *ProxyCtx) bool {\n\t\t_, ok := hostSet[req.URL.Host]\n\t\treturn ok\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *Model) UpdateLastModelConnection(user names.UserTag) error {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " m.updateLastModelConnection(user, m.st.nowToTheSecond())\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (st *State) modelUser(modelUUID string, user names.UserTag) (userAccessDoc, error) {\n\tmodelUser := userAccessDoc{}\n\tmodelUsers, closer := st.db().GetCollectionFor(modelUUID, modelUsersC)\n\tdefer closer()\n\n\tusername := strings.ToLower(user.Id())\n\terr := modelUser...
{ "audio": "", "image": "", "text": " err != nil {\n\t\treturn userAccessDoc{}, errors.Trace(err)\n\t}\n\t// DateCreated is inserted as UTC, but read out as local time. So we\n\t// convert it back to UTC here.\n\tmodelUser.DateCreated = modelUser.DateCreated.UTC()\n\treturn modelUser, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\treturn string(r)\n\t}\n\tif u.User != nil {\n\t\tu.User = url.User(u.User.Username())\n\t}\n\treturn u.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (st *State) removeModelUser(user names.UserTag) error {\n\tops := removeModelUserOps(st.ModelUUID(), user)\n\terr := st.db().RunTransaction(ops)\n\tif err == txn.ErrAborted {\n\t\terr", "video": "" }
{ "audio": "", "image": "", "text": " = errors.NewNotFound(nil, fmt.Sprintf(\"model user %q does not exist\", user.Id()))\n\t}\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\top := addr.st.networkEntityGlobalKeyRemoveOp(\"address\", addr.ProviderID())\n\t\tops = append(ops, op)\n\t}\n\treturn addr.st.db().RunTransaction(ops)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (st *State) isUserSuperuser(user names.UserTag) (bool, error) {\n\taccess, err := st.UserAccess(user, st.controllerTag)\n\tif err != nil {\n\t\t// TODO(jam): 2017-11-27 We weren't suppressing NotFound here so that we would know when someone asked for\n\t\t// the list of m...
{ "audio": "", "image": "", "text": " asking for all=true.\n\t\treturn false, errors.Trace(err)\n\t}\n\tisControllerSuperuser := (access.Access == permission.SuperuserAccess)\n\treturn isControllerSuperuser, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " s.VoiceConnections[st.GuildID]\n\ts.RUnlock()\n\tif !exists {\n\t\treturn\n\t}\n\n\t// We only care about events that are about us.\n\tif s.State.User.ID != st.UserID {\n\t\treturn\n\t}\n\n\t// Store the SessionID for later use.\n\tvoice.Lock()\n\tvoice.UserID = st.UserID\n\t...
{ "audio": "", "image": "", "text": "func (st *State) modelQueryForUser(user names.UserTag, isSuperuser bool) (mongo.Query, SessionCloser, error) {\n\tvar modelQuery mongo.Query\n\tmodels, closer := st.db().GetCollection(modelsC)\n\tif isSuperuser {\n\t\t// Fast path, we just return all the models that aren't Imp...
{ "audio": "", "image": "", "text": "\tquery.Select(bson.M{\"object-uuid\": 1, \"_id\": 0})\n\t\tquery.Batch(100)\n\t\titer := query.Iter()\n\t\tvar modelUUIDs []string\n\t\tfor iter.Next(&modelUUID) {\n\t\t\tmodelUUIDs = append(modelUUIDs, modelUUID.UUID)\n\t\t}\n\t\tif err := iter.Close(); err != nil {\n\t\t\tc...
{ "audio": "", "image": "", "text": " s.VoiceConnections[st.GuildID]\n\ts.RUnlock()\n\tif !exists {\n\t\treturn\n\t}\n\n\t// We only care about events that are about us.\n\tif s.State.User.ID != st.UserID {\n\t\treturn\n\t}\n\n\t// Store the SessionID for later use.\n\tvoice.Lock()\n\tvoice.UserID = st.UserID\n\t...
{ "audio": "", "image": "", "text": "func (st *State) ModelBasicInfoForUser(user names.UserTag) ([]ModelAccessInfo, error) {\n\tisSuperuser, err := st.isUserSuperuser(user)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tmodelQuery, closer1, err := st.modelQueryForUser(user, isSuperuser)\n\tif err !...
{ "audio": "", "image": "", "text": " := st.db().GetRawCollection(modelUserLastConnectionC)\n\tdefer closer2()\n\tquery := lastConnections.Find(bson.M{\"_id\": bson.M{\"$in\": connDocIds}})\n\tquery.Select(bson.M{\"last-connection\": 1, \"_id\": 0, \"model-uuid\": 1})\n\tquery.Batch(100)\n\titer := query.Iter()\n...
{ "audio": "", "image": "", "text": "\n\t\t\tsuspendOps, err := st.suspendRevokedRelationsOps(offerUUID, user.Id())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Trace(err)\n\t\t\t}\n\t\t\tops = append(ops, suspendOps...)\n\t\t}\n\t\treturn ops, nil\n\t}\n\n\terr = st.db().Run(buildTxn)\n\treturn errors.Trac...
{ "audio": "", "image": "", "text": "func (st *State) IsControllerAdmin(user names.UserTag) (bool, error) {\n\tmodel, err := st.Model()\n\tif err != nil {\n\t\treturn false, errors.Trace(err)\n\t}\n\tua, err := st.UserAccess(user, model.ControllerTag())\n\tif errors.IsNotFound(err) {\n\t\treturn false, nil\n", ...
{ "audio": "", "image": "", "text": "\t}\n\tif err != nil {\n\t\treturn false, errors.Trace(err)\n\t}\n\treturn ua.Access == permission.SuperuserAccess, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\n\tmodel, err := st.Model()\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tif model.Type() == state.ModelTypeCAAS {\n\t\treturn nil, errors.NotSupportedf(\"high availability on kubernetes controllers\")\n\t}\n\n\treturn &HighAvailabilityAPI{\n\t\tstate: ...
{ "audio": "", "image": "", "text": "func (s APIHostPortsSetter) SetAPIHostPorts(servers [][]network.HostPort) error {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " s.ChangeConfig(func(c ConfigSetter) error {\n\t\tc.SetAPIHostPorts(servers)\n\t\treturn nil\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": " net.IPv4(0, 0, 0, 0)\n\tif fp.HostPort.HostIP.Equal(zeroAddr) || fp1.HostPort.HostIP.Equal(zeroAddr) {\n\t\treturn true\n\t}\n\n\tif fp.HostPort.HostIP.Equal(fp1.HostPort.HostIP) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Paths) Migrate(newPaths Paths) {\n\tif newPaths.DataDir != \"\" {\n\t\tp.DataDir = newPaths.DataDir\n\t}\n\tif newPaths.LogDir != \"\" {\n\t\tp.LogDir = newPaths.LogDir\n\t}\n\tif newPaths.MetricsSpoolDir != \"\" {\n\t\tp.MetricsSpoolDir", "video": "" }
{ "audio": "", "image": "", "text": " = newPaths.MetricsSpoolDir\n\t}\n\tif newPaths.ConfDir != \"\" {\n\t\tp.ConfDir = newPaths.ConfDir\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " + \" \" + p.LastName)\n\tif fname == \"\" {\n\t\treturn p.Email\n\t}\n\n\treturn fname\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewPathsWithDefaults(p Paths) Paths {\n\tpaths := DefaultPaths\n\tif p.DataDir != \"\" {\n\t\tpaths.DataDir = p.DataDir\n\t}\n\tif p.LogDir != \"\" {\n\t\tpaths.LogDir = p.LogDir\n\t}\n\tif p.MetricsSpoolDir != \"\" {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tpaths.MetricsSpoolDir = p.MetricsSpoolDir\n\t}\n\tif p.ConfDir != \"\" {\n\t\tpaths.ConfDir = p.ConfDir\n\t}\n\treturn paths\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tfor _, p := range paths {\n\t\tif err := f.Find(ctx, resType, p, dst); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func LogFilename(c Config) string {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " filepath.Join(c.LogDir(), c.Tag().String()+\".log\")\n}", "video": "" }
{ "audio": "", "image": "", "text": " Option {\n\treturn func(c *Config) {\n\t\tc.Daemon.DriverCfg[networkType] = config\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func MachineLockLogFilename(c Config) string", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn filepath.Join(c.LogDir(), machinelock.Filename)\n}", "video": "" }
{ "audio": "", "image": "", "text": " Option {\n\treturn func(c *Config) {\n\t\tc.Daemon.DriverCfg[networkType] = config\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewAgentConfig(configParams AgentConfigParams) (ConfigSetterWriter, error) {\n\tif configParams.Paths.DataDir == \"\" {\n\t\treturn nil, errors.Trace(requiredError(\"data directory\"))\n\t}\n\tif configParams.Tag == nil {\n\t\treturn nil, errors.Trace(requiredError(\"enti...
{ "audio": "", "image": "", "text": " configParams.Jobs,\n\t\tupgradedToVersion: configParams.UpgradedToVersion,\n\t\ttag: configParams.Tag,\n\t\tnonce: configParams.Nonce,\n\t\tcontroller: configParams.Controller,\n\t\tmodel: configParams.Model,\n\t\...
{ "audio": "", "image": "", "text": "\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tvar info jujuclient.RegistrationInfo\n\tif _, err := asn1.Unmarshal(decodedData, &info); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tparams.controllerAddrs = info.Addrs\n\tparams.userTag = names.NewUser...
{ "audio": "", "image": "", "text": "func NewStateMachineConfig(configParams AgentConfigParams, serverInfo params.StateServingInfo) (ConfigSetterWriter, error) {\n\tif serverInfo.Cert == \"\" {\n\t\treturn nil, errors.Trace(requiredError(\"controller cert\"))\n\t}\n\tif serverInfo.PrivateKey == \"\" {\n\t\treturn...
{ "audio": "", "image": "", "text": "\t}\n\tif serverInfo.CAPrivateKey == \"\" {\n\t\treturn nil, errors.Trace(requiredError(\"ca cert key\"))\n\t}\n\tif serverInfo.StatePort == 0 {\n\t\treturn nil, errors.Trace(requiredError(\"state port\"))\n\t}\n\tif serverInfo.APIPort == 0 {\n\t\treturn nil, errors.Trace(requ...
{ "audio": "", "image": "", "text": "\n\t}\n\tcmdResp := resp.RawBatchDelete\n\tif cmdResp == nil {\n\t\treturn errors.Trace(ErrBodyMissing)\n\t}\n\tif cmdResp.GetError() != \"\" {\n\t\treturn errors.New(cmdResp.GetError())\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Dir(dataDir string, tag names.Tag) string {\n\t// Note: must use path, not filepath, as this\n\t// function is used by", "video": "" }
{ "audio": "", "image": "", "text": " the client on Windows.\n\treturn path.Join(BaseDir(dataDir), tag.String())\n}", "video": "" }
{ "audio": "", "image": "", "text": " %d\", use.id.NamePos, use.id.Name, bind)\n\t\t\t}\n\t\t\treturn bind // found\n\t\t}\n\t\tif env.function != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn binding{} // not found in this function\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ReadConfig(configFilePath string) (ConfigSetterWriter, error) {\n\tvar (\n\t\tformat formatter\n\t\tconfig *configInternal\n\t)\n\tconfigData, err := ioutil.ReadFile(configFilePath)\n\tif err != nil {\n\t\treturn nil, errors.Annotatef(err, \"cannot read agent config %q\",...
{ "audio": "", "image": "", "text": " err != nil {\n\t\treturn nil, err\n\t}\n\tlogger.Debugf(\"read agent config, format %q\", format.version())\n\tconfig.configFilePath = configFilePath\n\treturn config, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\treturn nil, bakery.ErrNotFound\n\t\t}\n\t\treturn nil, errors.Annotatef(err, \"cannot get item for location %q\", location)\n\t}\n\tvar rootKey legacyRootKey\n\terr = json.Unmarshal([]byte(i.Item), &rootKey)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"was ...
{ "audio": "", "image": "", "text": "func (c *configInternal) MongoVersion() mongo.Version {\n\tv, err := mongo.NewVersion(c.mongoVersion)\n\tif", "video": "" }
{ "audio": "", "image": "", "text": " err != nil {\n\t\treturn mongo.Mongo24\n\t}\n\treturn v\n}", "video": "" }
{ "audio": "", "image": "", "text": " \"\", errors.Annotate(err, \"cannot obtain mongo build info\")\n\t}\n\treturn binfo.Version, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *configInternal) MongoMemoryProfile() mongo.MemoryProfile {\n\tmprof := mongo.MemoryProfile(c.mongoMemoryProfile)\n\tif err := mprof.Validate(); err != nil {", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn mongo.MemoryProfileLow\n\t}\n\treturn mongo.MemoryProfile(c.mongoMemoryProfile)\n}", "video": "" }
{ "audio": "", "image": "", "text": " else {\n\t\t\t\tg.IRelease(\"END ReferenceConstraint.Validate (FAIL): %s\", err)\n\t\t\t}\n\t\t}()\n\t}\n\n\tc, err := r.Resolved()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.Validate(v)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *configInternal) SetMongoVersion(v", "video": "" }
{ "audio": "", "image": "", "text": " mongo.Version) {\n\tc.mongoVersion = v.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tMap(int64ToInt).\n\t\tWithShrinker(IntShrinker).\n\t\tSuchThat(func(v int) bool {\n\t\t\treturn v >= min && v <= max\n\t\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *configInternal) SetMongoMemoryProfile(v", "video": "" }
{ "audio": "", "image": "", "text": " mongo.MemoryProfile) {\n\tc.mongoMemoryProfile = v.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tMap(int64ToInt).\n\t\tWithShrinker(IntShrinker).\n\t\tSuchThat(func(v int) bool {\n\t\t\treturn v >= min && v <= max\n\t\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *configInternal) WriteCommands(renderer shell.Renderer) ([]string, error) {\n\tdata, err := c.Render()\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tcommands := renderer.MkdirAll(c.Dir())\n\tfilename := c.File(AgentConfigFilename)", "video": "" }
{ "audio": "", "image": "", "text": "\n\tcommands = append(commands, renderer.WriteFile(filename, data)...)\n\tcommands = append(commands, renderer.Chmod(filename, 0600)...)\n\treturn commands, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tp.renderer.previewSuggestionBGColor = x\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *configInternal) APIInfo() (*api.Info, bool) {\n\tif c.apiDetails == nil || c.apiDetails.addresses == nil {\n\t\treturn nil, false\n\t}\n\tservingInfo, isController := c.StateServingInfo()\n\taddrs := c.apiDetails.addresses\n\t// For controller we return only localhost...
{ "audio": "", "image": "", "text": " TODO(macgreagoir) IPv6. Ubuntu still always provides IPv4\n\t\t// loopback, and when/if this changes localhost should resolve\n\t\t// to IPv6 loopback in any case (lp:1644009). Review.\n\t\tlocalAPIAddr := net.JoinHostPort(\"localhost\", strconv.Itoa(port))\n\t\taddrs = []str...
{ "audio": "", "image": "", "text": "\t\t// Update the endpoint API model to report that no redirect is\n\t\t// active or known for that port anymore. We never delete stats\n\t\t// until an endpoint is deleted, so we only set the redirect port\n\t\t// to 0.\n\t\t//\n\t\t// We don't know the L7 protocol of the red...
{ "audio": "", "image": "", "text": "func (c *configInternal) MongoInfo() (info *mongo.MongoInfo, ok bool) {\n\tssi, ok := c.StateServingInfo()\n\tif !ok {\n\t\treturn nil, false\n\t}\n\t// We return localhost first and then all addresses of known API\n\t// endpoints - this lets us connect to other Mongo instance...
{ "audio": "", "image": "", "text": " c.apiDetails.addresses {\n\t\thost, _, err := net.SplitHostPort(addr)\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t\tif host := net.JoinHostPort(host, strconv.Itoa(ssi.StatePort)); host != local {\n\t\t\taddrs = append(addrs, host)\n\t\t}\n\t}\n\treturn &mongo.Mong...
{ "audio": "", "image": "", "text": " connect back to us and send us traffic. We hide the host:port\n\t// so that service instances on remote machines don't try to connect back\n\t// and don't try to send Hyperbahn traffic on this connection.\n\tctx, cancel := NewContextBuilder(timeout).HideListeningOnOutbound()....
{ "audio": "", "image": "", "text": "func isCAASModelFacade(facadeName string) bool {\n\treturn caasModelFacadeNames.Contains(facadeName)", "video": "" }
{ "audio": "", "image": "", "text": " ||\n\t\tcommonModelFacadeNames.Contains(facadeName) ||\n\t\tcommonFacadeNames.Contains(facadeName)\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (e *TermsRequiredError) UserErr() error {\n\tterms := strings.Join(e.Terms,", "video": "" }
{ "audio": "", "image": "", "text": " \" \")\n\treturn errors.Wrap(e,\n\t\terrors.Errorf(`Declined: some terms require agreement. Try: \"juju agree %s\"`, terms))\n}", "video": "" }
{ "audio": "", "image": "", "text": " w.write(func() error {\n\t\te := json.NewEncoder(w.writer)\n\t\treturn e.Encode(data)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (ic *InstanceConstraint) String() string {\n\treturn fmt.Sprintf(\n\t\t\"{region: %s, series: %s, arches: %s, constraints: %s, storage: %s}\",\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tic.Region,\n\t\tic.Series,\n\t\tic.Arches,\n\t\tic.Constraints,\n\t\tic.Storage,\n\t)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tlogger.Debugf(\"HashedRWSet of tx %s, namespace %s, collection %s doesn't contain writes\", txID, namespace, colHashedRWSet.CollectionName)\n\t\treturn false\n\t}\n\treturn true\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (image Image) match(itype InstanceType) imageMatch {\n\tif !image.matchArch(itype.Arches) {\n\t\treturn nonMatch\n\t}\n\tif itype.VirtType == nil || image.VirtType == *itype.VirtType {\n\t\treturn exactMatch\n\t}\n\tif image.VirtType == \"\" {\n\t\t//", "video": "" }
{ "audio": "", "image": "", "text": " Image doesn't specify virtualisation type. We allow it\n\t\t// to match, but prefer exact matches.\n\t\treturn partialMatch\n\t}\n\treturn nonMatch\n}", "video": "" }
{ "audio": "", "image": "", "text": " let's see if it is valid.\n\tfor _, itype := range allInstanceTypes {\n\t\tif itype.Name == *cons.InstanceType {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func New(\n\texternalControllers ExternalControllerUpdaterClient,\n\tnewExternalControllerWatcherClient NewExternalControllerWatcherClientFunc,\n\tclock clock.Clock,\n) (worker.Worker, error) {\n\tw := updaterWorker{\n\t\twatchExternalControllers: externalControllers...
{ "audio": "", "image": "", "text": " bool { return false },\n\n\t\t\t// If the API connection fails, try again in 1 minute.\n\t\t\tRestartDelay: time.Minute,\n\t\t\tClock: clock,\n\t\t}),\n\t}\n\tif err := catacomb.Invoke(catacomb.Plan{\n\t\tSite: &w.catacomb,\n\t\tWork: w.loop,\n\t\tInit: []worker.Worker...
{ "audio": "", "image": "", "text": " nil {\n\t\tworker.TimeInfo = &timeoutInfo{worker: worker, started: time.Now(), state: StartJob}\n\t\tworker.TimeoutChannel <- worker.TimeInfo\n\t}\n\tworker.workInfo.Work(job, worker)\n\tif worker.TimeoutChannel != nil {\n\t\tworker.TimeInfo.state = EndJob\n\t\tworker.Timeout...
{ "audio": "", "image": "", "text": "func NewMockAvailabilityZone(ctrl *gomock.Controller) *MockAvailabilityZone {\n\tmock := &MockAvailabilityZone{ctrl:", "video": "" }
{ "audio": "", "image": "", "text": " ctrl}\n\tmock.recorder = &MockAvailabilityZoneMockRecorder{mock}\n\treturn mock\n}", "video": "" }
{ "audio": "", "image": "", "text": " sync,\n\t}\n\n\tcontroller.logger.Log(\"info\", \"setting up event handlers\")\n\n\t// ----- EVENT HANDLERS for HelmRelease resources change ---------\n\tfhrInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{\n\t\tAddFunc: func(new interface{}) {\n...
{ "audio": "", "image": "", "text": "func (m *MockAvailabilityZone) Available() bool {\n\tret := m.ctrl.Call(m, \"Available\")", "video": "" }
{ "audio": "", "image": "", "text": "\n\tret0, _ := ret[0].(bool)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetAckFrame\", arg0)\n\tret0, _ := ret[0].(*wire.AckFrame)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (mr *MockAvailabilityZoneMockRecorder) Available() *gomock.Call {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Available\", reflect.TypeOf((*MockAvailabilityZone)(nil).Available))\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn nil, ErrInvalidParams()\n\t}\n\n\tmr.m.RLock()\n\tmd, ok := mr.r[r.Method]\n\tmr.m.RUnlock()\n\tif !ok {\n\t\treturn nil, ErrMethodNotFound()\n\t}\n\n\treturn md.Handler, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewMockMetricsCollector(ctrl *gomock.Controller) *MockMetricsCollector {\n\tmock := &MockMetricsCollector{ctrl:", "video": "" }
{ "audio": "", "image": "", "text": " ctrl}\n\tmock.recorder = &MockMetricsCollectorMockRecorder{mock}\n\treturn mock\n}", "video": "" }
{ "audio": "", "image": "", "text": " sync,\n\t}\n\n\tcontroller.logger.Log(\"info\", \"setting up event handlers\")\n\n\t// ----- EVENT HANDLERS for HelmRelease resources change ---------\n\tfhrInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{\n\t\tAddFunc: func(new interface{}) {\n...
{ "audio": "", "image": "", "text": "func (m *MockMetricsCollector) Connections() prometheus.Gauge", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tret := m.ctrl.Call(m, \"Connections\")\n\tret0, _ := ret[0].(prometheus.Gauge)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tprometheus.MustRegister(unhealthyNodes)\n\t\tprometheus.MustRegister(evictionsNumber)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockMetricsCollector) LogReadCount(arg0, arg1 string) prometheus.Counter", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tret := m.ctrl.Call(m, \"LogReadCount\", arg0, arg1)\n\tret0, _ := ret[0].(prometheus.Counter)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tm.ctrl.Call(m, \"AddHeader\", arg0, arg1)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (mr *MockMetricsCollectorMockRecorder) LogReadCount(arg0, arg1 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"LogReadCount\",", "video": "" }
{ "audio": "", "image": "", "text": " reflect.TypeOf((*MockMetricsCollector)(nil).LogReadCount), arg0, arg1)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateAuthorizeCodeSession\", reflect.TypeOf((*MockAuthorizeCodeStorage)(nil).CreateAuthorizeCodeSession), arg0, arg1, arg2)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockMetricsCollector) PingFailureCount(arg0 string) prometheus.Counter {\n\tret :=", "video": "" }
{ "audio": "", "image": "", "text": " m.ctrl.Call(m, \"PingFailureCount\", arg0)\n\tret0, _ := ret[0].(prometheus.Counter)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1beta1.Deployment))\n\t})\n\treturn ret, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockMetricsCollector) TotalConnections() prometheus.Counter", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tret := m.ctrl.Call(m, \"TotalConnections\")\n\tret0, _ := ret[0].(prometheus.Counter)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tprometheus.MustRegister(unhealthyNodes)\n\t\tprometheus.MustRegister(evictionsNumber)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewFacade(apiCaller base.APICaller) (Facade, error) {\n\treturn applicationscaler.NewAPI(\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tapiCaller,\n\t\twatcher.NewStringsWatcher,\n\t), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *streamLayer) Close() error", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tl.tomb.Kill(nil)\n\treturn l.tomb.Wait()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tOnStop: func(_ context.Context) error {\n\t\t\treturn p.Close()\n\t\t},\n\t})\n\treturn p\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *streamLayer) Addr() net.Addr {\n\tselect {\n\tcase <-l.tomb.Dying():\n\t\treturn invalidAddr\n\tcase <-l.clock.After(AddrTimeout):\n\t\tlogger.Errorf(\"streamLayer.Addr timed out waiting for API address\")\n\t\t//", "video": "" }
{ "audio": "", "image": "", "text": " Stop this (and parent) worker.\n\t\tl.tomb.Kill(ErrAddressTimeout)\n\t\treturn invalidAddr\n\tcase addr := <-l.addr:\n\t\treturn addr\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\tselect {\n\t\t\tcase <-l.cancel:\n\t\t\t\treturn nil, errCanceled\n\t\t\tcase <-notifyCh:\n\t\t\t}\n\t\t}\n\t}\n\n\tif err != nil {\n\t\treturn nil, &net.OpError{\n\t\t\tOp: \"accept\",\n\t\t\tNet: \"tcp\",\n\t\t\tAddr: l.Addr(),\n\t\t\tErr: errors.New(err.String()...
{ "audio": "", "image": "", "text": "func (r resources) registerForServer() error {\n\tr.registerState()\n\tr.registerAgentWorkers()", "video": "" }
{ "audio": "", "image": "", "text": "\n\tr.registerHookContext()\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " s.Resources {\n\t\tif r.NeedJWT() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (r resources) registerAgentWorkers() {\n\tif !markRegistered(resource.ComponentName, \"agent-workers\")", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\treturn\n\t}\n\n\tcharmrevisionupdater.RegisterLatestCharmHandler(\"resources\", resourceadapters.NewLatestCharmHandler)\n}", "video": "" }
{ "audio": "", "image": "", "text": " s.Resources {\n\t\tif r.NeedJWT() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewMockZonedEnviron(ctrl *gomock.Controller) *MockZonedEnviron {\n\tmock := &MockZonedEnviron{ctrl: ctrl}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tmock.recorder = &MockZonedEnvironMockRecorder{mock}\n\treturn mock\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tmock := &MockDockerMetadataClient{ctrl: ctrl}\n\tmock.recorder = &MockDockerMetadataClientMockRecorder{mock}\n\treturn mock\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockZonedEnviron) AdoptResources(arg0 context.ProviderCallContext, arg1 string,", "video": "" }
{ "audio": "", "image": "", "text": " arg2 version.Number) error {\n\tret := m.ctrl.Call(m, \"AdoptResources\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " (string, string, string, error) {\n\treturn api.SendMessageContext(context.Background(), channelID, MsgOptionUnfurl(timestamp, unfurls), MsgOptionCompose(options...))\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockZonedEnviron) AvailabilityZones(arg0 context.ProviderCallContext) ([]common.AvailabilityZone, error) {\n\tret := m.ctrl.Call(m, \"AvailabilityZones\", arg0)\n", "video": "" }
{ "audio": "", "image": "", "text": "\tret0, _ := ret[0].([]common.AvailabilityZone)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "video": "" }
{ "audio": "", "image": "", "text": " error {\n\tret := m.ctrl.Call(m, \"Detach\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockZonedEnviron) ConstraintsValidator(arg0 context.ProviderCallContext) (constraints.Validator, error) {\n\tret := m.ctrl.Call(m, \"ConstraintsValidator\", arg0)\n", "video": "" }
{ "audio": "", "image": "", "text": "\tret0, _ := ret[0].(constraints.Validator)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "video": "" }
{ "audio": "", "image": "", "text": " error {\n\tret := m.ctrl.Call(m, \"RunScript\", scriptName, options)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockZonedEnviron) DeriveAvailabilityZones(arg0 context.ProviderCallContext, arg1 environs.StartInstanceParams) ([]string, error) {\n\tret := m.ctrl.Call(m, \"DeriveAvailabilityZones\", arg0,", "video": "" }
{ "audio": "", "image": "", "text": " arg1)\n\tret0, _ := ret[0].([]string)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "video": "" }
{ "audio": "", "image": "", "text": " error {\n\tret := m.ctrl.Call(m, \"Detach\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockZonedEnviron) Destroy(arg0 context.ProviderCallContext)", "video": "" }
{ "audio": "", "image": "", "text": " error {\n\tret := m.ctrl.Call(m, \"Destroy\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " errors.Annotate(err, \"failed to unmarshal JobConfig\").Err()\n\t}\n\treturn func(c context.Context, keys []*datastore.Key) error {\n\t\treturn m.Func(c, j.ID, cfg, keys)\n\t}, nil\n}", "video": "" }