id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c163400 | {
o.SetLabels(labels)
return o
} | |
c163401 | &PatchEndpointIDConfig{Context: ctx, Handler: handler}
} | |
c163402 | range registered {
Unregister(c)
}
return err
}
registered = append(registered, c)
}
return nil
} | |
c163403 | nil {
return *pm.Counter.Value
}
return 0
} | |
c163404 | value = metricLabel.GetGauge().GetValue()
case dto.MetricType_UNTYPED:
value = metricLabel.GetUntyped().GetValue()
case dto.MetricType_SUMMARY:
value = metricLabel.GetSummary().GetSampleSum()
case dto.MetricType_HISTOGRAM:
value = metricLabel.GetHistogram().GetSampleSum()
default:
continu... | |
c163405 | := ip.ParseCIDRs(cidrs.StringSlice())
return result
} | |
c163406 | api.ComputeResultantCIDRSet(rules)
return getPrefixesFromCIDR(cidrs)
} | |
c163407 |
if len(er.ToCIDR) > 0 {
res = append(res, getPrefixesFromCIDR(er.ToCIDR)...)
}
if len(er.ToCIDRSet) > 0 {
res = append(res, GetPrefixesFromCIDRSet(er.ToCIDRSet)...)
}
}
}
return res
} | |
c163408 | return false
}
errn := syscerr.Err.(syscall.Errno)
return errn == syscall.EPIPE
} | |
c163409 | = nil
q.mutex.Unlock()
q.waitingBuilders.Broadcast()
} | |
c163410 | return q.exclusiveBuilds.running == 0 && q.regularBuilds.running == 0
},
},
}
q.waitingBuilders = sync.NewCond(&q.mutex)
nWorkers := numWorkerThreads()
for w := 0; w < nWorkers; w++ {
go q.runWorker()
}
return q
} | |
c163411 | waitForCleanup.Done()
}(status.builder)
}
q.mutex.Unlock()
waitForCleanup.Wait()
} | |
c163412 | = append(b.notificationChannels, notify)
return notify
} | |
c163413 | := range b.notificationChannels {
notify <- success
close(notify)
}
} | |
c163414 | metrics.BuildStateWaiting,
}).Sub(float64(numBuilds))
b.reportStatus(q, false)
return numBuilds
} | |
c163415 | is running, the
// buildStatus continue to be in place until the build has
// completed.
if status.currentBuild == nil {
delete(q.buildStatus, uuid)
}
if status.nextBuild != nil {
num := status.nextBuild.cancelScheduled(q)
defer status.builder.BuildsDequeued(num, true)
}
}
q.mutex.Unlock()
} | |
c163416 |
for status.currentBuild != nil {
waited = true
q.waitingBuilders.Wait()
}
delete(q.buildStatus, uuid)
}
q.mutex.Unlock()
return waited
} | |
c163417 | q.regularBuilds.running > 0:
return fmt.Errorf("Exclusive build is running in parallel with regular build")
default:
for uuid, count := range buildCount {
if count > 1 {
return fmt.Errorf("UUID %s is being built in parallel", uuid)
}
}
}
return nil
} | |
c163418 | &GetStatus{Context: ctx, Handler: handler}
} | |
c163419 | err = gpm.Map.Delete(&k)
gpm.Close()
}
return err
} | |
c163420 | nil, err
}
return &PolicyPlumbingMap{Map: m}, nil
} | |
c163421 | *GetConfigOK {
o.Payload = payload
return o
} | |
c163422 | v := TunnelEndpoint{}, TunnelEndpoint{}
if err := bpf.ConvertKeyValue(key, value, &k, &v); err != nil {
return nil, nil, err
}
return &k, &v, nil
}).WithCache(),
}
} | |
c163423 |
if err != nil {
return net.IP{}, err
}
return val.(*TunnelEndpoint).ToIP(), nil
} | |
c163424 | prefix).Debug("Deleting tunnel map entry")
return TunnelMap.Delete(newTunnelEndpoint(prefix))
} | |
c163425 | != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163426 | is not
// always accessible (e.g. in k8s case "/proc" has to be bind
// mounted). Instead, we check whether the tail call map exists.
if _, err := os.Stat(ep.BPFIpvlanMapPath()); err != nil {
return false, fmt.Errorf("tail call map for IPvlan unavailable: %s", err)
}
} else if _, err := netlink.LinkByName(... | |
c163427 | if bytes < rem {
input[0] = input[0][bytes:] // skip 'bytes' bytes
bytes = 0
} else { // go to the beginning of the next unit
bytes -= rem
input = input[1:] // may result in an empty slice
}
}
return input
} | |
c163428 | {
if reply {
return connection.ReplyBuf
}
return connection.OrigBuf
} | |
c163429 |
// return the number of bytes injected. This may be less than the length of `data` is
// the buffer becomes full.
// Parser may opt dropping the connection via parser error in this case!
return n
} | |
c163430 | := connection.getInjectBuf(reply)
return len(*buf) == cap(*buf)
} | |
c163431 |
if err := m.validatePolicyEnabled(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163432 | managed",
})
m.metricDatapathValidations = prometheus.NewCounter(prometheus.CounterOpts{
Namespace: metrics.Namespace,
Subsystem: "nodes",
Name: name + "_datapath_validations_total",
Help: "Number of validation calls to implement the datapath implemention of a node",
})
err := metrics.RegisterL... | |
c163433 | clean up the datapath for each node
for _, n := range m.nodes {
n.mutex.Lock()
m.datapath.NodeDelete(n.node)
n.mutex.Unlock()
}
} | |
c163434 |
// kvstore updates can overwrite everything except agent local updates and local node
case node.FromKVStore:
return oldSource != node.FromAgentLocal && oldSource != node.FromLocalNode
// kubernetes updates can only overwrite kubernetes nodes
case node.FromKubernetes:
return oldSource != node.FromAgentLocal &&... | |
c163435 | from %s: %#v", n.Source, n)
m.nodeUpdated(n, false)
} | |
c163436 | entry.mutex.Lock()
nodes[nodeIdentity] = entry.node
entry.mutex.Unlock()
}
return nodes
} | |
c163437 | entry.mutex.Unlock()
}
m.nodes = map[node.Identity]*nodeEntry{}
m.mutex.Unlock()
} | |
c163438 | := range r.Egress {
err := k.TranslateEgress(&r.Egress[egressIndex], result)
if err != nil {
return err
}
}
return nil
} | |
c163439 |
for _, c := range egress.ToCIDRSet {
_, cidr, err := net.ParseCIDR(string(c.Cidr))
if err != nil {
return err
}
if cidr.Contains(epIP) {
found = true
break
}
}
if !found {
cidr := net.IPNet{IP: epIP.Mask(mask), Mask: mask}
egress.ToCIDRSet = append(egress.ToCIDRSet, api.CIDRRule{... | |
c163440 | ok := cache.services[ns]
if ok && svc.IsExternal() {
t := NewK8sTranslator(ns, *ep, false, svc.Labels, ipcache)
err := t.Translate(rule, &policy.TranslationResult{})
if err != nil {
return err
}
}
}
}
return nil
} | |
c163441 |
ipcache ipcache.Implementation) RuleTranslator {
return RuleTranslator{serviceInfo, endpoint, labels, revert, ipcache}
} | |
c163442 | n,
logfields.Duration: d,
})
_, file, line, ok := runtime.Caller(1)
if ok {
logger = logger.WithFields(log.Fields{
logfields.Path: file,
logfields.Line: line,
})
}
logger.Warn("BUG: negative duration")
return time.Duration(0), false
}
return d, true
} | |
c163443 | != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163444 | != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163445 | {
if err := m[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163446 | // Changing files permissions to -rwx:r--:---, we are only
// adding executable permission to the owner and keeping the
// same permissions stored by go-bindata.
if err := os.Chmod(fileToChange, os.FileMode(0740)); err != nil {
return err
}
}
return err
} | |
c163447 | log.WithField(logfields.Interface, ifaceName).
Info("Underlying interface initialized with containers!")
break
}
select {
case <-cleanUPSig:
return errors.New("clean up signal triggered")
default:
time.Sleep(time.Second)
}
}
return nil
} | |
c163448 | }
default:
ParseError(fmt.Sprintf("Unsupported key: %s", k), rule)
}
}
if len(cr.queryActionExact) > 0 {
// ensure this is a valid query action
res := queryActionMap[cr.queryActionExact]
if res == invalidAction {
ParseError(fmt.Sprintf("Unable to parse L7 cassandra rule with invalid query_ac... | |
c163449 | '%s' for stream-id %d", preparedID, streamID)
path := p.preparedQueryPathByStreamID[streamID]
if len(path) > 0 {
// found cached query path to associate with this preparedID
p.preparedQueryPathByPreparedID[preparedID] = path
log.Debugf("Associating query path '%s' with prepared-id %s as part of strea... | |
c163450 | cip = newCachedSelectorPolicy(identity)
cache.policies[identity.ID] = cip
}
computed := false
if cip != nil {
computed = cip.getPolicy().Revision > 0
}
return cip, computed
} | |
c163451 | return cache.lookupOrCreate(identity, true)
} | |
c163452 |
defer cache.Unlock()
_, ok := cache.policies[identity.ID]
if ok {
delete(cache.policies, identity.ID)
}
return ok
} | |
c163453 | race down to
// here. Set the pointer to the latest revision in both cases.
//
// Note that because repo.Mutex is held, the two racing threads will be
// guaranteed to compute policy for the same revision of the policy.
// We could save some CPU by, for example, forcing resolution of policy
// for the same ident... | |
c163454 | := globalPolicyCache.lookupOrCreate(identity, false)
return cip
} | |
c163455 | err := globalPolicyCache.updateSelectorPolicy(repo, identity)
return err
} | |
c163456 | params[1]) {
return true, ""
}
return false, comparator.CompareWithNames(params[0], params[1], names[0], names[1])
} | |
c163457 | exist in local cache")
}
serverRule, ok := serverRuleStore.(*types.SlimCNP)
if !ok {
return nil, errors.New("Received object of unknown type from API server, expecting v2.CiliumNetworkPolicy")
}
return serverRule, nil
} | |
c163458 | nil {
scopedLog.WithError(statusErr).Debug("CNP status for invalid rule cannot be updated")
}
}
if err != nil {
return err
}
err = c.updateStatus(serverRule, rev, policyImportErr, waitForEPsErr)
scopedLog.WithError(err).WithField("status", serverRule.Status).Debug("CNP status update result from ap... | |
c163459 | service definition of remote cluster")
delete(globalService.clusterServices, clusterName)
// After the last cluster service is removed, remove the
// global service
if len(globalService.clusterServices) == 0 {
scopedLog.Debugf("Deleted global service %s", serviceName)
delete(c.byName, serviceName)
}
} | |
c163460 | merger != nil {
merger.MergeExternalServiceUpdate(svc)
} else {
scopedLog.Debugf("Ignoring remote service update. Missing merger function")
}
} else {
log.Warningf("Received unexpected remote service update object %+v", key)
}
} | |
c163461 | merger != nil {
merger.MergeExternalServiceDelete(svc)
} else {
scopedLog.Debugf("Ignoring remote service update. Missing merger function")
}
} else {
log.Warningf("Received unexpected remote service delete object %+v", key)
}
} | |
c163462 | globalStatusFunctions.register(name, fn)
} | |
c163463 | time.Duration) *GetIdentityEndpointsParams {
o.SetTimeout(timeout)
return o
} | |
c163464 | context.Context) *GetIdentityEndpointsParams {
o.SetContext(ctx)
return o
} | |
c163465 | *http.Client) *GetIdentityEndpointsParams {
o.SetHTTPClient(client)
return o
} | |
c163466 | res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163467 | {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163468 | nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163469 | *models.BPFMap) *GetMapNameOK {
o.Payload = payload
return o
} | |
c163470 | := c.Restapi.GetHello(nil)
return err
} | |
c163471 | = netlink.LinkDel(link)
if err != nil {
scopedLog.WithError(err).Warning("Couldn't delete cilium-health device")
}
} else {
scopedLog.WithError(err).Debug("Didn't find existing device")
}
}
} | |
c163472 | k.NextHeader.String(), addrDest, k.DestPort,
k.SourcePort),
)
}
if k.Flags&TUPLE_F_RELATED != 0 {
buffer.WriteString("related ")
}
if k.Flags&TUPLE_F_SERVICE != 0 {
buffer.WriteString("service ")
}
return true
} | |
c163473 | *k.TupleKey4.ToNetwork().(*TupleKey4),
}
} | |
c163474 | *k.TupleKey4.ToHost().(*TupleKey4),
}
} | |
c163475 | &GetMap{Context: ctx, Handler: handler}
} | |
c163476 | time.Duration) *GetHealthzParams {
o.SetTimeout(timeout)
return o
} | |
c163477 | *GetHealthzParams {
o.SetContext(ctx)
return o
} | |
c163478 | o.SetHTTPClient(client)
return o
} | |
c163479 | {
id.Name = svc.Spec.Backend.ServiceName
}
return id
} | |
c163480 |
svc := NewService(host, false, nil, nil)
portName := loadbalancer.FEPortName(ingress.Spec.Backend.ServiceName + "/" + ingress.Spec.Backend.ServicePort.String())
svc.Ports[portName] = loadbalancer.NewFEPort(loadbalancer.TCP, uint16(ingressPort))
return svcID, svc, nil
} | |
c163481 | &GetEndpointIDLabels{Context: ctx, Handler: handler}
} | |
c163482 | {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | |
c163483 | &GetIdentity{Context: ctx, Handler: handler}
} | |
c163484 | metrics.APIInteractions,
}
return &api.APIPanicHandler{
Next: eventsHelper,
}
} | |
c163485 | connState(n.Reason), ifname(int(n.Ifindex)), GetConnectionSummary(data[TraceNotifyLen:]))
} | |
c163486 | 0 {
fmt.Printf(", interface %s", ifname(int(n.Ifindex)))
}
if n.SrcLabel != 0 || n.DstLabel != 0 {
fmt.Printf(", identity %d->%d", n.SrcLabel, n.DstLabel)
}
if n.DstID != 0 {
fmt.Printf(", to endpoint %d\n", n.DstID)
} else {
fmt.Printf("\n")
}
if n.CapLen > 0 && len(data) > TraceNotifyLen {
Dissec... | |
c163487 | State: connState(n.Reason),
ObservationPoint: obsPoint(n.ObsPoint),
TraceSummary: n.traceSummary(),
Source: n.Source,
Bytes: n.OrigLen,
SrcLabel: n.SrcLabel,
DstLabel: n.DstLabel,
DstID: n.DstID,
}
} | |
c163488 | &PatchEndpointIDLabels{Context: ctx, Handler: handler}
} | |
c163489 | fmt.Fprintf(fw, "#define CIDR4_FILTER\n")
if p.config.dyn4Enabled {
fmt.Fprintf(fw, "#define CIDR4_LPM_PREFILTER\n")
}
}
if p.config.fix6Enabled {
fmt.Fprintf(fw, "#define CIDR6_FILTER\n")
if p.config.dyn6Enabled {
fmt.Fprintf(fw, "#define CIDR6_LPM_PREFILTER\n")
}
}
} | |
c163490 | i++ {
to = p.dumpOneMap(i, to)
}
return to, p.revision
} | |
c163491 | %s not supported on device %s", mode, device)
default:
return fmt.Errorf("Prefilter not supported on OS")
}
}
} else {
return fmt.Errorf("Cannot wait for ip command: %v", err)
}
}
return nil
} | |
c163492 | := &PreFilter{
revision: 1,
config: c,
}
// Only needed here given we access pinned maps.
p.mutex.Lock()
defer p.mutex.Unlock()
return p.init()
} | |
c163493 | DEBUG: %s\n", prefix, n.Hash, n.Source, n.subTypeString())
} | |
c163494 | fmt.Printf("%s: %s\n", prefix, GetConnectionSummary(data[DebugCaptureLen:]))
}
} | |
c163495 |
if n.Len > 0 && len(data) > DebugCaptureLen {
Dissect(dissect, data[DebugCaptureLen:])
}
} | |
c163496 | Bytes: n.Len,
Message: n.subTypeString(),
Prefix: n.infoPrefix(),
}
} | |
c163497 |
for ip, owner := range allocv6 {
v6 = append(v6, ip)
// merge allocv6 into allocv4
allocv4[ip] = owner
}
if option.Config.EnableIPv4 {
status.IPV4 = v4
}
if option.Config.EnableIPv6 {
status.IPV6 = v4
}
status.Allocations = allocv4
return status
} | |
c163498 | source.GetIPv6Address(),
Labels: source.GetLabels(),
LabelsSHA256: source.GetLabelsSHA(),
Identity: uint64(source.GetIdentity()),
}
} | |
c163499 | && l4Policy.HasRedirect()) {
keys[localHostKey] = MapStateEntry{}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.